Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 8b64d42

Browse files
Tetsuo HandaKAGA-KOKO
authored andcommitted
debugobjects: Recheck debug_objects_enabled before reporting
syzbot is reporting false a positive ODEBUG message immediately after ODEBUG was disabled due to OOM. [ 1062.309646][T22911] ODEBUG: Out of memory. ODEBUG disabled [ 1062.886755][ T5171] ------------[ cut here ]------------ [ 1062.892770][ T5171] ODEBUG: assert_init not available (active state 0) object: ffffc900056afb20 object type: timer_list hint: process_timeout+0x0/0x40 CPU 0 [ T5171] CPU 1 [T22911] -------------- -------------- debug_object_assert_init() { if (!debug_objects_enabled) return; db = get_bucket(addr); lookup_object_or_alloc() { debug_objects_enabled = 0; return NULL; } debug_objects_oom() { pr_warn("Out of memory. ODEBUG disabled\n"); // all buckets get emptied here, and } lookup_object_or_alloc(addr, db, descr, false, true) { // this bucket is already empty. return ERR_PTR(-ENOENT); } // Emits false positive warning. debug_print_object(&o, "assert_init"); } Recheck debug_object_enabled in debug_print_object() to avoid that. Reported-by: syzbot <[email protected]> Suggested-by: Thomas Gleixner <[email protected]> Signed-off-by: Tetsuo Handa <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Closes: https://syzkaller.appspot.com/bug?extid=7937ba6a50bdd00fffdf
1 parent 7877cb9 commit 8b64d42

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/debugobjects.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,15 @@ static void debug_print_object(struct debug_obj *obj, char *msg)
498498
const struct debug_obj_descr *descr = obj->descr;
499499
static int limit;
500500

501+
/*
502+
* Don't report if lookup_object_or_alloc() by the current thread
503+
* failed because lookup_object_or_alloc()/debug_objects_oom() by a
504+
* concurrent thread turned off debug_objects_enabled and cleared
505+
* the hash buckets.
506+
*/
507+
if (!debug_objects_enabled)
508+
return;
509+
501510
if (limit < 5 && descr != descr_test) {
502511
void *hint = descr->debug_hint ?
503512
descr->debug_hint(obj->object) : NULL;

0 commit comments

Comments
 (0)