mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: saravanak@kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of: unittest: Remove refcount underflow tests
Date: Mon, 2 Nov 2026 12:19:10 -0600	[thread overview]
Message-ID: <20261102181910.GF1232511-robh@kernel.org> (raw)
In-Reply-To: <20261101122128.2124348-1-dakr@kernel.org>

On Sun, Nov 01, 2026 at 01:19:29PM +0100, Danilo Krummrich wrote:
> With CONFIG_OF_UNITTEST=y and CONFIG_BUG_ON_DATA_CORRUPTION=y, the
> machine no longer boots after commit 5b5224220747 ("refcount: Use
> CONFIG_BUG_ON_DATA_CORRUPTION for UAF-related errors").
> 
> of_unittest_lifecycle() deliberately calls of_node_put() after the
> node's reference count has reached zero. The test expects a warning and
> continues to check that a subsequent put does not produce another
> warning. With BUG_ON_DATA_CORRUPTION enabled, refcount underflow now
> triggers BUG() instead. This panics the kernel during boot:
> 
> 	kernel BUG at lib/refcount.c:37!
> 	Oops: invalid opcode: 0000 [#1] SMP NOPTI
> 	CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Tainted: G                 N  7.3.0+ #14 PREEMPT(full)
> 	RIP: 0010:refcount_warn_saturate+0x89/0x90
> 	Call Trace:
> 	 of_unittest_lifecycle+0x158/0x310
> 	 of_unittest+0x105/0x130
> 	 do_one_initcall+0x127/0x350
> 	 do_initcall_level+0x7c/0xe0
> 	 do_initcalls+0x59/0xa0
> 	 kernel_init_freeable+0x118/0x1a0
> 	 kernel_init+0x1f/0x140
> 	Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
> 
> Remove the refcount underflow tests, which exercise the refcount
> implementation rather than OF-specific behavior.
> 
> Fixes: 5b5224220747 ("refcount: Use CONFIG_BUG_ON_DATA_CORRUPTION for UAF-related errors")
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
>  drivers/of/unittest.c | 43 -------------------------------------------
>  1 file changed, 43 deletions(-)

Applied, thanks.

Rob

      reply	other threads:[~2026-11-02 18:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 12:19 Danilo Krummrich
2026-11-02 18:19 ` Rob Herring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261102181910.GF1232511-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=dakr@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saravanak@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®