Skip to content

debugobjects: Fix NULL pointer dereference in kmem_alloc_batch()

Sang-Heon Jeon lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2debugobjects: Fix NULL pointer dereference in kmem_alloc_batch()lib/debugobjects.c+4 -42 replies
2/2debugobjects: Use free_object_list() in the boot error pathlib/debugobjects.c+1 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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

Signature · 1 line
2.53.0