WARNING: locking bug in inet_autobind

6 views
Skip to first unread message

syzbot

unread,
Nov 12, 2020, 9:20:18 AM11/12/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 31acccdc Linux 4.19.157
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13049aa1500000
kernel config: https://syzkaller.appspot.com/x/.config?x=1f604e014c43fe09
dashboard link: https://syzkaller.appspot.com/bug?extid=4413708f5b8a57685f7f
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=118b1b26500000

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

WARNING: CPU: 0 PID: 21864 at kernel/locking/lockdep.c:698 arch_local_save_flags arch/x86/include/asm/paravirt.h:784 [inline]
WARNING: CPU: 0 PID: 21864 at kernel/locking/lockdep.c:698 look_up_lock_class kernel/locking/lockdep.c:689 [inline]
WARNING: CPU: 0 PID: 21864 at kernel/locking/lockdep.c:698 register_lock_class+0x77b/0x11c0 kernel/locking/lockdep.c:748
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 21864 Comm: syz-executor.2 Not tainted 4.19.157-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2fe lib/dump_stack.c:118
panic+0x26a/0x50e kernel/panic.c:186
__warn.cold+0x20/0x61 kernel/panic.c:541
report_bug+0x262/0x2b0 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:178 [inline]
fixup_bug arch/x86/kernel/traps.c:173 [inline]
do_error_trap+0x1d7/0x310 arch/x86/kernel/traps.c:296
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1038
RIP: 0010:look_up_lock_class kernel/locking/lockdep.c:698 [inline]
RIP: 0010:register_lock_class+0x77b/0x11c0 kernel/locking/lockdep.c:748
Code: 8b 05 29 78 ea 0b 85 c0 0f 85 17 ff ff ff 48 c7 c6 40 19 6a 88 48 c7 c7 00 17 6a 88 e8 a9 cf ec ff 0f 0b e9 fd fe ff ff 0f 0b <0f> 0b e9 b3 fa ff ff 48 8d 70 01 48 69 c0 50 01 00 00 48 89 35 cc
RSP: 0018:ffff888098c9fa20 EFLAGS: 00010087
RAX: dffffc0000000000 RBX: ffff8880a173e820 RCX: 0000000000000000
RDX: 1ffff110142e7d07 RSI: 0000000000000000 RDI: ffff8880a173e838
RBP: 0000000000000000 R08: 0000000000000000 R09: 1ffff11013193f4c
R10: ffffffff8d239720 R11: 0000000000000000 R12: ffffffff8cdc9670
R13: ffffffff894ba020 R14: 1ffff11013193f4c R15: 0000000000000000
__lock_acquire+0x17d/0x3ff0 kernel/locking/lockdep.c:3303
lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3907
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:168
spin_lock_bh include/linux/spinlock.h:334 [inline]
lock_sock_nested+0x3b/0x110 net/core/sock.c:2864
lock_sock include/net/sock.h:1510 [inline]
inet_autobind+0x1a/0x190 net/ipv4/af_inet.c:179
inet_dgram_connect+0x245/0x2d0 net/ipv4/af_inet.c:569
__sys_connect+0x265/0x2c0 net/socket.c:1663
__do_sys_connect net/socket.c:1674 [inline]
__se_sys_connect net/socket.c:1671 [inline]
__x64_sys_connect+0x6f/0xb0 net/socket.c:1671
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45deb9
Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f7b7219ec78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000002400 RCX: 000000000045deb9
RDX: 000000000000001c RSI: 0000000020000080 RDI: 0000000000000004
RBP: 000000000118c008 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bfd4
R13: 00007ffce82992ff R14: 00007f7b7219f9c0 R15: 000000000118bfd4
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
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 can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Jun 14, 2022, 10:32:31 PM6/14/22
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=127bd1d7f00000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=4413708f5b8a57685f7f
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10aa8ad7f00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15062310080000

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

WARNING: CPU: 1 PID: 30658 at kernel/locking/lockdep.c:698 arch_local_save_flags arch/x86/include/asm/paravirt.h:784 [inline]
WARNING: CPU: 1 PID: 30658 at kernel/locking/lockdep.c:698 look_up_lock_class kernel/locking/lockdep.c:689 [inline]
WARNING: CPU: 1 PID: 30658 at kernel/locking/lockdep.c:698 register_lock_class+0x77b/0x11c0 kernel/locking/lockdep.c:749
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 30658 Comm: syz-executor176 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
panic+0x26a/0x50e kernel/panic.c:186
__warn.cold+0x20/0x5a kernel/panic.c:541
report_bug+0x262/0x2b0 lib/bug.c:183
fixup_bug arch/x86/kernel/traps.c:178 [inline]
fixup_bug arch/x86/kernel/traps.c:173 [inline]
do_error_trap+0x1d7/0x310 arch/x86/kernel/traps.c:296
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1038
RIP: 0010:look_up_lock_class kernel/locking/lockdep.c:698 [inline]
RIP: 0010:register_lock_class+0x77b/0x11c0 kernel/locking/lockdep.c:749
Code: 8b 05 c9 63 ec 0b 85 c0 0f 85 17 ff ff ff 48 c7 c6 e0 1b 6a 88 48 c7 c7 40 19 6a 88 e8 c3 29 a8 06 0f 0b e9 fd fe ff ff 0f 0b <0f> 0b e9 b3 fa ff ff 48 8d 70 01 48 69 c0 50 01 00 00 48 89 35 ac
RSP: 0018:ffff88809b597a20 EFLAGS: 00010087
RAX: dffffc0000000000 RBX: ffff8880b3fb10a0 RCX: 0000000000000000
RDX: 1ffff110167f6217 RSI: 0000000000000000 RDI: ffff8880b3fb10b8
RBP: 0000000000000000 R08: 0000000000000000 R09: 1ffff110136b2f4c
R10: ffffffff8d243760 R11: 0000000000000000 R12: ffffffff8cdd4520
R13: ffffffff894c35a0 R14: 1ffff110136b2f4c R15: 0000000000000000
__lock_acquire+0x17d/0x3ff0 kernel/locking/lockdep.c:3304
lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:168
spin_lock_bh include/linux/spinlock.h:334 [inline]
lock_sock_nested+0x3b/0x110 net/core/sock.c:2884
lock_sock include/net/sock.h:1512 [inline]
inet_autobind+0x1a/0x190 net/ipv4/af_inet.c:179
inet_dgram_connect+0x245/0x2d0 net/ipv4/af_inet.c:569
__sys_connect+0x265/0x2c0 net/socket.c:1775
__do_sys_connect net/socket.c:1786 [inline]
__se_sys_connect net/socket.c:1783 [inline]
__x64_sys_connect+0x6f/0xb0 net/socket.c:1783
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f95d2e32ad9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 15 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:00007f95d2dbf318 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 00007f95d2ebb4d8 RCX: 00007f95d2e32ad9
RDX: 000000000000001c RSI: 0000000020000040 RDI: 0000000000000004
RBP: 00007f95d2ebb4d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f95d2e885dc
R13: 00007ffc84df1b6f R14: 00007f95d2dbf400 R15: 0000000000022000
Reply all
Reply to author
Forward
0 new messages