public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [net?] [s390?] possible deadlock in smc_release
@ 2024-02-02 13:26 syzbot
  2024-07-09  3:46 ` Jeongjun Park
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: syzbot @ 2024-02-02 13:26 UTC (permalink / raw)
  To: agordeev, alibuda, davem, edumazet, guwen, jaka, kuba,
	linux-kernel, linux-s390, netdev, pabeni, syzkaller-bugs, tonylu,
	wenjia

Hello,

syzbot found the following issue on:

HEAD commit:    41bccc98fb79 Linux 6.8-rc2
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=16b3a953e80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=b168fa511db3ca08
dashboard link: https://syzkaller.appspot.com/bug?extid=621fd56ba002faba6392
compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=165642dfe80000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1431092fe80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/00fc8ba1cd49/disk-41bccc98.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/15fd4e4ee5f8/vmlinux-41bccc98.xz
kernel image: https://storage.googleapis.com/syzbot-assets/13be3add2183/bzImage-41bccc98.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+621fd56ba002faba6392@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
6.8.0-rc2-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor225/5062 is trying to acquire lock:
ffff8880218893f8 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: __flush_work+0xfa/0xa10 kernel/workqueue.c:3406

but task is already holding lock:
ffff888021888130 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x3a3/0x640 net/smc/af_smc.c:336

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (sk_lock-AF_SMC/1){+.+.}-{0:0}:
       lock_sock_nested+0x3a/0xf0 net/core/sock.c:3524
       smc_listen_out+0x1e7/0x4b0 net/smc/af_smc.c:1914
       smc_listen_out_connected net/smc/af_smc.c:1934 [inline]
       smc_listen_work+0x56e/0x5190 net/smc/af_smc.c:2448
       process_one_work+0x886/0x15d0 kernel/workqueue.c:2633
       process_scheduled_works kernel/workqueue.c:2706 [inline]
       worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
       kthread+0x2c6/0x3a0 kernel/kthread.c:388
       ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
       ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242

-> #0 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3869 [inline]
       __lock_acquire+0x2445/0x3b30 kernel/locking/lockdep.c:5137
       lock_acquire kernel/locking/lockdep.c:5754 [inline]
       lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
       __flush_work+0x103/0xa10 kernel/workqueue.c:3406
       __cancel_work_timer+0x3ef/0x590 kernel/workqueue.c:3497
       smc_clcsock_release+0x5f/0xe0 net/smc/smc_close.c:29
       __smc_release+0x5b9/0x890 net/smc/af_smc.c:301
       smc_close_non_accepted+0xda/0x230 net/smc/af_smc.c:1846
       smc_close_cleanup_listen net/smc/smc_close.c:45 [inline]
       smc_close_active+0xc2d/0x1070 net/smc/smc_close.c:225
       __smc_release+0x62b/0x890 net/smc/af_smc.c:277
       smc_release+0x209/0x640 net/smc/af_smc.c:344
       __sock_release+0xae/0x260 net/socket.c:659
       sock_close+0x1c/0x20 net/socket.c:1421
       __fput+0x270/0xb70 fs/file_table.c:376
       task_work_run+0x14d/0x240 kernel/task_work.c:180
       exit_task_work include/linux/task_work.h:38 [inline]
       do_exit+0xa8a/0x2ad0 kernel/exit.c:871
       do_group_exit+0xd4/0x2a0 kernel/exit.c:1020
       __do_sys_exit_group kernel/exit.c:1031 [inline]
       __se_sys_exit_group kernel/exit.c:1029 [inline]
       __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1029
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xd3/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x63/0x6b

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sk_lock-AF_SMC/1);
                               lock((work_completion)(&new_smc->smc_listen_work));
                               lock(sk_lock-AF_SMC/1);
  lock((work_completion)(&new_smc->smc_listen_work));

 *** DEADLOCK ***

2 locks held by syz-executor225/5062:
 #0: ffff8880791f6210 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline]
 #0: ffff8880791f6210 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: __sock_release+0x86/0x260 net/socket.c:658
 #1: ffff888021888130 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x3a3/0x640 net/smc/af_smc.c:336

stack backtrace:
CPU: 1 PID: 5062 Comm: syz-executor225 Not tainted 6.8.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
 check_noncircular+0x317/0x400 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3869 [inline]
 __lock_acquire+0x2445/0x3b30 kernel/locking/lockdep.c:5137
 lock_acquire kernel/locking/lockdep.c:5754 [inline]
 lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
 __flush_work+0x103/0xa10 kernel/workqueue.c:3406
 __cancel_work_timer+0x3ef/0x590 kernel/workqueue.c:3497
 smc_clcsock_release+0x5f/0xe0 net/smc/smc_close.c:29
 __smc_release+0x5b9/0x890 net/smc/af_smc.c:301
 smc_close_non_accepted+0xda/0x230 net/smc/af_smc.c:1846
 smc_close_cleanup_listen net/smc/smc_close.c:45 [inline]
 smc_close_active+0xc2d/0x1070 net/smc/smc_close.c:225
 __smc_release+0x62b/0x890 net/smc/af_smc.c:277
 smc_release+0x209/0x640 net/smc/af_smc.c:344
 __sock_release+0xae/0x260 net/socket.c:659
 sock_close+0x1c/0x20 net/socket.c:1421
 __fput+0x270/0xb70 fs/file_table.c:376
 task_work_run+0x14d/0x240 kernel/task_work.c:180
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0xa8a/0x2ad0 kernel/exit.c:871
 do_group_exit+0xd4/0x2a0 kernel/exit.c:1020
 __do_sys_exit_group kernel/exit.c:1031 [inline]
 __se_sys_exit_group kernel/exit.c:1029 [inline]
 __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1029
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xd3/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f8804a8bc09
Code: Unable to access opcode bytes at 0x7f8804a8bbdf.
RSP: 002b:00007ffcbc267b78 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f8804a8bc09
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 00007f8804b062d0 R08: ffffffffffffffb8 R09: 0000000000000006
R10: 0000000000000006 R11: 0000000000000246 R12: 00007f8804b062d0
R13: 0000000000000000 R14: 00007f8804b06d20 R15: 00007f8804a5ce60
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [syzbot] [net?] [s390?] possible deadlock in smc_release
  2024-02-02 13:26 [syzbot] [net?] [s390?] possible deadlock in smc_release syzbot
@ 2024-07-09  3:46 ` Jeongjun Park
  2024-07-09  4:51   ` syzbot
  2024-07-10  3:16 ` Jeongjun Park
  2024-09-07 16:57 ` syzbot
  2 siblings, 1 reply; 6+ messages in thread
From: Jeongjun Park @ 2024-07-09  3:46 UTC (permalink / raw)
  To: syzbot+621fd56ba002faba6392; +Cc: linux-kernel

#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [syzbot] [net?] [s390?] possible deadlock in smc_release
  2024-07-09  3:46 ` Jeongjun Park
