[v5.15] possible deadlock in l2tp_tunnel_register

0 views
Skip to first unread message

syzbot

unread,
Mar 7, 2023, 11:31:43 AM3/7/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d9b4a0c83a2d Linux 5.15.98
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=175f899cc80000
kernel config: https://syzkaller.appspot.com/x/.config?x=b57cfa804330c3b7
dashboard link: https://syzkaller.appspot.com/bug?extid=4b1195d0985ca5c60ea7
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8088989394e3/disk-d9b4a0c8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2651d6753959/vmlinux-d9b4a0c8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f3fa3f994f9a/Image-d9b4a0c8.gz.xz

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

============================================
WARNING: possible recursive locking detected
5.15.98-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.3/4431 is trying to acquire lock:
ffff0000daa63120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1649 [inline]
ffff0000daa63120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: l2tp_tunnel_register+0x888/0x1974 net/l2tp/l2tp_core.c:1485

but task is already holding lock:
ffff0000daa63120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1649 [inline]
ffff0000daa63120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0x53c/0x1348 net/l2tp/l2tp_ppp.c:676

other info that might help us debug this:
Possible unsafe locking scenario:

CPU0
----
lock(sk_lock-AF_PPPOX);
lock(sk_lock-AF_PPPOX);

*** DEADLOCK ***

May be due to missing lock nesting notation

1 lock held by syz-executor.3/4431:
#0: ffff0000daa63120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1649 [inline]
#0: ffff0000daa63120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0x53c/0x1348 net/l2tp/l2tp_ppp.c:676

stack backtrace:
CPU: 0 PID: 4431 Comm: syz-executor.3 Not tainted 5.15.98-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/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
__lock_acquire+0x62b4/0x7620 kernel/locking/lockdep.c:5011
lock_acquire+0x2b8/0x894 kernel/locking/lockdep.c:5622
lock_sock_nested+0xec/0x1ec net/core/sock.c:3207
lock_sock include/net/sock.h:1649 [inline]
l2tp_tunnel_register+0x888/0x1974 net/l2tp/l2tp_core.c:1485
pppol2tp_connect+0x944/0x1348 net/l2tp/l2tp_ppp.c:724
__sys_connect_file net/socket.c:1899 [inline]
__sys_connect+0x268/0x290 net/socket.c:1916
__do_sys_connect net/socket.c:1926 [inline]
__se_sys_connect net/socket.c:1923 [inline]
__arm64_sys_connect+0x7c/0x94 net/socket.c:1923
__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:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 <unknown>: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.

syzbot

unread,
Mar 7, 2023, 2:02:38 PM3/7/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 42616e0f09fb Linux 6.1.15
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=159e4684c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=690b9ff41783cd73
dashboard link: https://syzkaller.appspot.com/bug?extid=d7b787d5630e0803b334
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/db869f2ed2bd/disk-42616e0f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/37951bbe5829/vmlinux-42616e0f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/23aa1a75ce0f/bzImage-42616e0f.xz

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

============================================
WARNING: possible recursive locking detected
6.1.15-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.2/7973 is trying to acquire lock:
ffff888048847130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1721 [inline]
ffff888048847130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: l2tp_tunnel_register+0xafb/0x1d30 net/l2tp/l2tp_core.c:1483

but task is already holding lock:
ffff888048847130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1721 [inline]
ffff888048847130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0x65b/0x1680 net/l2tp/l2tp_ppp.c:675

other info that might help us debug this:
Possible unsafe locking scenario:

CPU0
----
lock(sk_lock-AF_PPPOX);
lock(sk_lock-AF_PPPOX);

*** DEADLOCK ***

May be due to missing lock nesting notation

1 lock held by syz-executor.2/7973:
#0: ffff888048847130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1721 [inline]
#0: ffff888048847130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0x65b/0x1680 net/l2tp/l2tp_ppp.c:675

stack backtrace:
CPU: 1 PID: 7973 Comm: syz-executor.2 Not tainted 6.1.15-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_deadlock_bug kernel/locking/lockdep.c:2990 [inline]
check_deadlock kernel/locking/lockdep.c:3033 [inline]
validate_chain+0x4726/0x58e0 kernel/locking/lockdep.c:3818
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5055
lock_acquire+0x231/0x620 kernel/locking/lockdep.c:5668
lock_sock_nested+0x44/0x100 net/core/sock.c:3448
lock_sock include/net/sock.h:1721 [inline]
l2tp_tunnel_register+0xafb/0x1d30 net/l2tp/l2tp_core.c:1483
pppol2tp_connect+0xafb/0x1680 net/l2tp/l2tp_ppp.c:723
__sys_connect_file net/socket.c:1979 [inline]
__sys_connect+0x2c9/0x300 net/socket.c:1996
__do_sys_connect net/socket.c:2006 [inline]
__se_sys_connect net/socket.c:2003 [inline]
__x64_sys_connect+0x76/0x80 net/socket.c:2003
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+0x63/0xcd
RIP: 0033:0x7fe21948c0f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe21a249168 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 00007fe2195abf80 RCX: 00007fe21948c0f9
RDX: 000000000000002e RSI: 0000000020000100 RDI: 0000000000000003
RBP: 00007fe2194e7ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff8afc671f R14: 00007fe21a249300 R15: 0000000000022000
</TASK>

syzbot

