WARNING: locking bug in selinux_netlbl_socket_connect

Status: auto-obsoleted due to no activity on 2023/05/08 04:25
Subsystems: selinux
[Documentation on labels]
Reported-by: syzbot+5fa07e4e18e4eb1ccb12@syzkaller.appspotmail.com
First crash: 2703d, last: 1411d
Cause bisection: the cause commit could be any of (bisect log):
commit 9211bfbff80a7604273086fec5685efcdc10be2b
Author: Jeremy Sowden <jeremy@azazel.net>
Date: Wed Aug 7 14:17:00 2019 +0000

  netfilter: add missing IS_ENABLED(CONFIG_BRIDGE_NETFILTER) checks to header-file.

commit 47e640af2e492cc28778dd6f894d50313f7fba75
Author: Jeremy Sowden <jeremy@azazel.net>
Date: Wed Aug 7 14:17:01 2019 +0000

  netfilter: add missing IS_ENABLED(CONFIG_NF_TABLES) check to header-file.

commit a1b2f04ea527397fcacacd09e0d690927feef429
Author: Jeremy Sowden <jeremy@azazel.net>
Date: Wed Aug 7 14:16:59 2019 +0000

  netfilter: add missing includes to a number of header-files.

commit 0abc8bf4f2842e409926096f0fa009b468cbd855
Author: Jeremy Sowden <jeremy@azazel.net>
Date: Wed Aug 7 14:17:02 2019 +0000

  netfilter: add missing IS_ENABLED(CONFIG_NF_CONNTRACK) checks to some header-files.

commit bd96b4c75675e616eefef6d85d163530eef9c5e5
Author: Jeremy Sowden <jeremy@azazel.net>
Date: Wed Aug 7 14:16:58 2019 +0000

  netfilter: inline four headers files into another one.

commit 43dd16efc7f235f153804500a4363769bd2276fc
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Thu Aug 1 12:09:26 2019 +0000

  netfilter: nf_tables: store data in offload context registers

commit 78458e3e08cda2aacaec9fde8c295dfc2f88618a
Author: Jeremy Sowden <jeremy@azazel.net>
Date: Wed Aug 7 14:17:03 2019 +0000

  netfilter: add missing IS_ENABLED(CONFIG_NETFILTER) checks to some header-files.

commit 20a9379d9a03ee0712d225035308973ecc5f6783
Author: Jeremy Sowden <jeremy@azazel.net>
Date: Wed Aug 7 14:17:04 2019 +0000

  netfilter: remove "#ifdef __KERNEL__" guards from some headers.

commit bd8699e9e29287b5571b32b68c3dcd05985fa9b1
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Tue Jul 30 11:32:01 2019 +0000

  netfilter: nft_bitwise: add offload support

commit 2a475c409fe81a76fb26a6b023509d648237bbe6
Author: Jeremy Sowden <jeremy@azazel.net>
Date: Wed Aug 7 14:17:05 2019 +0000

  kbuild: remove all netfilter headers from header-test blacklist.

commit 7e59b3fea2a2510b52761c20ccc71d3e9f6b7db8
Author: yangxingwu <xingwu.yang@gmail.com>
Date: Tue Jul 16 02:13:01 2019 +0000

  netfilter: remove unnecessary spaces

commit 1b90af292e71b20d03b837d39406acfbdc5d4b2a
Author: Junwei Hu <hujunwei4@huawei.com>
Date: Wed Jul 31 16:03:30 2019 +0000

  ipvs: Improve robustness to the ipvs sysctl

commit 5785cf15fd74ec3b1a076fd39bc67382a8455fe7
Author: Valdis Klētnieks <valdis.kletnieks@vt.edu>
Date: Thu Aug 8 05:28:08 2019 +0000

  netfilter: nf_tables: add missing prototypes.

commit 0a30ba509fdeea740bedb81ce3bee4f74a759654
Author: Valdis Klētnieks <valdis.kletnieks@vt.edu>
Date: Thu Aug 8 05:43:22 2019 +0000

  netfilter: nf_nat_proto: make tables static

commit e84fb4b3666dabd3917952fb33588daa891a6ad3
Author: Matteo Croce <mcroce@redhat.com>
Date: Tue Jul 23 01:23:03 2019 +0000

  netfilter: conntrack: use shared sysctl constants

commit 105333435b4f3b21ffc325f32fae17719310db64
Author: Florian Westphal <fw@strlen.de>
Date: Mon Aug 12 11:40:04 2019 +0000

  netfilter: connlabels: prefer static lock initialiser

commit 8c0bb7873815bf8c3c4dfb24e8ebf4fefb4c35d2
Author: Fernando Fernandez Mancera <ffmancera@riseup.net>
Date: Wed Jul 10 10:05:59 2019 +0000

  netfilter: synproxy: rename mss synproxy_options field

commit c162610c7db2e9611a7b3ec806f9c97fcfec0b0b
Author: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Wed Aug 14 01:22:57 2019 +0000

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
  
Fix bisection: failed (error log, bisect log)
  