@ 2024-07-09  4:51   ` syzbot
  0 siblings, 0 replies; 6+ messages in thread
From: syzbot @ 2024-07-09  4:51 UTC (permalink / raw)
  To: aha310510, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
possible deadlock in smc_release

======================================================
WARNING: possible circular locking dependency detected
6.10.0-rc7-syzkaller-g4376e966ecb7 #0 Not tainted
------------------------------------------------------
syz-executor386/31174 is trying to acquire lock:
ffff8880723c08f8 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
ffff8880723c08f8 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
ffff8880723c08f8 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: start_flush_work kernel/workqueue.c:4138 [inline]
ffff8880723c08f8 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: __flush_work+0xe6/0xd00 kernel/workqueue.c:4197

but task is already holding lock:
ffff8880723c7058 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x231/0x530

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (sk_lock-AF_SMC/1){+.+.}-{0:0}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       lock_sock_nested+0x48/0x100 net/core/sock.c:3534
       smc_listen_out+0x113/0x3d0 net/smc/af_smc.c:1904
       process_one_work kernel/workqueue.c:3248 [inline]
       process_scheduled_works+0xab6/0x18e0 kernel/workqueue.c:3329
       worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
       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 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869
       __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       touch_work_lockdep_map kernel/workqueue.c:3910 [inline]
       start_flush_work kernel/workqueue.c:4164 [inline]
       __flush_work+0x73c/0xd00 kernel/workqueue.c:4197
       __cancel_work_sync+0xbc/0x110 kernel/workqueue.c:4347
       smc_clcsock_release+0x62/0xf0 net/smc/smc_close.c:29
       __smc_release+0x683/0x800 net/smc/af_smc.c:300
       smc_close_non_accepted+0xd8/0x1f0 net/smc/af_smc.c:1836
       smc_close_cleanup_listen net/smc/smc_close.c:45 [inline]
       smc_close_active+0xad8/0xe90 net/smc/smc_close.c:225
       __smc_release+0xa0/0x800 net/smc/af_smc.c:276
       smc_release+0x2d9/0x530 net/smc/af_smc.c:343
       __sock_release net/socket.c:659 [inline]
       sock_close+0xbc/0x240 net/socket.c:1421
       __fput+0x24a/0x8a0 fs/file_table.c:422
       task_work_run+0x24f/0x310 kernel/task_work.c:180
       exit_task_work include/linux/task_work.h:38 [inline]
       do_exit+0xa27/0x27e0 kernel/exit.c:876
       do_group_exit+0x207/0x2c0 kernel/exit.c:1025
       __do_sys_exit_group kernel/exit.c:1036 [inline]
       __se_sys_exit_group kernel/exit.c:1034 [inline]
       __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1034
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sk_lock-AF_SMC/1);
                               lock((work_completion)(&new_smc->smc_listen_work));
                               lock(sk_lock-AF_SMC/1);
  lock((work_completion)(&new_smc->smc_listen_work));

 *** DEADLOCK ***

3 locks held by syz-executor386/31174:
 #0: ffff888069ffca10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:791 [inline]
 #0: ffff888069ffca10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: __sock_release net/socket.c:658 [inline]
 #0: ffff888069ffca10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: sock_close+0x90/0x240 net/socket.c:1421
 #1: ffff8880723c7058 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x231/0x530
 #2: ffffffff8e334820 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #2: ffffffff8e334820 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #2: ffffffff8e334820 (rcu_read_lock){....}-{1:2}, at: start_flush_work kernel/workqueue.c:4138 [inline]
 #2: ffffffff8e334820 (rcu_read_lock){....}-{1:2}, at: __flush_work+0xe6/0xd00 kernel/workqueue.c:4197

stack backtrace:
CPU: 0 PID: 31174 Comm: syz-executor386 Not tainted 6.10.0-rc7-syzkaller-g4376e966ecb7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869
 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
 touch_work_lockdep_map kernel/workqueue.c:3910 [inline]
 start_flush_work kernel/workqueue.c:4164 [inline]
 __flush_work+0x73c/0xd00 kernel/workqueue.c:4197
 __cancel_work_sync+0xbc/0x110 kernel/workqueue.c:4347
 smc_clcsock_release+0x62/0xf0 net/smc/smc_close.c:29
 __smc_release+0x683/0x800 net/smc/af_smc.c:300
 smc_close_non_accepted+0xd8/0x1f0 net/smc/af_smc.c:1836
 smc_close_cleanup_listen net/smc/smc_close.c:45 [inline]
 smc_close_active+0xad8/0xe90 net/smc/smc_close.c:225
 __smc_release+0xa0/0x800 net/smc/af_smc.c:276
 smc_release+0x2d9/0x530 net/smc/af_smc.c:343
 __sock_release net/socket.c:659 [inline]
 sock_close+0xbc/0x240 net/socket.c:1421
 __fput+0x24a/0x8a0 fs/file_table.c:422
 task_work_run+0x24f/0x310 kernel/task_work.c:180
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0xa27/0x27e0 kernel/exit.c:876
 do_group_exit+0x207/0x2c0 kernel/exit.c:1025
 __do_sys_exit_group kernel/exit.c:1036 [inline]
 __se_sys_exit_group kernel/exit.c:1034 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1034
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f0f905fac09
Code: Unable to access opcode bytes at 0x7f0f905fabdf.
RSP: 002b:00007ffcd9863848 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0f905fac09
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 00007f0f906752d0 R08: ffffffffffffffb8 R09: 0000000000000006
R10: 0000000000000006 R11: 0000000000000246 R12: 00007f0f906752d0
R13: 0000000000000000 R14: 00007f0f90675d20 R15: 00007f0f905cbe60
 </TASK>


Tested on:

commit:         4376e966 Merge tag 'perf-tools-fixes-for-v6.10-2024-07..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13dcf47e980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=451e6d4de6561673
dashboard link: https://syzkaller.appspot.com/bug?extid=621fd56ba002faba6392
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [syzbot] [net?] [s390?] possible deadlock in smc_release
  2024-02-02 13:26 [syzbot] [net?] [s390?] possible deadlock in smc_release syzbot
  2024-07-09  3:46 ` Jeongjun Park