unread,
Mar 8, 2023, 5:22:39 AM3/8/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: d9b4a0c83a2d Linux 5.15.98
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10ca20b8c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=b57cfa804330c3b7
dashboard link: https://syzkaller.appspot.com/bug?extid=4b1195d0985ca5c60ea7
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11abca14c80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=168338b8c80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8088989394e3/disk-d9b4a0c8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2651d6753959/vmlinux-d9b4a0c8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f3fa3f994f9a/Image-d9b4a0c8.gz.xz

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

============================================
WARNING: possible recursive locking detected
5.15.98-syzkaller #0 Not tainted
--------------------------------------------
syz-executor236/4051 is trying to acquire lock:
ffff0000dd063120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1649 [inline]
ffff0000dd063120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: l2tp_tunnel_register+0x888/0x1974 net/l2tp/l2tp_core.c:1485

but task is already holding lock:
ffff0000dd062120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1649 [inline]
ffff0000dd062120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0x53c/0x1348 net/l2tp/l2tp_ppp.c:676

other info that might help us debug this:
Possible unsafe locking scenario:

CPU0
----
lock(sk_lock-AF_PPPOX);
lock(sk_lock-AF_PPPOX);

*** DEADLOCK ***

May be due to missing lock nesting notation

1 lock held by syz-executor236/4051:
#0: ffff0000dd062120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1649 [inline]
#0: ffff0000dd062120 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0x53c/0x1348 net/l2tp/l2tp_ppp.c:676

stack backtrace:
CPU: 0 PID: 4051 Comm: syz-executor236 Not tainted 5.15.98-syzkaller #0

syzbot

unread,
Mar 8, 2023, 6:26:43 AM3/8/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 42616e0f09fb Linux 6.1.15
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10d83488c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=650737f7e9682672
dashboard link: https://syzkaller.appspot.com/bug?extid=d7b787d5630e0803b334
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=135acdcac80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1272f77ac80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f10713d1fd0f/disk-42616e0f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5a1307bb774e/vmlinux-42616e0f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/388238a30fe4/Image-42616e0f.gz.xz

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

============================================
WARNING: possible recursive locking detected
6.1.15-syzkaller #0 Not tainted
--------------------------------------------
syz-executor140/4306 is trying to acquire lock:
ffff0000d4d5e130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1721 [inline]
ffff0000d4d5e130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: l2tp_tunnel_register+0x888/0x19f8 net/l2tp/l2tp_core.c:1483

but task is already holding lock:
ffff0000cf697130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1721 [inline]
ffff0000cf697130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0x53c/0x1348 net/l2tp/l2tp_ppp.c:675

other info that might help us debug this:
Possible unsafe locking scenario:

CPU0
----
lock(sk_lock-AF_PPPOX);
lock(sk_lock-AF_PPPOX);

*** DEADLOCK ***

May be due to missing lock nesting notation

1 lock held by syz-executor140/4306:
#0: ffff0000cf697130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1721 [inline]
#0: ffff0000cf697130 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppol2tp_connect+0x53c/0x1348 net/l2tp/l2tp_ppp.c:675

stack backtrace:
CPU: 0 PID: 4306 Comm: syz-executor140 Not tainted 6.1.15-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__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
__lock_acquire+0x6310/0x764c kernel/locking/lockdep.c:5055
lock_acquire+0x2f8/0x8dc kernel/locking/lockdep.c:5668
lock_sock_nested+0x78/0x138 net/core/sock.c:3448
lock_sock include/net/sock.h:1721 [inline]
l2tp_tunnel_register+0x888/0x19f8 net/l2tp/l2tp_core.c:1483
pppol2tp_connect+0x944/0x1348 net/l2tp/l2tp_ppp.c:723
__sys_connect_file net/socket.c:1979 [inline]
__sys_connect+0x268/0x290 net/socket.c:1996
__do_sys_connect net/socket.c:2006 [inline]
__se_sys_connect net/socket.c:2003 [inline]
__arm64_sys_connect+0x7c/0x94 net/socket.c:2003
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

syzbot

unread,
Apr 9, 2023, 11:32:16 AM4/9/23
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 4bb736b40475528ac1aa8c98b368563618488a70
Author: Shigeru Yoshida <syos...@redhat.com>
Date: Thu Feb 16 16:37:10 2023 +0000

l2tp: Avoid possible recursive deadlock in l2tp_tunnel_register()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1145a4e5c80000
start commit: 42616e0f09fb Linux 6.1.15
git tree: linux-6.1.y
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10ffa624c80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12ca13eac80000

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

#syz fix: l2tp: Avoid possible recursive deadlock in l2tp_tunnel_register()

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

syzbot

unread,
Apr 9, 2023, 3:56:17 PM4/9/23
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit f6df58aa15f7d469f69b1dd21b001ff483255244
Author: Shigeru Yoshida <syos...@redhat.com>
Date: Thu Feb 16 16:37:10 2023 +0000

l2tp: Avoid possible recursive deadlock in l2tp_tunnel_register()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=127cf363c80000
start commit: d9b4a0c83a2d Linux 5.15.98
git tree: linux-5.15.y
kernel config: https://syzkaller.appspot.com/x/.config?x=2f8d9515b973b23b
dashboard link: https://syzkaller.appspot.com/bug?extid=4b1195d0985ca5c60ea7
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=146a31a2c80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14196a7cc80000
Reply all
Reply to author
Forward
0 new messages