Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp666425rwd; Wed, 7 Jun 2023 05:29:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Yro8ibHaAPUYBnE66AUQGmxq3bNifL+Wdtlkq82Lu+t++uX1pnk1Qf4Ot0zgNQMu+rGTW X-Received: by 2002:a05:6358:c50f:b0:128:205a:ce6 with SMTP id fb15-20020a056358c50f00b00128205a0ce6mr3050320rwb.26.1686140960711; Wed, 07 Jun 2023 05:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686140960; cv=none; d=google.com; s=arc-20160816; b=n4FPHNzUQvDk7gjtIqEXzS2dTsh5zqmqGSqI3LNNW0yY90t+SmQZc5HuetgvRrvmuL M1Svtb7neo/q8yZ9km7/nrTWifqpHzUFGqT4wc6fz10PdKOpfZJQAPEgWrfnoELBg/Db S3Um3GvSnmeMy9oMn9xLdAiSsFmyHDtbNs+t/Ch7y8ezZZeD1NYkSak9dPbdZdHZPNiR j7YUc8vVaATTgQ98ooHukMNK4cwu3krMRTAwUfHQYDMebkqEM1E5ViY79kLZplMKQIQY qtiDUwm4KZQNWuS90TBZJyvFbZaZ+4j4resSg+EyuJbkw/v1duCNPUPBoP9yaWYjvIiu dUKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=dpvlICurWarW51eR/TeI8KmBxKEzGBZ71h3PMPZpOKc=; b=Uoe5eY/RJ3HJTvztnSgy5U9MCK9uZFVAEe/lSe6imAhIrcQHZcwxpK6NE2jVWipXXt vzEzCg+H35pnN3QJRJoq5GGiP7snKdKmtlYiF/2cqzLghWp5c8SDli9xCY6GAw2CvlNd RYGfW1siEik+HwCi6b1dBR0FgD9M7i8ARv/eQ/YUJfjzYmxPE9lwVYkosoiCqrjCklAN ziWj9Nm6NcBJ48kDp19Mj2T3edLnH1p8jRZdEJ72YeNQYyyQa5d+PPYWH8dulQSOdl4r Dw74YjPhpvCbcwPZr3WUqyvDY2uzB6C82KfJnDx29LR9e4XJPnw/+DaX051nyOojokNZ 2uoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Q26+m38i; dkim=neutral (no key) header.i=@linutronix.de header.b=MI56Wvjt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca5-20020a17090af30500b00255d8dda719si1041469pjb.148.2023.06.07.05.29.04; Wed, 07 Jun 2023 05:29:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Q26+m38i; dkim=neutral (no key) header.i=@linutronix.de header.b=MI56Wvjt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240668AbjFGMU5 (ORCPT + 99 others); Wed, 7 Jun 2023 08:20:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240340AbjFGMUz (ORCPT ); Wed, 7 Jun 2023 08:20:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA4F21BE2; Wed, 7 Jun 2023 05:20:45 -0700 (PDT) Date: Wed, 07 Jun 2023 12:20:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686140444; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dpvlICurWarW51eR/TeI8KmBxKEzGBZ71h3PMPZpOKc=; b=Q26+m38iLKJc9LXLX69KNUjTejrLWC9dqRfz7yJG559Lv5ENyaBouEzOKccpP4GodJ0Lst FdXLVVyOMDVF0Jrnn9jdpBfAYwp5hPTjA/B8J3Rp+JR9StgepMkNs40OIceOvCDAv9ABn+ Ha1KyEYnGt34IQ0gO3M4SDu5gawpN/SIQWTL91u8njevimONHlTJBdGbmVADbvfjJTvYH6 bcGiOUgVXxQ8Lt7hw7L6hDB+S+yJLepT0b3y+pyRj8nAGjfhrpwkJpv1lp5ToKiuVChlrQ a5IOGe4POn22IoYhJVp/zIQP1t0nrvGBZSGzG/Hod7NidsAZAN5sAGlEMKC1Jg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686140444; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dpvlICurWarW51eR/TeI8KmBxKEzGBZ71h3PMPZpOKc=; b=MI56WvjtsdnYJ4oEqnCjhhbgUOUPR5M1wTaL+9kcouVyXdzrp7/Z9EmFuAPFZJO6jn7kcH Kmkxs3GujbeeMbCA== From: "tip-bot2 for Tetsuo Handa" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/debugobjects] debugobjects: Recheck debug_objects_enabled before reporting Cc: syzbot , Thomas Gleixner , Tetsuo Handa , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <492fe2ae-5141-d548-ebd5-62f5fe2e57f7@I-love.SAKURA.ne.jp> References: <492fe2ae-5141-d548-ebd5-62f5fe2e57f7@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Message-ID: <168614044350.404.4585037016201397086.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the core/debugobjects branch of tip: Commit-ID: 8b64d420fe2450f82848178506d3e3a0bd195539 Gitweb: https://git.kernel.org/tip/8b64d420fe2450f82848178506d3e3a0bd195539 Author: Tetsuo Handa AuthorDate: Wed, 07 Jun 2023 19:19:02 +09:00 Committer: Thomas Gleixner CommitterDate: Wed, 07 Jun 2023 14:16:12 +02:00 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 Suggested-by: Thomas Gleixner Signed-off-by: Tetsuo Handa Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/492fe2ae-5141-d548-ebd5-62f5fe2e57f7@I-love.SAKURA.ne.jp Closes: https://syzkaller.appspot.com/bug?extid=7937ba6a50bdd00fffdf --- lib/debugobjects.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 984985c..a517256 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -498,6 +498,15 @@ static void debug_print_object(struct debug_obj *obj, char *msg) const struct debug_obj_descr *descr = obj->descr; static int limit; + /* + * Don't report if lookup_object_or_alloc() by the current thread + * failed because lookup_object_or_alloc()/debug_objects_oom() by a + * concurrent thread turned off debug_objects_enabled and cleared + * the hash buckets. + */ + if (!debug_objects_enabled) + return; + if (limit < 5 && descr != descr_test) { void *hint = descr->debug_hint ? descr->debug_hint(obj->object) : NULL;