[v5.15] possible deadlock in inet_sk_diag_fill

0 views
Skip to first unread message

syzbot

unread,
Dec 1, 2023, 5:19:21 PM12/1/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a78d278e01b1 Linux 5.15.140
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15d29bc2e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=af8ffc64a7d6b78a
dashboard link: https://syzkaller.appspot.com/bug?extid=f932a1d81e02eb4d5bd2
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/725f6f29c66f/disk-a78d278e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/af4bcc4e141e/vmlinux-a78d278e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0d3f0ba6b252/Image-a78d278e.gz.xz

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

======================================================
WARNING: possible circular locking dependency detected
5.15.140-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.2/882 is trying to acquire lock:
ffff0000da9d0120 (sk_lock-AF_INET){+.+.}-{0:0}, at: inet_sk_diag_fill+0xcb8/0x17b4 net/ipv4/inet_diag.c:342

but task is already holding lock:
ffff0000c548c078 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
ffff0000c548c078 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:95 [inline]
ffff0000c548c078 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump+0x7b0/0x10dc net/mptcp/mptcp_diag.c:194

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&h->lhash2[i].lock){+.+.}-{2:2}:
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0xb0/0x10c kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:363 [inline]
__inet_hash+0xd8/0x754 net/ipv4/inet_hashtables.c:606
inet_hash+0x74/0x9c net/ipv4/inet_hashtables.c:631
inet_csk_listen_start+0x1e8/0x2cc net/ipv4/inet_connection_sock.c:1080
inet_listen+0x258/0x6d4 net/ipv4/af_inet.c:231
__sys_listen+0x1ac/0x21c net/socket.c:1747
__do_sys_listen net/socket.c:1756 [inline]
__se_sys_listen net/socket.c:1754 [inline]
__arm64_sys_listen+0x5c/0x74 net/socket.c:1754
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #0 (sk_lock-AF_INET){+.+.}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3787 [inline]
__lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
lock_sock_fast include/net/sock.h:1700 [inline]
mptcp_diag_get_info+0x208/0x8a0 net/mptcp/mptcp_diag.c:224
inet_sk_diag_fill+0xcb8/0x17b4 net/ipv4/inet_diag.c:342
sk_diag_dump net/mptcp/mptcp_diag.c:24 [inline]
mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:122 [inline]
mptcp_diag_dump+0xb4c/0x10dc net/mptcp/mptcp_diag.c:194
__inet_diag_dump+0x1e8/0x33c net/ipv4/inet_diag.c:1179
inet_diag_dump_compat+0x17c/0x288 net/ipv4/inet_diag.c:1287
netlink_dump+0x470/0xa88 net/netlink/af_netlink.c:2279
__netlink_dump_start+0x488/0x6ec net/netlink/af_netlink.c:2384
netlink_dump_start include/linux/netlink.h:258 [inline]
inet_diag_rcv_msg_compat+0x1c8/0x41c net/ipv4/inet_diag.c:1321
sock_diag_rcv_msg+0x174/0x39c
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2505
sock_diag_rcv+0x3c/0x54 net/core/sock_diag.c:276
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x664/0x938 net/netlink/af_netlink.c:1356
netlink_sendmsg+0x844/0xb38 net/netlink/af_netlink.c:1924
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x584/0x870 net/socket.c:2429
___sys_sendmsg+0x214/0x294 net/socket.c:2483
__sys_sendmsg net/socket.c:2512 [inline]
__do_sys_sendmsg net/socket.c:2521 [inline]
__se_sys_sendmsg net/socket.c:2519 [inline]
__arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2519
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&h->lhash2[i].lock);
lock(sk_lock-AF_INET);
lock(&h->lhash2[i].lock);
lock(sk_lock-AF_INET);

*** DEADLOCK ***

6 locks held by syz-executor.2/882:
#0: ffff800016a12b08 (sock_diag_mutex){+.+.}-{3:3}, at: sock_diag_rcv+0x2c/0x54 net/core/sock_diag.c:275
#1: ffff800016a12968 (sock_diag_table_mutex){+.+.}-{3:3}, at: sock_diag_rcv_msg+0x15c/0x39c net/core/sock_diag.c:255
#2: ffff0000cb1c5690 (nlk_cb_mutex-SOCK_DIAG){+.+.}-{3:3}, at: netlink_dump+0xbc/0xa88 net/netlink/af_netlink.c:2227
#3: ffff800016aeda28 (inet_diag_table_mutex){+.+.}-{3:3}, at: inet_diag_lock_handler net/ipv4/inet_diag.c:63 [inline]
#3: ffff800016aeda28 (inet_diag_table_mutex){+.+.}-{3:3}, at: __inet_diag_dump+0x17c/0x33c net/ipv4/inet_diag.c:1177
#4: ffff800014af1560 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x10/0x4c include/linux/rcupdate.h:268
#5: ffff0000c548c078 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
#5: ffff0000c548c078 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:95 [inline]
#5: ffff0000c548c078 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump+0x7b0/0x10dc net/mptcp/mptcp_diag.c:194

