====================================================== WARNING: possible circular locking dependency detected 4.14.305-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/11988 is trying to acquire lock: (&xt[i].mutex){+.+.}, at: [] match_revfn+0x43/0x210 net/netfilter/x_tables.c:332 but task is already holding lock: (&table[i].mutex){+.+.}, at: [] nfnl_lock net/netfilter/nfnetlink.c:61 [inline] (&table[i].mutex){+.+.}, at: [] nfnetlink_rcv_msg+0x726/0xc00 net/netfilter/nfnetlink.c:209 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&table[i].mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 ip_set_nfnl_put+0x11a/0x310 net/netfilter/ipset/ip_set_core.c:732 set_target_v1_destroy+0xd7/0x150 net/netfilter/xt_set.c:392 cleanup_entry+0x232/0x310 net/ipv6/netfilter/ip6_tables.c:685 __do_replace+0x38d/0x580 net/ipv4/netfilter/arp_tables.c:930 do_replace net/ipv6/netfilter/ip6_tables.c:1162 [inline] do_ip6t_set_ctl+0x256/0x3b0 net/ipv6/netfilter/ip6_tables.c:1688 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x5f/0xb0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0xc0/0x120 net/ipv6/ipv6_sockglue.c:944 tcp_setsockopt+0x7b/0xc0 net/ipv4/tcp.c:2831 SYSC_setsockopt net/socket.c:1865 [inline] SyS_setsockopt+0x110/0x1e0 net/socket.c:1844 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 -> #0 (&xt[i].mutex){+.+.}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 match_revfn+0x43/0x210 net/netfilter/x_tables.c:332 xt_find_revision+0x8d/0x1d0 net/netfilter/x_tables.c:380 nfnl_compat_get+0x1f7/0x870 net/netfilter/nft_compat.c:678 nfnetlink_rcv_msg+0x9bb/0xc00 net/netfilter/nfnetlink.c:214 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2461 nfnetlink_rcv+0x1ab/0x1da0 net/netfilter/nfnetlink.c:515 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x651/0xbc0 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062 __sys_sendmsg+0xa3/0x120 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x27/0x40 net/socket.c:2103 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&table[i].mutex); lock(&xt[i].mutex); lock(&table[i].mutex); lock(&xt[i].mutex); *** DEADLOCK *** 1 lock held by syz-executor.0/11988: #0: (&table[i].mutex){+.+.}, at: [] nfnl_lock net/netfilter/nfnetlink.c:61 [inline] #0: (&table[i].mutex){+.+.}, at: [] nfnetlink_rcv_msg+0x726/0xc00 net/netfilter/nfnetlink.c:209 stack backtrace: CPU: 0 PID: 11988 Comm: syz-executor.0 Not tainted 4.14.305-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 match_revfn+0x43/0x210 net/netfilter/x_tables.c:332 xt_find_revision+0x8d/0x1d0 net/netfilter/x_tables.c:380 nfnl_compat_get+0x1f7/0x870 net/netfilter/nft_compat.c:678 nfnetlink_rcv_msg+0x9bb/0xc00 net/netfilter/nfnetlink.c:214 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2461 nfnetlink_rcv+0x1ab/0x1da0 net/netfilter/nfnetlink.c:515 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x651/0xbc0 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062 __sys_sendmsg+0xa3/0x120 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x27/0x40 net/socket.c:2103 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 RIP: 0033:0x7f0c9968e0f9 RSP: 002b:00007f0c97c00168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f0c997adf80 RCX: 00007f0c9968e0f9 RDX: 0000000000000000 RSI: 0000000020000340 RDI: 0000000000000003 RBP: 00007f0c996e9ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdd9ebc9df R14: 00007f0c97c00300 R15: 0000000000022000 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop2): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 512 failed UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) audit: type=1800 audit(1676590168.742:67): pid=12110 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="file0" dev="loop2" ino=852 res=0 audit: type=1804 audit(1676590168.772:68): pid=12110 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir951248555/syzkaller.J1Zxrx/81/file0/bus/file0" dev="loop2" ino=852 res=1 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop4): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop4): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop2): udf_load_vrs: No anchor found UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: error (device loop4): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: Scanning with blocksize 512 failed UDF-fs: Scanning with blocksize 512 failed UDF-fs: warning (device loop4): udf_load_vrs: No anchor found UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) UDF-fs: Scanning with blocksize 512 failed audit: type=1800 audit(1676590169.172:69): pid=12148 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name="file0" dev="loop1" ino=852 res=0 audit: type=1804 audit(1676590169.172:70): pid=12148 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.1" name="/root/syzkaller-testdir4147976468/syzkaller.B0lkc2/98/file0/bus/file0" dev="loop1" ino=852 res=1 UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) audit: type=1800 audit(1676590169.252:71): pid=12162 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="file0" dev="loop2" ino=852 res=0 audit: type=1804 audit(1676590169.252:72): pid=12162 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir951248555/syzkaller.J1Zxrx/82/file0/bus/file0" dev="loop2" ino=852 res=1 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop4): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop2): udf_load_vrs: No anchor found UDF-fs: error (device loop4): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: Scanning with blocksize 512 failed UDF-fs: error (device loop4): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) UDF-fs: warning (device loop4): udf_load_vrs: No anchor found UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 512 failed UDF-fs: Scanning with blocksize 512 failed UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop2): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop4): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop2): udf_load_vrs: No anchor found UDF-fs: error (device loop4): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: Scanning with blocksize 512 failed UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) UDF-fs: error (device loop4): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop4): udf_load_vrs: No anchor found UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: Scanning with blocksize 512 failed UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 512 failed UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000) kauditd_printk_skb: 15 callbacks suppressed audit: type=1326 audit(1676590170.942:88): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=12325 comm="syz-executor.1" exe="/root/syz-executor.1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f5fec1d90f9 code=0x0 audit: type=1326 audit(1676590171.032:89): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=12332 comm="syz-executor.1" exe="/root/syz-executor.1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f5fec1d90f9 code=0x0 audit: type=1326 audit(1676590171.102:90): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=12342 comm="syz-executor.1" exe="/root/syz-executor.1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f5fec1d90f9 code=0x0 Bluetooth: hci5 command 0x0405 tx timeout netlink: 4 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.1'. bridge1: port 1(syz_tun) entered blocking state bridge1: port 1(syz_tun) entered disabled state device syz_tun entered promiscuous mode bridge1: port 1(syz_tun) entered blocking state bridge1: port 1(syz_tun) entered forwarding state netlink: 4 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.1'. device syz_tun left promiscuous mode bridge1: port 1(syz_tun) entered disabled state bridge2: port 1(syz_tun) entered blocking state bridge2: port 1(syz_tun) entered disabled state device syz_tun entered promiscuous mode bridge2: port 1(syz_tun) entered blocking state bridge2: port 1(syz_tun) entered forwarding state netlink: 4 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.1'. device syz_tun left promiscuous mode bridge2: port 1(syz_tun) entered disabled state bridge3: port 1(syz_tun) entered blocking state bridge3: port 1(syz_tun) entered disabled state device syz_tun entered promiscuous mode bridge3: port 1(syz_tun) entered blocking state bridge3: port 1(syz_tun) entered forwarding state netlink: 4 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.1'. device syz_tun left promiscuous mode bridge3: port 1(syz_tun) entered disabled state bridge4: port 1(syz_tun) entered blocking state