@ 2024-07-10  3:16 ` Jeongjun Park
  2024-07-10 12:03   ` syzbot
  2024-09-07 16:57 ` syzbot
  2 siblings, 1 reply; 6+ messages in thread
From: Jeongjun Park @ 2024-07-10  3:16 UTC (permalink / raw)
  To: syzbot+621fd56ba002faba6392; +Cc: linux-kernel

#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

---
 net/smc/af_smc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index c5f98c6b2561..e7ec066b0d6a 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -294,6 +294,8 @@ static int __smc_release(struct smc_sock *smc)
 
 	sk->sk_prot->unhash(sk);
 
+	barrier();
+
 	if (sk->sk_state == SMC_CLOSED) {
 		if (smc->clcsock) {
 			release_sock(sk);
--

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [syzbot] [net?] [s390?] possible deadlock in smc_release
  2024-07-10  3:16 ` Jeongjun Park
@ 2024-07-10 12:03   ` syzbot
  0 siblings, 0 replies; 6+ messages in thread
From: syzbot @ 2024-07-10 12:03 UTC (permalink / raw)
  To: aha310510, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
possible deadlock in smc_release

======================================================
WARNING: possible circular locking dependency detected
6.10.0-rc7-syzkaller-g34afb82a3c67-dirty #0 Not tainted
------------------------------------------------------
syz-executor.0/20276 is trying to acquire lock:
ffff88802ba176f8 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
ffff88802ba176f8 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
ffff88802ba176f8 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: start_flush_work kernel/workqueue.c:4138 [inline]
ffff88802ba176f8 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}, at: __flush_work+0xe6/0xd00 kernel/workqueue.c:4197

but task is already holding lock:
ffff88807c4a0258 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x231/0x530

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (sk_lock-AF_SMC/1){+.+.}-{0:0}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       lock_sock_nested+0x48/0x100 net/core/sock.c:3534
       smc_listen_out+0x113/0x3d0 net/smc/af_smc.c:1906
       process_one_work kernel/workqueue.c:3248 [inline]
       process_scheduled_works+0xab6/0x18e0 kernel/workqueue.c:3329
       worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
       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 ((work_completion)(&new_smc->smc_listen_work)){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869
       __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       touch_work_lockdep_map kernel/workqueue.c:3910 [inline]
       start_flush_work kernel/workqueue.c:4164 [inline]
       __flush_work+0x73c/0xd00 kernel/workqueue.c:4197
       __cancel_work_sync+0xbc/0x110 kernel/workqueue.c:4347
       smc_clcsock_release+0x62/0xf0 net/smc/smc_close.c:29
       __smc_release+0x683/0x800 net/smc/af_smc.c:302
       smc_close_non_accepted+0xd8/0x1f0 net/smc/af_smc.c:1838
       smc_close_cleanup_listen net/smc/smc_close.c:45 [inline]
       smc_close_active+0xad8/0xe90 net/smc/smc_close.c:225
       __smc_release+0xa0/0x800 net/smc/af_smc.c:276
       smc_release+0x2d9/0x530 net/smc/af_smc.c:345
       __sock_release net/socket.c:659 [inline]
       sock_close+0xbc/0x240 net/socket.c:1421
       __fput+0x24a/0x8a0 fs/file_table.c:422
       __do_sys_close fs/open.c:1563 [inline]
       __se_sys_close fs/open.c:1548 [inline]
       __x64_sys_close+0x7f/0x110 fs/open.c:1548
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sk_lock-AF_SMC/1);
                               lock((work_completion)(&new_smc->smc_listen_work));
                               lock(sk_lock-AF_SMC/1);
  lock((work_completion)(&new_smc->smc_listen_work));

 *** DEADLOCK ***

3 locks held by syz-executor.0/20276:
 #0: ffff8880699e1a10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:791 [inline]
 #0: ffff8880699e1a10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: __sock_release net/socket.c:658 [inline]
 #0: ffff8880699e1a10 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: sock_close+0x90/0x240 net/socket.c:1421
 #1: ffff88807c4a0258 (sk_lock-AF_SMC/1){+.+.}-{0:0}, at: smc_release+0x231/0x530
 #2: ffffffff8e334820 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #2: ffffffff8e334820 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #2: ffffffff8e334820 (rcu_read_lock){....}-{1:2}, at: start_flush_work kernel/workqueue.c:4138 [inline]
 #2: ffffffff8e334820 (rcu_read_lock){....}-{1:2}, at: __flush_work+0xe6/0xd00 kernel/workqueue.c:4197

stack backtrace:
CPU: 0 PID: 20276 Comm: syz-executor.0 Not tainted 6.10.0-rc7-syzkaller-g34afb82a3c67-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869
 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
 touch_work_lockdep_map kernel/workqueue.c:3910 [inline]
 start_flush_work kernel/workqueue.c:4164 [inline]
 __flush_work+0x73c/0xd00 kernel/workqueue.c:4197
 __cancel_work_sync+0xbc/0x110 kernel/workqueue.c:4347
 smc_clcsock_release+0x62/0xf0 net/smc/smc_close.c:29
 __smc_release+0x683/0x800 net/smc/af_smc.c:302
 smc_close_non_accepted+0xd8/0x1f0 net/smc/af_smc.c:1838
 smc_close_cleanup_listen net/smc/smc_close.c:45 [inline]
 smc_close_active+0xad8/0xe90 net/smc/smc_close.c:225
 __smc_release+0xa0/0x800 net/smc/af_smc.c:276
 smc_release+0x2d9/0x530 net/smc/af_smc.c:345
 __sock_release net/socket.c:659 [inline]
 sock_close+0xbc/0x240 net/socket.c:1421
 __fput+0x24a/0x8a0 fs/file_table.c:422
 __do_sys_close fs/open.c:1563 [inline]
 __se_sys_close fs/open.c:1548 [inline]
 __x64_sys_close+0x7f/0x110 fs/open.c:1548
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f952867bc9a
Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24
RSP: 002b:00007fff0f13dee0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00007f952867bc9a
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0000000000000032 R08: 0000001b2cb60000 R09: 00007f95287abf8c
R10: 00007fff0f13e030 R11: 0000000000000293 R12: 00007f95282003f8
R13: ffffffffffffffff R14: 00007f9528200000 R15: 000000000003a6d4
 </TASK>


Tested on:

commit:         34afb82a Merge tag '6.10-rc6-smb3-server-fixes' of git..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=115531e1980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=451e6d4de6561673
dashboard link: https://syzkaller.appspot.com/bug?extid=621fd56ba002faba6392
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=13d53371980000


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [syzbot] [net?] [s390?] possible deadlock in smc_release
  2024-02-02 13:26 [syzbot] [net?] [s390?] possible deadlock in smc_release syzbot
  2024-07-09  3:46 ` Jeongjun Park
  2024-07-10  3:16 ` Jeongjun Park
@ 2024-09-07 16:57 ` syzbot
  2 siblings, 0 replies; 6+ messages in thread
