Skip to content

Assorted improvements to usercopy

Matthew Wilcox (Oracle) linux-hardening linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 6 repliesIn review

v5 from the cover letter

- Use get_vm_area_size() instead of ->size directly (Mark Hemment)
- Rebase to current Linus (the slab merge changed a lot of code)

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mm/usercopy: Check kmap addresses properlyarch/x86/include/asm/highmem.h include/linux/highmem-internal.h mm/usercopy.c+21 -62 replies
2/4mm/usercopy: Detect vmalloc overrunsmm/usercopy.c+16 -00 replies
3/4mm/usercopy: Detect large folio overrunsmm/usercopy.c+4 -61 reply
4/4usercopy: Remove HARDENED_USERCOPY_PAGESPANmm/usercopy.c security/Kconfig+1 -733 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchKees CookDavid Hildenbrand
1/4A-b
2/4A-b
3/4A-b R-b
4/4A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] Assorted improvements to usercopy

The HARDENED_USERCOPY_PAGESPAN config option is hard to turn on because much of the kernel uses non-compound high-order page allocations. This patchset extracts the valuable parts of HARDENED_USERCOPY_PAGESPAN and then removes the remainder.

v5:
- Use get_vm_area_size() instead of ->size directly (Mark Hemment)
- Rebase to current Linus (the slab merge changed a lot of code)
v4:
- Add the fourth patch to remove HARDENED_USERCOPY_PAGESPAN
v3:
- Remove a now-unused variable
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) (4):
mm/usercopy: Check kmap addresses properly
mm/usercopy: Detect vmalloc overruns
mm/usercopy: Detect large folio overruns
usercopy: Remove HARDENED_USERCOPY_PAGESPAN

 arch/x86/include/asm/highmem.h   |  1 +
 include/linux/highmem-internal.h | 10 ++++
 mm/usercopy.c                    | 97 +++++++++-----------------------
 security/Kconfig                 | 13 +----
 4 files changed, 39 insertions(+), 82 deletions(-)
Signature · 1 line
2.33.0