]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/slub, kunit: Add testcase for krealloc redzone and zeroing
authorFeng Tang <feng.tang@intel.com>
Wed, 16 Oct 2024 15:41:52 +0000 (23:41 +0800)
committerVlastimil Babka <vbabka@suse.cz>
Sat, 16 Nov 2024 20:19:39 +0000 (21:19 +0100)
commit080c8579c37ec9c11cfb8b9eb25b74912b33dc06
tree53794ad683db5cacaa3330331a178ce77dd0f2fc
parent5474d33ca48e7764ccc38b2ac089863cca83280a
mm/slub, kunit: Add testcase for krealloc redzone and zeroing

Danilo Krummrich raised issue about krealloc+GFP_ZERO [1], and Vlastimil
suggested to add some test case which can sanity test the kmalloc-redzone
and zeroing by utilizing the kmalloc's 'orig_size' debug feature.

It covers the grow and shrink case of krealloc() re-using current kmalloc
object, and the case of re-allocating a new bigger object.

[1]. https://lore.kernel.org/lkml/20240812223707.32049-1-dakr@kernel.org/

Suggested-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
lib/slub_kunit.c