From: syzbot @ 2024-09-07 16:57 UTC (permalink / raw)
  To: agordeev, aha310510, alibuda, davem, edumazet, guwen, jaka,
	johannes.berg, johannes, kuba, linux-kernel, linux-s390,
	linux-wireless, netdev, nico.escande, pabeni, syzkaller-bugs,
	tonylu, wenjia

syzbot suspects this issue was fixed by commit:

commit b7d7f11a291830fdf69d3301075dd0fb347ced84
Author: Nicolas Escande <nico.escande@gmail.com>
Date:   Tue May 28 14:26:05 2024 +0000

    wifi: mac80211: mesh: Fix leak of mesh_preq_queue objects

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1536189f980000
start commit:   5f76499fb541 tsnep: Add link down PHY loopback support
git tree:       net-next
kernel config:  https://syzkaller.appspot.com/x/.config?x=bc36d99546fe9035
dashboard link: https://syzkaller.appspot.com/bug?extid=621fd56ba002faba6392
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17ad7bc3e80000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1461e9a7e80000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: wifi: mac80211: mesh: Fix leak of mesh_preq_queue objects

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-07 16:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02 13:26 [syzbot] [net?] [s390?] possible deadlock in smc_release syzbot
2024-07-09  3:46 ` Jeongjun Park
2024-07-09  4:51   ` syzbot
2024-07-10  3:16 ` Jeongjun Park
2024-07-10 12:03   ` syzbot
2024-09-07 16:57 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox