public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+5fe14f2ff4ccbace9a26@syzkaller.appspotmail.com>
To: cmeiohas@nvidia.com, linux-kernel@vger.kernel.org,
	 syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] KASAN: slab-use-after-free Read in __ethtool_get_link_ksettings
Date: Mon, 21 Oct 2024 06:32:05 -0700	[thread overview]
Message-ID: <671657d5.050a0220.1e4b4d.005b.GAE@google.com> (raw)
In-Reply-To: <a9414b93-0179-4d20-b619-3ef736f223f0@nvidia.com>

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
BUG: workqueue leaked atomic, lock or RCU: kworker/NUM:NUM[NUM]

BUG: workqueue leaked atomic, lock or RCU: kworker/1:1[46]
     preempt=0x00000000 lock=0->1 RCU=0->0 workfn=smc_ib_port_event_work
1 lock held by kworker/1:1/46:
 #0: ffffffff8fcd1d48 (rtnl_mutex){+.+.}-{3:3}, at: ib_get_eth_speed+0x153/0x8e0 drivers/infiniband/core/verbs.c:1995
CPU: 1 UID: 0 PID: 46 Comm: kworker/1:1 Not tainted 6.12.0-rc2-syzkaller-00003-g89e9ae55dc56-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events smc_ib_port_event_work
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 process_one_work kernel/workqueue.c:3250 [inline]
 process_scheduled_works+0x1158/0x1850 kernel/workqueue.c:3310
 worker_thread+0x870/0xd30 kernel/workqueue.c:3391
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

======================================================
WARNING: possible circular locking dependency detected
6.12.0-rc2-syzkaller-00003-g89e9ae55dc56-dirty #0 Not tainted
------------------------------------------------------
kworker/1:1/46 is trying to acquire lock:
ffff88801ac80948 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3204 [inline]
ffff88801ac80948 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x93b/0x1850 kernel/workqueue.c:3310

but task is already holding lock:
ffffffff8fcd1d48 (rtnl_mutex){+.+.}-{3:3}, at: ib_get_eth_speed+0x153/0x8e0 drivers/infiniband/core/verbs.c:1995

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (rtnl_mutex){+.+.}-{3:3}:
       reacquire_held_locks+0x3eb/0x690 kernel/locking/lockdep.c:5350
       __lock_release kernel/locking/lockdep.c:5539 [inline]
       lock_release+0x396/0xa30 kernel/locking/lockdep.c:5846
       process_one_work kernel/workqueue.c:3236 [inline]
       process_scheduled_works+0xb70/0x1850 kernel/workqueue.c:3310
       worker_thread+0x870/0xd30 kernel/workqueue.c:3391
       kthread+0x2f0/0x390 kernel/kthread.c:389
       ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

-> #0 ((wq_completion)events){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3161 [inline]
       check_prevs_add kernel/locking/lockdep.c:3280 [inline]
       validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
       __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
       process_one_work kernel/workqueue.c:3204 [inline]
       process_scheduled_works+0x950/0x1850 kernel/workqueue.c:3310
       worker_thread+0x870/0xd30 kernel/workqueue.c:3391
       kthread+0x2f0/0x390 kernel/kthread.c:389
       ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(rtnl_mutex);
                               lock((wq_completion)events);
                               lock(rtnl_mutex);
  lock((wq_completion)events);

 *** DEADLOCK ***

1 lock held by kworker/1:1/46:
 #0: ffffffff8fcd1d48 (rtnl_mutex){+.+.}-{3:3}, at: ib_get_eth_speed+0x153/0x8e0 drivers/infiniband/core/verbs.c:1995

stack backtrace:
CPU: 1 UID: 0 PID: 46 Comm: kworker/1:1 Not tainted 6.12.0-rc2-syzkaller-00003-g89e9ae55dc56-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events wq_barrier_func
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074
 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206
 check_prev_add kernel/locking/lockdep.c:3161 [inline]
 check_prevs_add kernel/locking/lockdep.c:3280 [inline]
 validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
 process_one_work kernel/workqueue.c:3204 [inline]
 process_scheduled_works+0x950/0x1850 kernel/workqueue.c:3310
 worker_thread+0x870/0xd30 kernel/workqueue.c:3391
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
BUG: workqueue leaked atomic, lock or RCU: kworker/1:1[46]
     preempt=0x00000000 lock=1->0 RCU=0->0 workfn=wq_barrier_func
