syzbot


possible deadlock in ip_set_nfnl_put

Status: upstream: reported C repro on 2020/03/02 00:29
Reported-by: syzbot+ea5c21ae1f10dd6e4d5f@syzkaller.appspotmail.com
First crash: 1570d, last: 485d
Fix bisection attempts (18)
Created Duration User Patch Repo Result
2023/02/19 19:16 36m bisect fix linux-4.14.y job log (0) log
2023/01/20 11:46 26m bisect fix linux-4.14.y job log (0) log
2022/10/27 18:45 30m bisect fix linux-4.14.y job log (0) log
2022/09/20 04:44 27m bisect fix linux-4.14.y job log (0) log
2022/08/21 01:49 25m bisect fix linux-4.14.y job log (0) log
2022/07/22 01:20 28m bisect fix linux-4.14.y job log (0) log
2022/06/22 00:58 21m bisect fix linux-4.14.y job log (0) log
2022/05/23 00:35 23m bisect fix linux-4.14.y job log (0) log
2022/04/23 00:12 22m bisect fix linux-4.14.y job log (0) log
2022/03/23 23:42 29m bisect fix linux-4.14.y job log (0) log
2022/02/08 22:14 25m bisect fix linux-4.14.y job log (0) log
2022/01/09 21:47 27m bisect fix linux-4.14.y job log (0) log
2021/11/15 12:20 23m bisect fix linux-4.14.y job log (0) log
2021/10/16 11:55 24m bisect fix linux-4.14.y job log (0) log
2021/09/16 11:30 25m bisect fix linux-4.14.y job log (0) log
2021/08/17 11:02 27m bisect fix linux-4.14.y job log (0) log
2021/07/18 03:19 28m bisect fix linux-4.14.y job log (0) log
2021/06/18 02:57 21m bisect fix linux-4.14.y job log (0) log

Sample crash report:
Cannot find del_set index 0 as target
ip6_tables: ip6tables: counters copy to user failed while replacing table
======================================================
WARNING: possible circular locking dependency detected
4.14.232-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor911/7987 is trying to acquire lock:
 (&table[i].mutex){+.+.}, at: [<ffffffff85f552aa>] ip_set_nfnl_put+0x11a/0x310 net/netfilter/ipset/ip_set_core.c:732

but task is already holding lock:
 (&xt[i].mutex){+.+.}, at: [<ffffffff85f0ae48>] xt_find_table_lock+0x38/0x3d0 net/netfilter/x_tables.c:1088

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&xt[i].mutex){+.+.}:
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
       target_revfn+0x43/0x210 net/netfilter/x_tables.c:354
       xt_find_revision+0x15e/0x1d0 net/netfilter/x_tables.c:378
       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:2433
       nfnetlink_rcv+0x1ab/0x1da0 net/netfilter/nfnetlink.c:515
       netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
       netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1313
       netlink_sendmsg+0x62e/0xb80 net/netlink/af_netlink.c:1878
       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+0x46/0xbb

-> #0 (&table[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
       ip_set_nfnl_put+0x11a/0x310 net/netfilter/ipset/ip_set_core.c:732
       set_target_v1_destroy+0x100/0x150 net/netfilter/xt_set.c:394
       cleanup_entry+0x232/0x310 net/ipv6/netfilter/ip6_tables.c:684
       __do_replace+0x38d/0x580 net/ipv6/netfilter/ip6_tables.c:1105
       do_replace net/ipv6/netfilter/ip6_tables.c:1161 [inline]
       do_ip6t_set_ctl+0x256/0x3b0 net/ipv6/netfilter/ip6_tables.c:1687
       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:937
       udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1459
       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+0x46/0xbb

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&xt[i].mutex);
                               lock(&table[i].mutex);
                               lock(&xt[i].mutex);
  lock(&table[i].mutex);

 *** DEADLOCK ***

1 lock held by syz-executor911/7987:
 #0:  (&xt[i].mutex){+.+.}, at: [<ffffffff85f0ae48>] xt_find_table_lock+0x38/0x3d0 net/netfilter/x_tables.c:1088

stack backtrace:
CPU: 1 PID: 7987 Comm: syz-executor911 Not tainted 4.14.232-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
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
 ip_set_nfnl_put+0x11a/0x310 net/netfilter/ipset/ip_set_core.c:732
 set_target_v1_destroy+0x100/0x150 net/netfilter/xt_set.c:394
 cleanup_entry+0x232/0x310 net/ipv6/netfilter/ip6_tables.c:684
 __do_replace+0x38d/0x580 net/ipv6/netfilter/ip6_tables.c:1105
 do_replace net/ipv6/netfilter/ip6_tables.c:1161 [inline]
 do_ip6t_set_ctl+0x256/0x3b0 net/ipv6/netfilter/ip6_tables.c:1687
 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:937
 udpv6_setsockopt+0x45/0x80 net/ipv6/udp.c:1459
 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+0x46/0xbb
RIP: 0033:0x440379
RSP: 002b:00007ffde7eaca78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0030657267367069 RCX: 0000000000440379
RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000400 R09: 00007ffde7eacc18
R10: 0000000020000040 R11: 0000000000000246 R12: 00007ffde7eaca8c
R13: 431bde82d7b634db R14: 00000000004ae018 R15: 0000000000400488
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
net_ratelimit: 657 callbacks suppressed
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
net_ratelimit: 759 callbacks suppressed
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table
ip6_tables: ip6tables: counters copy to user failed while replacing table

