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. 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 compound page overruns usercopy: Remove HARDENED_USERCOPY_PAGESPAN arch/x86/include/asm/highmem.h | 1 + include/linux/highmem-internal.h | 10 ++++ mm/usercopy.c | 98 +++++++++----------------------- security/Kconfig | 13 +---- 4 files changed, 40 insertions(+), 82 deletions(-) -- 2.33.0