[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALbr=LbqRixCSx-EpmK=mO9CRBqS2B-wR_CDM3QLVX4-Cgc-8Q@mail.gmail.com>
Date: Wed, 21 Jan 2026 15:18:42 +0800
From: Gui-Dong Han <hanguidong02@...il.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: Mark Brown <broonie@...nel.org>, gregkh@...uxfoundation.org, rafael@...nel.org,
linux-kernel@...r.kernel.org, baijiaju1990@...il.com,
Qiu-ji Chen <chenqiuji666@...il.com>, Aishwarya.TCV@....com,
Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [PATCH v5] driver core: enforce device_lock for driver_match_device()
On Wed, Jan 21, 2026 at 9:11 AM Danilo Krummrich <dakr@...nel.org> wrote:
>
> On Tue Jan 20, 2026 at 10:18 PM CET, Danilo Krummrich wrote:
> > Anyways, this should work:
>
> I Just notied that I pasted the wrong diff, which was nonsense of course, since
> it just unlocks all the suppressed false positives. (Should not have sent it
> during a meeting. :)
>
> What I actually intended (not neat, but hopefully helps):
Thanks for the updated diff.
I tested it on my QEMU setup. Since I couldn't reproduce the hang
there, I didn't see any lockdep splats regarding the deadlock.
However, since the physical lock is removed, my PoCs successfully
triggered the UAF on both paths as expected.
I did notice a lockdep warning during boot, which happens every time.
I suspect this is because faux_bus_init is an __init function, so we
are registering a key from memory that gets freed. This seems specific
to the debug code, but I'm pasting it below for reference.
[ 2.093905] WARNING: CPU: 1 PID: 1 at kernel/locking/lockdep.c:1227
lockdep_register_key+0x104/0x150
[ 2.094924] Modules linked in:
[ 2.095682] CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted
6.17.0-dirty #11 PREEMPT(voluntary)
[ 2.096241] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS 1.15.0-1 04/01/2014
[ 2.096896] RIP: 0010:lockdep_register_key+0x104/0x150
[ 2.097301] Code: 8b 04 ed 20 91 dd 90 4c 89 6b 08 48 89 03 48 89
1c ed 20 91 dd 90 48 85 c0 74 04 48 89 58 08 49
[ 2.098909] RSP: 0018:ffff888001217e60 EFLAGS: 00000202
[ 2.099260] RAX: 0000000000000001 RBX: ffffffff8f025260 RCX: 0000000000000000
[ 2.099566] RDX: 1ffffffff1e04a45 RSI: 0000000000000001 RDI: ffffffff8f025260
[ 2.099898] RBP: ffffffff8f025140 R08: 0000000000000004 R09: 0000000000000000
[ 2.100228] R10: ffffffff8f025213 R11: 0000000000000000 R12: ffffffff8f025260
[ 2.100556] R13: ffff888001209580 R14: 0000000000000000 R15: 0000000000000000
[ 2.101923] FS: 0000000000000000(0000) GS:ffff8880dc98d000(0000)
knlGS:0000000000000000
[ 2.102298] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2.102560] CR2: 0000000000000000 CR3: 000000004de8c000 CR4: 00000000000006f0
[ 2.102628] Call Trace:
[ 2.102628] <TASK>
[ 2.102991] device_initialize+0xc3/0x500
[ 2.103307] device_register+0xd/0x20
[ 2.103525] faux_bus_init+0x12/0x80
[ 2.103730] driver_init+0x2e/0x50
[ 2.104066] kernel_init_freeable+0x33e/0x6e0
[ 2.104335] ? __pfx_kernel_init+0x10/0x10
[ 2.104566] kernel_init+0x1a/0x1e0
[ 2.104765] ? _raw_spin_unlock_irq+0x23/0x40
[ 2.105118] ret_from_fork+0x255/0x330
[ 2.105350] ? __pfx_kernel_init+0x10/0x10
[ 2.105567] ret_from_fork_asm+0x1a/0x30
[ 2.106001] </TASK>
[ 2.106218] irq event stamp: 3545
[ 2.106405] hardirqs last enabled at (3553): [<ffffffff8ace8436>]
__up_console_sem+0x66/0x70
[ 2.106892] hardirqs last disabled at (3562): [<ffffffff8ace841b>]
__up_console_sem+0x4b/0x70
[ 2.107276] softirqs last enabled at (3244): [<ffffffff8ab7de83>]
handle_softirqs+0x4f3/0x750
[ 2.107644] softirqs last disabled at (3239): [<ffffffff8ab7e214>]
__irq_exit_rcu+0xc4/0x100
[ 2.108924] ---[ end trace 0000000000000000 ]---
Thanks.
Powered by blists - more mailing lists