stack backtrace:
CPU: 1 PID: 882 Comm: syz-executor.2 Not tainted 5.15.140-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2011
check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3787 [inline]
__lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
lock_sock_fast include/net/sock.h:1700 [inline]
mptcp_diag_get_info+0x208/0x8a0 net/mptcp/mptcp_diag.c:224
inet_sk_diag_fill+0xcb8/0x17b4 net/ipv4/inet_diag.c:342
sk_diag_dump net/mptcp/mptcp_diag.c:24 [inline]
mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:122 [inline]
mptcp_diag_dump+0xb4c/0x10dc net/mptcp/mptcp_diag.c:194
__inet_diag_dump+0x1e8/0x33c net/ipv4/inet_diag.c:1179
inet_diag_dump_compat+0x17c/0x288 net/ipv4/inet_diag.c:1287
netlink_dump+0x470/0xa88 net/netlink/af_netlink.c:2279
__netlink_dump_start+0x488/0x6ec net/netlink/af_netlink.c:2384
netlink_dump_start include/linux/netlink.h:258 [inline]
inet_diag_rcv_msg_compat+0x1c8/0x41c net/ipv4/inet_diag.c:1321
sock_diag_rcv_msg+0x174/0x39c
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2505
sock_diag_rcv+0x3c/0x54 net/core/sock_diag.c:276
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x664/0x938 net/netlink/af_netlink.c:1356
netlink_sendmsg+0x844/0xb38 net/netlink/af_netlink.c:1924
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x584/0x870 net/socket.c:2429
___sys_sendmsg+0x214/0x294 net/socket.c:2483
__sys_sendmsg net/socket.c:2512 [inline]
__do_sys_sendmsg net/socket.c:2521 [inline]
__se_sys_sendmsg net/socket.c:2519 [inline]
__arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2519
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
BUG: sleeping function called from invalid context at net/core/sock.c:3263
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 882, name: syz-executor.2
INFO: lockdep is turned off.
Preemption disabled at:
[<ffff800011960274>] spin_lock include/linux/spinlock.h:363 [inline]
[<ffff800011960274>] mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:95 [inline]
[<ffff800011960274>] mptcp_diag_dump+0x7b0/0x10dc net/mptcp/mptcp_diag.c:194
CPU: 1 PID: 882 Comm: syz-executor.2 Not tainted 5.15.140-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
___might_sleep+0x380/0x4dc kernel/sched/core.c:9626
__might_sleep+0x98/0xf0 kernel/sched/core.c:9580
__lock_sock_fast+0x3c/0xf0 net/core/sock.c:3263
lock_sock_fast include/net/sock.h:1702 [inline]
mptcp_diag_get_info+0x210/0x8a0 net/mptcp/mptcp_diag.c:224
inet_sk_diag_fill+0xcb8/0x17b4 net/ipv4/inet_diag.c:342
sk_diag_dump net/mptcp/mptcp_diag.c:24 [inline]
mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:122 [inline]
mptcp_diag_dump+0xb4c/0x10dc net/mptcp/mptcp_diag.c:194
__inet_diag_dump+0x1e8/0x33c net/ipv4/inet_diag.c:1179
inet_diag_dump_compat+0x17c/0x288 net/ipv4/inet_diag.c:1287
netlink_dump+0x470/0xa88 net/netlink/af_netlink.c:2279
__netlink_dump_start+0x488/0x6ec net/netlink/af_netlink.c:2384
netlink_dump_start include/linux/netlink.h:258 [inline]
inet_diag_rcv_msg_compat+0x1c8/0x41c net/ipv4/inet_diag.c:1321
sock_diag_rcv_msg+0x174/0x39c
netlink_rcv_skb+0x20c/0x3b8 net/netlink/af_netlink.c:2505
sock_diag_rcv+0x3c/0x54 net/core/sock_diag.c:276
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x664/0x938 net/netlink/af_netlink.c:1356
netlink_sendmsg+0x844/0xb38 net/netlink/af_netlink.c:1924
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x584/0x870 net/socket.c:2429
___sys_sendmsg+0x214/0x294 net/socket.c:2483
__sys_sendmsg net/socket.c:2512 [inline]
__do_sys_sendmsg net/socket.c:2521 [inline]
__se_sys_sendmsg net/socket.c:2519 [inline]
__arm64_sys_sendmsg+0x1ac/0x25c net/socket.c:2519
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584


