Merge branch 'slab/for-6.2/kmalloc_redzone' into slab/for-next
authorVlastimil Babka <vbabka@suse.cz>
Fri, 11 Nov 2022 08:08:18 +0000 (09:08 +0100)
committerVlastimil Babka <vbabka@suse.cz>
Mon, 21 Nov 2022 09:36:09 +0000 (10:36 +0100)
commit90e9b23a60d5b4c8317f58e01ed05d3bdf063440
treeb87f0bd1d2c0ab251fafcbc4aebd5e3c73799397
parent76537db3b95cbf5d0189ce185c16db9f93017021
parent946fa0dbf2d8923a587f7348adf16563d59f1b3d
Merge branch 'slab/for-6.2/kmalloc_redzone' into slab/for-next

kmalloc() redzone improvements by Feng Tang

From cover letter [1]:

kmalloc's API family is critical for mm, and one of its nature is that
it will round up the request size to a fixed one (mostly power of 2).
When user requests memory for '2^n + 1' bytes, actually 2^(n+1) bytes
could be allocated, so there is an extra space than what is originally
requested.

This patchset tries to extend the redzone sanity check to the extra
kmalloced buffer than requested, to better detect un-legitimate access
to it. (depends on SLAB_STORE_USER & SLAB_RED_ZONE)

[1] https://lore.kernel.org/all/20221021032405.1825078-1-feng.tang@intel.com/
mm/slab.c
mm/slab.h
mm/slub.c