[syzbot] [net?] INFO: task hung in lock_sock_nested (5)

7 views
Skip to first unread message

syzbot

unread,
Dec 26, 2024, 4:34:21 AM12/26/24
to bor...@nvidia.com, da...@davemloft.net, edum...@google.com, ho...@kernel.org, john.fa...@gmail.com, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, s...@queasysnail.net, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9268abe611b0 Merge branch 'net-lan969x-add-rgmii-support'
git tree: net-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1760eadf980000
kernel config: https://syzkaller.appspot.com/x/.config?x=b087c24b921cdc16
dashboard link: https://syzkaller.appspot.com/bug?extid=6ac73b3abf1b598863fa
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=122f74c4580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=155c0018580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8274f60b0163/disk-9268abe6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f7b3fde537e7/vmlinux-9268abe6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/db4cccf7caae/bzImage-9268abe6.xz

The issue was bisected to:

commit 47069594e67e882ec5c1d8d374f6aab037511509
Author: Sabrina Dubroca <s...@queasysnail.net>
Date: Thu Dec 12 15:36:05 2024 +0000

tls: implement rekey for TLS1.3

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=13da8018580000
final oops: https://syzkaller.appspot.com/x/report.txt?x=103a8018580000
console output: https://syzkaller.appspot.com/x/log.txt?x=17da8018580000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+6ac73b...@syzkaller.appspotmail.com
Fixes: 47069594e67e ("tls: implement rekey for TLS1.3")

INFO: task syz-executor309:5851 blocked for more than 143 seconds.
Not tainted 6.13.0-rc3-syzkaller-00762-g9268abe611b0 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor309 state:D stack:28496 pid:5851 tgid:5846 ppid:5845 flags:0x00004006
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5369 [inline]
__schedule+0x1850/0x4c30 kernel/sched/core.c:6756
__schedule_loop kernel/sched/core.c:6833 [inline]
schedule+0x14b/0x320 kernel/sched/core.c:6848
__lock_sock+0x1cd/0x330 net/core/sock.c:3079
lock_sock_nested+0x9e/0x100 net/core/sock.c:3647
lock_sock include/net/sock.h:1618 [inline]
sockopt_lock_sock net/core/sock.c:1133 [inline]
sk_setsockopt+0xebc/0x3290 net/core/sock.c:1290
do_sock_setsockopt+0x2fb/0x720 net/socket.c:2320
__sys_setsockopt net/socket.c:2349 [inline]
__do_sys_setsockopt net/socket.c:2355 [inline]
__se_sys_setsockopt net/socket.c:2352 [inline]
__x64_sys_setsockopt+0x1ee/0x280 net/socket.c:2352
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:0x7f75d98ee4a9
RSP: 002b:00007f75d9888218 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007f75d9978318 RCX: 00007f75d98ee4a9
RDX: 0000000000000007 RSI: 0000000000000001 RDI: 0000000000000003
RBP: 00007f75d9978310 R08: 0000000000000004 R09: 0000000000000000
R10: 0000000020000040 R11: 0000000000000246 R12: 00007f75d997831c
R13: 00007f75d9945074 R14: 506710fe2170a2df R15: bad24a4ac38a3241
</TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/30:
#0: ffffffff8e937ae0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#0: ffffffff8e937ae0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#0: ffffffff8e937ae0 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x55/0x2a0 kernel/locking/lockdep.c:6744
2 locks held by getty/5592:
#0: ffff888031a650a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
#1: ffffc900032fb2f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x6a6/0x1e00 drivers/tty/n_tty.c:2211
1 lock held by syz-executor309/5847:
1 lock held by syz-executor309/5851:
#0: ffff888025a18fd8 (sk_lock-AF_INET6){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1618 [inline]
#0: ffff888025a18fd8 (sk_lock-AF_INET6){+.+.}-{0:0}, at: sockopt_lock_sock net/core/sock.c:1133 [inline]
#0: ffff888025a18fd8 (sk_lock-AF_INET6){+.+.}-{0:0}, at: sk_setsockopt+0xebc/0x3290 net/core/sock.c:1290

=============================================

NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 30 Comm: khungtaskd Not tainted 6.13.0-rc3-syzkaller-00762-g9268abe611b0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
nmi_cpu_backtrace+0x49c/0x4d0 lib/nmi_backtrace.c:113
nmi_trigger_cpumask_backtrace+0x198/0x320 lib/nmi_backtrace.c:62
trigger_all_cpu_backtrace include/linux/nmi.h:162 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:234 [inline]
watchdog+0xff6/0x1040 kernel/hung_task.c:397
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>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 5847 Comm: syz-executor309 Not tainted 6.13.0-rc3-syzkaller-00762-g9268abe611b0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:check_kcov_mode kernel/kcov.c:185 [inline]
RIP: 0010:write_comp_data kernel/kcov.c:246 [inline]
RIP: 0010:__sanitizer_cov_trace_const_cmp1+0x2f/0x90 kernel/kcov.c:300
Code: 8b 04 24 65 48 8b 14 25 00 d6 03 00 65 8b 05 00 5f 64 7e 25 00 01 ff 00 74 10 3d 00 01 00 00 75 5b 83 ba 1c 16 00 00 00 74 52 <8b> 82 f8 15 00 00 83 f8 03 75 47 48 8b 8a 00 16 00 00 44 8b 8a fc
RSP: 0018:ffffc9000404fb50 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88807eeb3c00
RDX: ffff88807eeb3c00 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc9000404fd70 R08: ffffffff8a5765c4 R09: ffffffff898aa128
R10: 000000000000002e R11: ffffffff8a576560 R12: dffffc0000000000
R13: ffff888025a18d80 R14: ffff888025a18d80 R15: ffff888027ebac00
FS: 00007f75d98a96c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055831e406600 CR3: 0000000031a76000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<NMI>
</NMI>
<TASK>
tls_write_space+0x64/0x120 net/tls/tls_main.c:305
sk_setsockopt+0x2142/0x3290 net/core/sock.c:1328
do_sock_setsockopt+0x2fb/0x720 net/socket.c:2320
__sys_setsockopt net/socket.c:2349 [inline]
__do_sys_setsockopt net/socket.c:2355 [inline]
__se_sys_setsockopt net/socket.c:2352 [inline]
__x64_sys_setsockopt+0x1ee/0x280 net/socket.c:2352
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:0x7f75d98ee4a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 18 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f75d98a9218 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007f75d9978308 RCX: 00007f75d98ee4a9
RDX: 0000000000000007 RSI: 0000000000000001 RDI: 0000000000000003
RBP: 00007f75d9978300 R08: 0000000000000004 R09: 0000000000000000
R10: 0000000020000040 R11: 0000000000000246 R12: 00007f75d997830c
R13: 00007f75d9945074 R14: 506710fe2170a2df R15: bad24a4ac38a3241
</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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection

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

Sabrina Dubroca

unread,
Jan 7, 2025, 6:15:47 AM1/7/25
to syzbot, bor...@nvidia.com, da...@davemloft.net, edum...@google.com, ho...@kernel.org, john.fa...@gmail.com, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, syzkall...@googlegroups.com
I'm getting a different (and IMO much more helpful in pointing out the
issue) trace when I run the repro:

BUG: TASK stack guard page was hit at ffffc9000294fff8 (stack is ffffc90002950000..ffffc90002958000)
[...]
Call Trace:
<#DF>
? die+0x32/0x80
? handle_stack_overflow+0xa5/0xe0
? get_stack_info_noinstr+0x14/0x120
? exc_double_fault+0x140/0x180
? asm_exc_double_fault+0x1f/0x60
? mark_lock+0xfc/0x2370
? tls_sw_write_space+0x10/0x150
</#DF>
<TASK>
tls_write_space+0xd4/0x170
tls_write_space+0xfd/0x170
tls_write_space+0xfd/0x170

... a few hundred more of those lines

tls_write_space+0xfd/0x170
tls_write_space+0xfd/0x170
tls_write_space+0xfd/0x170
sk_setsockopt+0x1b7a/0x48b0
? tracer_preempt_on+0xd7/0x490
? __pfx_sk_setsockopt+0x10/0x10
? find_held_lock+0x2d/0x110
? lock_release+0x44e/0x6f0
do_sock_setsockopt+0x31e/0x3f0
? __pfx_do_sock_setsockopt+0x10/0x10
? __fget_files+0x1d9/0x370
__sys_setsockopt+0x103/0x170
__x64_sys_setsockopt+0xbe/0x160
? do_syscall_64+0x2a/0x140
? lockdep_hardirqs_on+0x74/0x100
do_syscall_64+0x64/0x140
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7f0f2fc4b1fd
[...]


I don't know why syzbot is only getting a hung task.


Anyway, good find by syzbot, I missed that when I wrote the rekey
code:

diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index 9ee5a83c5b40..99ca4465f702 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -737,6 +737,10 @@ static int do_tls_setsockopt_conf(struct sock *sk, sockptr_t optval,
else
ctx->rx_conf = conf;
update_sk_prot(sk, ctx);
+
+ if (update)
+ return 0;
+
if (tx) {
ctx->sk_write_space = sk->sk_write_space;
sk->sk_write_space = tls_write_space;

--
Sabrina

Hillf Danton

unread,
Jan 8, 2025, 6:05:15 AM1/8/25
to syzbot, Sabrina Dubroca, bor...@nvidia.com, edum...@google.com, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, syzkall...@googlegroups.com
On 2024-12-26, 01:34:19 -0800, syzbot wrote:
> syzbot found the following issue on:
>
> HEAD commit: 9268abe611b0 Merge branch 'net-lan969x-add-rgmii-support'
> git tree: net-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=155c0018580000

Test Sabrina's patch.

#syz test

--- x/net/tls/tls_main.c
+++ y/net/tls/tls_main.c
@@ -737,6 +737,8 @@ static int do_tls_setsockopt_conf(struct
else
ctx->rx_conf = conf;
update_sk_prot(sk, ctx);
+ if (update)
+ return 0;

syzbot

unread,
Jan 8, 2025, 7:10:03 AM1/8/25
to bor...@nvidia.com, edum...@google.com, hda...@sina.com, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, s...@queasysnail.net, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+6ac73b...@syzkaller.appspotmail.com
Tested-by: syzbot+6ac73b...@syzkaller.appspotmail.com

Tested on:

commit: 7bf1659b Merge branch 'intel-wired-lan-driver-updates-..
git tree: net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=125b8dc4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=289acde585746aad
dashboard link: https://syzkaller.appspot.com/bug?extid=6ac73b3abf1b598863fa
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=11b38ef8580000

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages