Skip to content

Commit 145f3d4

Browse files
htejungregkh
authored andcommitted
percpu: perform tlb flush after pcpu_map_pages() failure
commit 849f516 upstream. If pcpu_map_pages() fails midway, it unmaps the already mapped pages. Currently, it doesn't flush tlb after the partial unmapping. This may be okay in most cases as the established mapping hasn't been used at that point but it can go wrong and when it goes wrong it'd be extremely difficult to track down. Flush tlb after the partial unmapping. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a3079e4 commit 145f3d4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎mm/percpu-vm.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ static int pcpu_map_pages(struct pcpu_chunk *chunk,
272272
__pcpu_unmap_pages(pcpu_chunk_addr(chunk, tcpu, page_start),
273273
page_end - page_start);
274274
}
275+
pcpu_post_unmap_tlb_flush(chunk, page_start, page_end);
275276
return err;
276277
}
277278

0 commit comments

Comments
 (0)