[PATCH 0/2] debugobjects: Fix NULL pointer dereference in kmem_alloc_batch()

From: Sang-Heon Jeon

Date: Sun Nov 08 2026 - 23:14:58 EST


Hello,

During boot, kmem_alloc_batch() is called while obj_cache is still NULL.
If kmem_cache_zalloc() fails there, free_object_list() calls
kmem_cache_free() with obj_cache, which causes a NULL pointer dereference.

Patch 1 fixes it by passing the cache to free_object_list().

Patch 2 uses free_object_list() in the boot error path instead of open
coding the loop.

Sang-Heon Jeon (2):
debugobjects: Fix NULL pointer dereference in kmem_alloc_batch()
debugobjects: Use free_object_list() in the boot error path

lib/debugobjects.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)


base-commit: 9f74092fda91ef93c2b07585785c1dc83cd7971f
--
2.53.0