WARNING: locking bug in selinux_netlbl_socket_connect

9 views
Skip to first unread message

syzbot

unread,
Aug 24, 2019, 3:50:08 AM8/24/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: a5aa8058 Linux 4.19.67
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16113ef2600000
kernel config: https://syzkaller.appspot.com/x/.config?x=8e5f93d2c874cdab
dashboard link: https://syzkaller.appspot.com/bug?extid=02e7843d4a2e22d8e246
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

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

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

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

CPU: 1 PID: 11302 Comm: syz-executor.5 Not tainted 4.19.67 #41
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+0x172/0x1f0 lib/dump_stack.c:113
panic+0x263/0x507 kernel/panic.c:185
__warn.cold+0x20/0x4a kernel/panic.c:540
report_bug+0x263/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+0x204/0x360 arch/x86/kernel/traps.c:296
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1037
RIP: 0010:look_up_lock_class kernel/locking/lockdep.c:698 [inline]
RIP: 0010:register_lock_class+0xfeb/0x1cf0 kernel/locking/lockdep.c:748
Code: 60 48 89 da 4d 8b 75 c0 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80
3c 02 00 0f 85 fe 05 00 00 4c 89 33 e9 1b f3 ff ff 0f 0b <0f> 0b e9 0d f2
ff ff 44 89 e0 4c 8b 85 48 ff ff ff 83 c0 01 4c 8b
RSP: 0018:ffff88805760f980 EFLAGS: 00010083
RAX: dffffc0000000000 RBX: ffff8880900f78e0 RCX: 0000000000000000
RDX: 1ffff1101201ef1f RSI: 0000000000000000 RDI: ffff8880900f78f8
RBP: ffff88805760fa50 R08: 1ffff1100aec1f39 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: ffffffff89f05870
R13: 0000000000000000 R14: ffffffff87de8560 R15: dffffc0000000000
__lock_acquire+0x154/0x49c0 kernel/locking/lockdep.c:3299
lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:3900
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x33/0x50 kernel/locking/spinlock.c:168
spin_lock_bh include/linux/spinlock.h:334 [inline]
lock_sock_nested+0x41/0x120 net/core/sock.c:2833
lock_sock include/net/sock.h:1501 [inline]
selinux_netlbl_socket_connect+0x20/0xc0 security/selinux/netlabel.c:621
selinux_socket_connect+0x6a/0x90 security/selinux/hooks.c:4874
security_socket_connect+0x77/0xc0 security/security.c:1402
__sys_connect+0x19d/0x330 net/socket.c:1659
__do_sys_connect net/socket.c:1674 [inline]
__se_sys_connect net/socket.c:1671 [inline]
__x64_sys_connect+0x73/0xb0 net/socket.c:1671
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x459879
Code: fd b7 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f5ba931cc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459879
RDX: 000000000000001c RSI: 0000000020000040 RDI: 000000000000000c
RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f5ba931d6d4
R13: 00000000004bfdd1 R14: 00000000004d1c18 R15: 00000000ffffffff
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Sep 13, 2019, 9:45:09 PM9/13/19
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: ee809c7e Linux 4.19.72
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10223c59600000
kernel config: https://syzkaller.appspot.com/x/.config?x=ad6c5c98f4231da9
dashboard link: https://syzkaller.appspot.com/bug?extid=02e7843d4a2e22d8e246
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14b2e821600000

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

IPv6: ADDRCONF(NETDEV_UP): vxcan1: link is not ready
8021q: adding VLAN 0 to HW filter on device batadv0
WARNING: CPU: 1 PID: 10208 at kernel/locking/lockdep.c:698
arch_local_save_flags arch/x86/include/asm/paravirt.h:784 [inline]
WARNING: CPU: 1 PID: 10208 at kernel/locking/lockdep.c:698
arch_local_save_flags arch/x86/include/asm/paravirt.h:782 [inline]
WARNING: CPU: 1 PID: 10208 at kernel/locking/lockdep.c:698
look_up_lock_class kernel/locking/lockdep.c:689 [inline]
WARNING: CPU: 1 PID: 10208 at kernel/locking/lockdep.c:698
register_lock_class+0xfeb/0x1cf0 kernel/locking/lockdep.c:748
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 10208 Comm: syz-executor.3 Not tainted 4.19.72 #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+0x172/0x1f0 lib/dump_stack.c:113
panic+0x263/0x507 kernel/panic.c:185
__warn.cold+0x20/0x4a kernel/panic.c:540
report_bug+0x263/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+0x204/0x360 arch/x86/kernel/traps.c:296
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1037
RIP: 0010:look_up_lock_class kernel/locking/lockdep.c:698 [inline]
RIP: 0010:register_lock_class+0xfeb/0x1cf0 kernel/locking/lockdep.c:748
Code: 60 48 89 da 4d 8b 75 c0 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80
3c 02 00 0f 85 fe 05 00 00 4c 89 33 e9 1b f3 ff ff 0f 0b <0f> 0b e9 0d f2
ff ff 44 89 e0 4c 8b 85 48 ff ff ff 83 c0 01 4c 8b
RSP: 0018:ffff88807934f980 EFLAGS: 00010083
RAX: dffffc0000000000 RBX: ffff88808d2f91e0 RCX: 0000000000000000
RDX: 1ffff11011a5f23f RSI: 0000000000000000 RDI: ffff88808d2f91f8
RBP: ffff88807934fa50 R08: 1ffff1100f269f39 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: ffffffff89f06b10
R13: 0000000000000000 R14: ffffffff87de89a0 R15: dffffc0000000000
__lock_acquire+0x154/0x49c0 kernel/locking/lockdep.c:3299
lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:3900
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
_raw_spin_lock_bh+0x33/0x50 kernel/locking/spinlock.c:168
spin_lock_bh include/linux/spinlock.h:334 [inline]
lock_sock_nested+0x41/0x120 net/core/sock.c:2833
lock_sock include/net/sock.h:1501 [inline]
selinux_netlbl_socket_connect+0x20/0xc0 security/selinux/netlabel.c:621
selinux_socket_connect+0x6a/0x90 security/selinux/hooks.c:4874
security_socket_connect+0x77/0xc0 security/security.c:1402
__sys_connect+0x19d/0x330 net/socket.c:1659
__do_sys_connect net/socket.c:1674 [inline]
__se_sys_connect net/socket.c:1671 [inline]
__x64_sys_connect+0x73/0xb0 net/socket.c:1671
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4598e9
Code: fd b7 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f0b2d0d7c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004598e9
RDX: 000000000000001c RSI: 0000000020000080 RDI: 0000000000000005
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0b2d0d86d4
R13: 00000000004bfe0a R14: 00000000004d1c98 R15: 00000000ffffffff
Reply all
Reply to author
Forward
0 new messages