INFO: lockdep is turned off.
CPU: 1 UID: 0 PID: 46 Comm: kworker/1:1 Not tainted 6.12.0-rc2-syzkaller-00003-g89e9ae55dc56-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Workqueue: events wq_barrier_func
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 process_one_work kernel/workqueue.c:3250 [inline]
 process_scheduled_works+0x1158/0x1850 kernel/workqueue.c:3310
 worker_thread+0x870/0xd30 kernel/workqueue.c:3391
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>


Tested on:

commit:         89e9ae55 IB/hfi1: make clear_all_interrupts static
git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
console output: https://syzkaller.appspot.com/x/log.txt?x=138fe430580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=7cd9e7e4a8a0a15b
dashboard link: https://syzkaller.appspot.com/bug?extid=5fe14f2ff4ccbace9a26
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=115f1c87980000


       reply	other threads:[~2024-10-21 13:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a9414b93-0179-4d20-b619-3ef736f223f0@nvidia.com>
2024-10-21 13:32 ` syzbot [this message]
     [not found] <27386470-ef9f-49dc-a3d6-6c7f428737ad@nvidia.com>
2024-10-20  8:54 ` [syzbot] [net?] KASAN: slab-use-after-free Read in __ethtool_get_link_ksettings syzbot
     [not found] <605a7a92-5e06-42b6-a44c-6529cfa86d47@nvidia.com>
2024-10-20  8:33 ` syzbot
     [not found] <2deb0631-ce6c-4b18-8c34-9401198c9d39@nvidia.com>
2024-10-19 18:55 ` syzbot
     [not found] <db9cbaed-a5a6-419b-8a46-0a9ce4ed4a5f@nvidia.com>
2024-10-16 20:57 ` syzbot
     [not found] <53cfa80b-e1f9-4784-b725-e4e7b5c0cb4c@nvidia.com>
2024-10-16 20:02 ` syzbot
     [not found] <d21ac7f8-ab23-4b37-80f6-43836bbdbf12@nvidia.com>
2024-10-13 16:08 ` syzbot
     [not found] <170d194b-686e-482d-a2f0-151a12887545@nvidia.com>
2024-10-13 12:05 ` syzbot
     [not found] <68d66e2d-78f8-4a7c-890e-ca81af38984a@nvidia.com>
2024-10-13 11:29 ` syzbot
     [not found] <181d9e88-ae98-4b4c-bd99-1e0e99da8588@nvidia.com>
2024-10-10 14:26 ` syzbot
     [not found] <397b6a20-036f-404b-bdd1-82cc07d05296@nvidia.com>
2024-10-10 14:02 ` syzbot
     [not found] <45071abc-d5fd-4c24-9e36-e8164eca3867@nvidia.com>
2024-10-10 13:30 ` syzbot
     [not found] <53e285ce-2977-467a-ae0e-8d54f6835c09@nvidia.com>
2024-10-10 13:30 ` syzbot
     [not found] <20241008115126.GE25819@unreal>
2024-10-08 12:24 ` syzbot
     [not found] <20241008114406.GD25819@unreal>
2024-10-08 12:02 ` syzbot
2024-03-22 20:10 syzbot
2024-03-25 12:09 ` Denis Kirjanov
2024-03-25 13:08   ` Eric Dumazet
2024-09-28 12:21     ` Hillf Danton
2024-09-29 11:46       ` Hillf Danton
2024-09-30  8:32         ` Eric Dumazet
2024-09-30 12:27           ` Hillf Danton
2024-09-27 18:26 ` syzbot
2024-09-28  8:22 ` Hillf Danton
2024-09-28  9:08   ` syzbot
2024-09-29 10:38 ` Hillf Danton
2024-09-29 11:17   ` syzbot
2024-10-08  1:44 ` syzbot

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=671657d5.050a0220.1e4b4d.005b.GAE@google.com \
    --to=syzbot+5fe14f2ff4ccbace9a26@syzkaller.appspotmail.com \
    --cc=cmeiohas@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /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