Crashes (191):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/05/14 18:51 linux-4.14.y 7d7d1c0ab3eb 8bdd5343 .config console log report syz C ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/04/18 16:57 linux-4.14.y cf256fbcbe34 7e2b734b .config console log report syz C ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/04/06 23:35 linux-4.14.y bd634aa64163 6a81331a .config console log report syz C ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/03/17 22:21 linux-4.14.y cb83ddcd5332 fdb2bb2c .config console log report syz C ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2020/03/22 04:06 linux-4.14.y 01364dad1d45 78267cec .config console log report syz C ci2-linux-4-14
2020/03/10 09:49 linux-4.14.y 78d697fc93f9 35f53e45 .config console log report syz C ci2-linux-4-14
2020/07/24 08:16 linux-4.14.y 69b94dd6dcd1 70c104a1 .config console log report syz ci2-linux-4-14
2022/02/21 22:09 linux-4.14.y a35d65bedfbc 6e821dbf .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/12/10 21:47 linux-4.14.y c01d4d1b885d fc17c959 .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/05/19 02:57 linux-4.14.y 7d7d1c0ab3eb a343ba6b .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/05/18 10:50 linux-4.14.y 7d7d1c0ab3eb a343ba6b .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/05/17 01:50 linux-4.14.y 7d7d1c0ab3eb f54a5c09 .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/05/16 04:57 linux-4.14.y 7d7d1c0ab3eb f54a5c09 .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/05/12 22:38 linux-4.14.y 7d7d1c0ab3eb ed7d41c5 .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/05/09 15:36 linux-4.14.y 7d7d1c0ab3eb bc5434be .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/04/10 13:02 linux-4.14.y 958e517f4e16 6a81331a .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/04/07 11:38 linux-4.14.y 0cc244011f40 6a81331a .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/04/06 04:11 linux-4.14.y bd634aa64163 6a81331a .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/04/05 00:05 linux-4.14.y bd634aa64163 6a81331a .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/04/04 02:24 linux-4.14.y bd634aa64163 6a81331a .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/03/30 19:55 linux-4.14.y bd634aa64163 6a81331a .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/03/20 09:39 linux-4.14.y cb83ddcd5332 e45f5621 .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/03/04 04:17 linux-4.14.y 397a88b2cc86 06ed56cd .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/03/02 18:38 linux-4.14.y 3242aa3a635c 92ead296 .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/02/26 14:56 linux-4.14.y 3242aa3a635c 4c37c133 .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/02/24 19:12 linux-4.14.y 3242aa3a635c fcc6d71b .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/02/21 11:42 linux-4.14.y 29c52025152b 3e5ed8b4 .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/01/27 00:04 linux-4.14.y 2d2791fce891 55a7d4df .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/01/21 03:15 linux-4.14.y 2762b48e9611 d4f4eca5 .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/01/17 17:30 linux-4.14.y 2762b48e9611 fd103621 .config console log report info ci2-linux-4-14 possible deadlock in ip_set_nfnl_put
2021/01/15 14:36 linux-4.14.y f79dc86058bc 65a7a854 .config console log report info ci2-linux-4-14
2021/01/08 21:25 linux-4.14.y 1752938529c6 c104d4a3 .config console log report info ci2-linux-4-14
2021/01/07 05:27 linux-4.14.y 1752938529c6 c104d4a3 .config console log report info ci2-linux-4-14
2021/01/02 16:46 linux-4.14.y 1752938529c6 79264ae3 .config console log report info ci2-linux-4-14
2020/12/30 19:31 linux-4.14.y 1752938529c6 ecb8c012 .config console log report info ci2-linux-4-14
2020/12/30 08:03 linux-4.14.y 1752938529c6 0fa352f2 .config console log report info ci2-linux-4-14
2020/12/23 09:28 linux-4.14.y 3f2ecb86cb90 04201c06 .config console log report info ci2-linux-4-14
2020/12/22 23:31 linux-4.14.y 3f2ecb86cb90 04201c06 .config console log report info ci2-linux-4-14
2020/12/22 14:02 linux-4.14.y 3f2ecb86cb90 04201c06 .config console log report info ci2-linux-4-14
2020/12/18 06:07 linux-4.14.y 3f2ecb86cb90 04201c06 .config console log report info ci2-linux-4-14
2020/12/07 18:20 linux-4.14.y c196b3a9c83a f80ce148 .config console log report info ci2-linux-4-14
2020/12/06 06:07 linux-4.14.y c196b3a9c83a 50503117 .config console log report info ci2-linux-4-14
2020/12/05 22:37 linux-4.14.y c196b3a9c83a 50503117 .config console log report info ci2-linux-4-14
2020/12/05 09:41 linux-4.14.y c196b3a9c83a 0ef84591 .config console log report info ci2-linux-4-14
2020/12/03 00:47 linux-4.14.y c196b3a9c83a 8c9190ef .config console log report info ci2-linux-4-14
2020/12/02 09:53 linux-4.14.y c196b3a9c83a c42a35e9 .config console log report info ci2-linux-4-14
2020/11/30 19:25 linux-4.14.y 87335852c5d9 76831598 .config console log report info ci2-linux-4-14
2020/11/27 08:19 linux-4.14.y 87335852c5d9 5018c946 .config console log report info ci2-linux-4-14
2020/11/26 15:17 linux-4.14.y 87335852c5d9 2f1cec62 .config console log report info ci2-linux-4-14
2020/11/21 13:02 linux-4.14.y 8961076ed318 c7ec2d19 .config console log report info ci2-linux-4-14
2020/03/02 00:28 linux-4.14.y 78d697fc93f9 4a4e0509 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.