diff options
author | Chengming Zhou <chengming.zhou@linux.dev> | 2024-06-07 16:40:13 +0800 |
---|---|---|
committer | Vlastimil Babka <vbabka@suse.cz> | 2024-06-07 11:03:24 +0200 |
commit | adef2aeaa2b936c97865d56c59be2cb7266acbb7 (patch) | |
tree | 79957bf4bc610ff7de0112abd6b9573ccd258210 /rust/kernel/alloc/allocator.rs | |
parent | 47d911b02cbe61494bb066ad84cc66d25091d506 (diff) |
slab: don't put freepointer outside of object if only orig_size
The commit 946fa0dbf2d8 ("mm/slub: extend redzone check to extra
allocated kmalloc space than requested") will extend right redzone
when allocating for orig_size < object_size. So we can't overlay the
freepointer in the object space in this case.
But the code looks like it forgot to check SLAB_RED_ZONE, since there
won't be extended right redzone if only orig_size enabled.
As we are here, make this complex conditional expressions a little
prettier and add some comments about extending right redzone when
slub_debug_orig_size() enabled.
Reviewed-by: Feng Tang <feng.tang@intel.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Chengming Zhou <chengming.zhou@linux.dev>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'rust/kernel/alloc/allocator.rs')
0 files changed, 0 insertions, 0 deletions