ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table netlink: 4 bytes leftover after parsing attributes in process `syz-executor076'. ====================================================== WARNING: possible circular locking dependency detected 4.14.177-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor076/6368 is trying to acquire lock: (&xt[i].mutex){+.+.}, at: [] xt_find_target+0x3d/0x1e0 net/netfilter/x_tables.c:232 but task is already holding lock: (rtnl_mutex){+.+.}, at: [] rtnl_lock net/core/rtnetlink.c:72 [inline] (rtnl_mutex){+.+.}, at: [] rtnetlink_rcv_msg+0x31d/0xb10 net/core/rtnetlink.c:4310 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (rtnl_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 unregister_netdevice_notifier+0x5e/0x2b0 net/core/dev.c:1634 tee_tg_destroy+0x5c/0xb0 net/netfilter/xt_TEE.c:123 cleanup_entry+0x169/0x220 net/ipv4/netfilter/ip_tables.c:666 __do_replace+0x38d/0x570 net/ipv4/netfilter/ip_tables.c:1086 do_replace net/ipv4/netfilter/ip_tables.c:1142 [inline] do_ipt_set_ctl+0x255/0x39d net/ipv4/netfilter/ip_tables.c:1674 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x5f/0xb0 net/netfilter/nf_sockopt.c:115 ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline] ip_setsockopt+0x94/0xb0 net/ipv4/ip_sockglue.c:1240 udp_setsockopt+0x45/0x80 net/ipv4/udp.c:2451 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+0x42/0xb7 -> #0 (&xt[i].mutex){+.+.}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893 xt_find_target+0x3d/0x1e0 net/netfilter/x_tables.c:232 xt_request_find_target net/netfilter/x_tables.c:261 [inline] xt_request_find_target+0x72/0xe0 net/netfilter/x_tables.c:254 ipt_init_target+0xb1/0x240 net/sched/act_ipt.c:45 __tcf_ipt_init+0x455/0xaf0 net/sched/act_ipt.c:168 tcf_xt_init+0x43/0x50 net/sched/act_ipt.c:210 tcf_action_init_1+0x51a/0x9f0 net/sched/act_api.c:682 tcf_action_init+0x26d/0x400 net/sched/act_api.c:751 tcf_action_add net/sched/act_api.c:1079 [inline] tc_ctl_action+0x2e3/0x513 net/sched/act_api.c:1131 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4315 netlink_rcv_skb+0x127/0x370 net/netlink/af_netlink.c:2433 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x437/0x620 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x733/0xbe0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xc5/0x100 net/socket.c:656 sock_no_sendpage+0xe5/0x110 net/core/sock.c:2572 kernel_sendpage+0x82/0xd0 net/socket.c:3407 sock_sendpage+0x84/0xa0 net/socket.c:871 pipe_to_sendpage+0x226/0x2d0 fs/splice.c:451 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x332/0x740 fs/splice.c:626 splice_from_pipe+0xc6/0x120 fs/splice.c:661 do_splice_from fs/splice.c:851 [inline] do_splice fs/splice.c:1147 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0xca0/0x1230 fs/splice.c:1382 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock(&xt[i].mutex); lock(rtnl_mutex); lock(&xt[i].mutex); *** DEADLOCK *** 2 locks held by syz-executor076/6368: #0: (&pipe->mutex/1){+.+.}, at: [] pipe_lock_nested fs/pipe.c:67 [inline] #0: (&pipe->mutex/1){+.+.}, at: [] pipe_lock+0x58/0x70 fs/pipe.c:75 #1: (rtnl_mutex){+.+.}, at: [] rtnl_lock net/core/rtnetlink.c:72 [inline] #1: (rtnl_mutex){+.+.}, at: [] rtnetlink_rcv_msg+0x31d/0xb10 net/core/rtnetlink.c:4310 stack backtrace: CPU: 0 PID: 6368 Comm: syz-executor076 Not tainted 4.14.177-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+0x13e/0x194 lib/dump_stack.c:58 print_circular_bug.isra.0.cold+0x1c4/0x282 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+0x2cb3/0x4620 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+0xe8/0x1470 kernel/locking/mutex.c:893 xt_find_target+0x3d/0x1e0 net/netfilter/x_tables.c:232 xt_request_find_target net/netfilter/x_tables.c:261 [inline] xt_request_find_target+0x72/0xe0 net/netfilter/x_tables.c:254 ipt_init_target+0xb1/0x240 net/sched/act_ipt.c:45 __tcf_ipt_init+0x455/0xaf0 net/sched/act_ipt.c:168 tcf_xt_init+0x43/0x50 net/sched/act_ipt.c:210 tcf_action_init_1+0x51a/0x9f0 net/sched/act_api.c:682 tcf_action_init+0x26d/0x400 net/sched/act_api.c:751 tcf_action_add net/sched/act_api.c:1079 [inline] tc_ctl_action+0x2e3/0x513 net/sched/act_api.c:1131 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4315 netlink_rcv_skb+0x127/0x370 net/netlink/af_netlink.c:2433 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x437/0x620 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x733/0xbe0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xc5/0x100 net/socket.c:656 sock_no_sendpage+0xe5/0x110 net/core/sock.c:2572 kernel_sendpage+0x82/0xd0 net/socket.c:3407 sock_sendpage+0x84/0xa0 net/socket.c:871 pipe_to_sendpage+0x226/0x2d0 fs/splice.c:451 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x332/0x740 fs/splice.c:626 splice_from_pipe+0xc6/0x120 fs/splice.c:661 do_splice_from fs/splice.c:851 [inline] do_splice fs/splice.c:1147 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0xca0/0x1230 fs/splice.c:1382 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x447639 RSP: 002b:00007f5837541d88 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 00000000006dcc68 RCX: 0000000000447639 RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00000000006dcc60 R08: 000000000004ffe0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dcc6c R13: 0000000000000000 R14: 0000000000000000 R15: 6570797472646461