---
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.

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

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

syzbot

unread,
Dec 1, 2023, 8:33:20 PM12/1/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: a78d278e01b1 Linux 5.15.140
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16aa07dce80000
kernel config: https://syzkaller.appspot.com/x/.config?x=6269dce76de6933f
dashboard link: https://syzkaller.appspot.com/bug?extid=f932a1d81e02eb4d5bd2
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=17e4ba9ae80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10021272e80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2551d6be5f8e/disk-a78d278e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b123b077c97a/vmlinux-a78d278e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8393f08697e1/bzImage-a78d278e.xz

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

======================================================
WARNING: possible circular locking dependency detected
5.15.140-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor107/3498 is trying to acquire lock:
ffff888078ae0120 (sk_lock-AF_INET){+.+.}-{0:0}, at: inet_sk_diag_fill+0xf6a/0x1cb0 net/ipv4/inet_diag.c:342

but task is already holding lock:
ffffc90001892650 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
ffffc90001892650 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:95 [inline]
ffffc90001892650 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump+0x869/0x1330 net/mptcp/mptcp_diag.c:194

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&h->lhash2[i].lock){+.+.}-{2:2}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:363 [inline]
__inet_hash+0xe3/0x920 net/ipv4/inet_hashtables.c:606
inet_csk_listen_start+0x231/0x310 net/ipv4/inet_connection_sock.c:1080
inet_listen+0x2c9/0x7c0 net/ipv4/af_inet.c:231
__sys_listen+0x1a7/0x220 net/socket.c:1747
__do_sys_listen net/socket.c:1756 [inline]
__se_sys_listen net/socket.c:1754 [inline]
__x64_sys_listen+0x56/0x60 net/socket.c:1754
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb

-> #0 (sk_lock-AF_INET){+.+.}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain+0x1646/0x58b0 kernel/locking/lockdep.c:3787
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
lock_sock_fast include/net/sock.h:1700 [inline]
mptcp_diag_get_info+0x276/0xa10 net/mptcp/mptcp_diag.c:224
inet_sk_diag_fill+0xf6a/0x1cb0 net/ipv4/inet_diag.c:342
sk_diag_dump net/mptcp/mptcp_diag.c:24 [inline]
mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:122 [inline]
mptcp_diag_dump+0xd1d/0x1330 net/mptcp/mptcp_diag.c:194
__inet_diag_dump+0x20e/0x3a0 net/ipv4/inet_diag.c:1179
inet_diag_dump_compat+0x1bd/0x2d0 net/ipv4/inet_diag.c:1287
netlink_dump+0x606/0xc40 net/netlink/af_netlink.c:2279
__netlink_dump_start+0x52f/0x6f0 net/netlink/af_netlink.c:2384
netlink_dump_start include/linux/netlink.h:258 [inline]
inet_diag_rcv_msg_compat+0x202/0x4c0 net/ipv4/inet_diag.c:1321
sock_diag_rcv_msg+0xd5/0x400
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2505
sock_diag_rcv+0x26/0x40 net/core/sock_diag.c:276
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356
netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1924
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x59e/0x8f0 net/socket.c:2429
___sys_sendmsg+0x252/0x2e0 net/socket.c:2483
__sys_sendmsg net/socket.c:2512 [inline]
__do_sys_sendmsg net/socket.c:2521 [inline]
__se_sys_sendmsg+0x19a/0x260 net/socket.c:2519
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&h->lhash2[i].lock);
lock(sk_lock-AF_INET);
lock(&h->lhash2[i].lock);
lock(sk_lock-AF_INET);

*** DEADLOCK ***

6 locks held by syz-executor107/3498:
#0: ffffffff8d9e3a88 (sock_diag_mutex){+.+.}-{3:3}, at: sock_diag_rcv+0x17/0x40 net/core/sock_diag.c:275
#1: ffffffff8d9e38e8 (sock_diag_table_mutex){+.+.}-{3:3}, at: sock_diag_rcv_msg+0xb8/0x400 net/core/sock_diag.c:255
#2: ffff888147ba5690 (nlk_cb_mutex-SOCK_DIAG){+.+.}-{3:3}, at: netlink_dump+0xd0/0xc40 net/netlink/af_netlink.c:2227
#3: ffffffff8dac1dc8 (inet_diag_table_mutex){+.+.}-{3:3}, at: inet_diag_lock_handler net/ipv4/inet_diag.c:63 [inline]
#3: ffffffff8dac1dc8 (inet_diag_table_mutex){+.+.}-{3:3}, at: __inet_diag_dump+0x191/0x3a0 net/ipv4/inet_diag.c:1177
#4: ffffffff8c91f0e0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:268
#5: ffffc90001892650 (&h->lhash2[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
#5: ffffc90001892650 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:95 [inline]
#5: ffffc90001892650 (&h->lhash2[i].lock){+.+.}-{2:2}, at: mptcp_diag_dump+0x869/0x1330 net/mptcp/mptcp_diag.c:194