▶ ▼ Discussions (1)
Title Replies (including bot) Last reply
WARNING: locking bug in selinux_netlbl_socket_connect 5 (6) 2019/09/29 01:12
▶ ▼ Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 WARNING: locking bug in selinux_netlbl_socket_connect 4 syz error 13 2231d 2643d 0/1 upstream: reported syz repro on 2019/08/24 07:50
▶ ▼ Last patch testing requests (7)
Created Duration User Patch Repo Result
2023/04/18 07:40 19m retest repro upstream no crash log
2023/04/18 06:40 28m retest repro upstream no crash log
2023/04/18 05:40 29m retest repro upstream no crash log
2023/04/18 04:40 18m retest repro upstream no crash log
2023/01/08 03:31 14m retest repro upstream report log
2022/09/30 00:30 10m retest repro upstream report log
2022/08/31 03:27 20m retest repro upstream no crash log
▶ ▼ Fix bisection attempts (2)
Created Duration User Patch Repo Result
2019/12/22 04:11 20m bisect fix upstream error job log
2019/10/21 15:49 32m bisect fix upstream OK (0) job log log

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 1 PID: 9765 at kernel/locking/lockdep.c:894 look_up_lock_class kernel/locking/lockdep.c:894 [inline]
WARNING: CPU: 1 PID: 9765 at kernel/locking/lockdep.c:894 register_lock_class+0x1fb/0x1100 kernel/locking/lockdep.c:1242
Modules linked in:
CPU: 1 PID: 9765 Comm: syz-executor.0 Not tainted 5.11.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:look_up_lock_class kernel/locking/lockdep.c:894 [inline]
RIP: 0010:register_lock_class+0x1fb/0x1100 kernel/locking/lockdep.c:1242
Code: 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 21 0d 00 00 4d 3b 67 18 74 0b 49 81 3f c0 f2 15 8f 74 02 <0f> 0b 85 ed 0f 84 20 01 00 00 f6 44 24 04 01 0f 85 15 01 00 00 83
RSP: 0018:ffffc900097b7a28 EFLAGS: 00010006
RAX: dffffc0000000000 RBX: 1ffff920012f6f4c RCX: ffffffff8fc02660
RDX: 1ffff1100688621f RSI: 0000000000000000 RDI: ffff8880344310f8
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff8a434b80
R13: ffffffff90759740 R14: ffffffff8f8c0b00 R15: ffff8880344310e0
FS:  00007fa72344f700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000053b198 CR3: 000000001246e000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __lock_acquire+0x101/0x54f0 kernel/locking/lockdep.c:4711
 lock_acquire kernel/locking/lockdep.c:5442 [inline]
 lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407
 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
 _raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:175
 spin_lock_bh include/linux/spinlock.h:359 [inline]
 lock_sock_nested+0x3b/0x110 net/core/sock.c:3049
 lock_sock include/net/sock.h:1594 [inline]
 selinux_netlbl_socket_connect+0x18/0x40 security/selinux/netlabel.c:607
 selinux_socket_connect+0x65/0x80 security/selinux/hooks.c:4808
 security_socket_connect+0x50/0xb0 security/security.c:2126
 __sys_connect_file+0xa2/0x1a0 net/socket.c:1831
 __sys_connect+0x161/0x190 net/socket.c:1852
 __do_sys_connect net/socket.c:1862 [inline]
 __se_sys_connect net/socket.c:1859 [inline]
 __x64_sys_connect+0x6f/0xb0 net/socket.c:1859
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x465d99
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa72344f188 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 000000000056c008 RCX: 0000000000465d99
RDX: 000000000000001c RSI: 0000000020000080 RDI: 0000000000000004
RBP: 00000000004bcf27 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c008
R13: 00007fff30b026ef R14: 00007fa72344f300 R15: 0000000000022000

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/02/17 14:33 upstream f40ddce88593 052f8d9f .config console log report syz ci-upstream-kasan-gce-selinux-root WARNING: locking bug in selinux_netlbl_socket_connect
2020/09/01 06:39 upstream f75aef392f86 d5a3ae1f .config console log report syz ci-upstream-kasan-gce-selinux-root
2020/07/26 17:39 upstream 04300d66f0a0 51265195 .config console log report syz ci-qemu-upstream
2019/11/21 11:13 upstream c74386d50fba 8098ea0f .config console log report syz ci-upstream-kasan-gce-selinux-root
2019/09/21 15:49 upstream f97c81dc6ca5 d96e88f3 .config console log report syz ci-upstream-kasan-gce-selinux-root
2021/11/15 11:01 upstream ce49bfc8d037 83f5c9b5 .config console log report info ci-upstream-kasan-gce-selinux-root WARNING: locking bug in selinux_netlbl_socket_connect
2020/12/16 04:12 upstream d635a69dd498 f213e07e .config console log report info ci-upstream-kasan-gce-selinux-root
2020/11/24 07:50 upstream d5beb3140f91 1ab681a4 .config console log report info ci-upstream-kasan-gce-selinux-root
2020/09/19 12:36 upstream eb5f95f1593f 53ce8104 .config console log report info ci-upstream-kasan-gce-selinux-root
2019/06/25 09:55 upstream 4b972a01a7da 82c13b6b .config console log report ci-upstream-kasan-gce-selinux-root
* Struck through repros no longer work on HEAD.