mbox series

[v2,0/3] Assorted improvements to usercopy

Message ID 20211006124226.209484-1-willy@infradead.org (mailing list archive)
Headers show
Series Assorted improvements to usercopy | expand

Message

Matthew Wilcox Oct. 6, 2021, 12:42 p.m. UTC
We must prohibit page boundary crossing for kmap() addresses.
vmap() addresses are limited by the length of the mapping, and
compound pages are limited by the size of the page.

These should probably all have test cases?

v2:
 - Prevent a NULL pointer dereference when a vmalloc-range pointer
   doesn't have an associated allocation (me)
 - Report better offsets than "0" (Kees)

Matthew Wilcox (Oracle) (3):
  mm/usercopy: Check kmap addresses properly
  mm/usercopy: Detect vmalloc overruns
  mm/usercopy: Detect compound page overruns

 arch/x86/include/asm/highmem.h   |  1 +
 include/linux/highmem-internal.h | 10 ++++++++
 mm/usercopy.c                    | 42 +++++++++++++++++++++++---------
 3 files changed, 42 insertions(+), 11 deletions(-)