stack backtrace:
CPU: 0 PID: 3498 Comm: syz-executor107 Not tainted 5.15.140-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain+0x1646/0x58b0 kernel/locking/lockdep.c:3787
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
lock_sock_fast include/net/sock.h:1700 [inline]
mptcp_diag_get_info+0x276/0xa10 net/mptcp/mptcp_diag.c:224
inet_sk_diag_fill+0xf6a/0x1cb0 net/ipv4/inet_diag.c:342
sk_diag_dump net/mptcp/mptcp_diag.c:24 [inline]
mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:122 [inline]
mptcp_diag_dump+0xd1d/0x1330 net/mptcp/mptcp_diag.c:194
__inet_diag_dump+0x20e/0x3a0 net/ipv4/inet_diag.c:1179
inet_diag_dump_compat+0x1bd/0x2d0 net/ipv4/inet_diag.c:1287
netlink_dump+0x606/0xc40 net/netlink/af_netlink.c:2279
__netlink_dump_start+0x52f/0x6f0 net/netlink/af_netlink.c:2384
netlink_dump_start include/linux/netlink.h:258 [inline]
inet_diag_rcv_msg_compat+0x202/0x4c0 net/ipv4/inet_diag.c:1321
sock_diag_rcv_msg+0xd5/0x400
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2505
sock_diag_rcv+0x26/0x40 net/core/sock_diag.c:276
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356
netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1924
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x59e/0x8f0 net/socket.c:2429
___sys_sendmsg+0x252/0x2e0 net/socket.c:2483
__sys_sendmsg net/socket.c:2512 [inline]
__do_sys_sendmsg net/socket.c:2521 [inline]
__se_sys_sendmsg+0x19a/0x260 net/socket.c:2519
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f8a346c43e9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8583e448 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007ffe8583e618 RCX: 00007f8a346c43e9
RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000004
RBP: 00007f8a34737610 R08: 00007ffe8583e618 R09: 00007ffe8583e618
R10: 00007ffe8583e618 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe8583e608 R14: 0000000000000001 R15: 0000000000000001
</TASK>
BUG: sleeping function called from invalid context at net/core/sock.c:3263
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3498, name: syz-executor107
INFO: lockdep is turned off.
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 0 PID: 3498 Comm: syz-executor107 Not tainted 5.15.140-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
___might_sleep+0x547/0x6a0 kernel/sched/core.c:9626
__lock_sock_fast+0x2f/0xe0 net/core/sock.c:3263
lock_sock_fast include/net/sock.h:1702 [inline]
mptcp_diag_get_info+0x282/0xa10 net/mptcp/mptcp_diag.c:224
inet_sk_diag_fill+0xf6a/0x1cb0 net/ipv4/inet_diag.c:342
sk_diag_dump net/mptcp/mptcp_diag.c:24 [inline]
mptcp_diag_dump_listeners net/mptcp/mptcp_diag.c:122 [inline]
mptcp_diag_dump+0xd1d/0x1330 net/mptcp/mptcp_diag.c:194
__inet_diag_dump+0x20e/0x3a0 net/ipv4/inet_diag.c:1179
inet_diag_dump_compat+0x1bd/0x2d0 net/ipv4/inet_diag.c:1287
netlink_dump+0x606/0xc40 net/netlink/af_netlink.c:2279
__netlink_dump_start+0x52f/0x6f0 net/netlink/af_netlink.c:2384
netlink_dump_start include/linux/netlink.h:258 [inline]
inet_diag_rcv_msg_compat+0x202/0x4c0 net/ipv4/inet_diag.c:1321
sock_diag_rcv_msg+0xd5/0x400
netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2505
sock_diag_rcv+0x26/0x40 net/core/sock_diag.c:276
netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356
netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1924
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x59e/0x8f0 net/socket.c:2429
___sys_sendmsg+0x252/0x2e0 net/socket.c:2483
__sys_sendmsg net/socket.c:2512 [inline]
__do_sys_sendmsg net/socket.c:2521 [inline]
__se_sys_sendmsg+0x19a/0x260 net/socket.c:2519
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f8a346c43e9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8583e448


---
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.
Reply all
Reply to author
Forward
0 new messages