====================================================== WARNING: possible circular locking dependency detected 4.15.0+ #297 Not tainted ------------------------------------------------------ syz-executor0/7417 is trying to acquire lock: (sk_lock-AF_INET){+.+.}, at: [<00000000e25d400f>] lock_sock include/net/sock.h:1463 [inline] (sk_lock-AF_INET){+.+.}, at: [<00000000e25d400f>] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 but task is already holding lock: (rtnl_mutex){+.+.}, at: [<000000007a101a08>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (rtnl_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 unregister_netdevice_notifier+0x91/0x4e0 net/core/dev.c:1673 tee_tg_destroy+0x61/0xc0 net/netfilter/xt_TEE.c:123 cleanup_entry+0x218/0x350 net/ipv4/netfilter/ip_tables.c:654 __do_replace+0x79d/0xa50 net/ipv4/netfilter/ip_tables.c:1089 do_replace net/ipv4/netfilter/ip_tables.c:1145 [inline] do_ipt_set_ctl+0x40f/0x5f0 net/ipv4/netfilter/ip_tables.c:1675 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ip_setsockopt+0x97/0xa0 net/ipv4/ip_sockglue.c:1259 tcp_setsockopt+0x82/0xd0 net/ipv4/tcp.c:2905 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2975 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 do_syscall_64+0x282/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x26/0x9b -> #1 (&xt[i].mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 xt_find_table_lock+0x3e/0x3e0 net/netfilter/x_tables.c:1041 xt_request_find_table_lock+0x28/0xc0 net/netfilter/x_tables.c:1088 get_info+0x154/0x690 net/ipv6/netfilter/ip6_tables.c:989 do_ipt_get_ctl+0x159/0xac0 net/ipv4/netfilter/ip_tables.c:1699 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x6a/0xc0 net/netfilter/nf_sockopt.c:122 ip_getsockopt+0x15c/0x220 net/ipv4/ip_sockglue.c:1571 tcp_getsockopt+0x82/0xd0 net/ipv4/tcp.c:3359 sock_common_getsockopt+0x95/0xd0 net/core/sock.c:2934 SYSC_getsockopt net/socket.c:1880 [inline] SyS_getsockopt+0x178/0x340 net/socket.c:1862 do_syscall_64+0x282/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x26/0x9b -> #0 (sk_lock-AF_INET){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 lock_sock_nested+0xc2/0x110 net/core/sock.c:2777 lock_sock include/net/sock.h:1463 [inline] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 ip_setsockopt+0x3a/0xa0 net/ipv4/ip_sockglue.c:1252 udp_setsockopt+0x45/0x80 net/ipv4/udp.c:2401 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2975 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 do_syscall_64+0x282/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x26/0x9b other info that might help us debug this: Chain exists of: sk_lock-AF_INET --> &xt[i].mutex --> rtnl_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock(&xt[i].mutex); lock(rtnl_mutex); lock(sk_lock-AF_INET); *** DEADLOCK *** 1 lock held by syz-executor0/7417: #0: (rtnl_mutex){+.+.}, at: [<000000007a101a08>] rtnl_lock+0x17/0x20 net/core/rtnetlink.c:74 stack backtrace: CPU: 0 PID: 7417 Comm: syz-executor0 Not tainted 4.15.0+ #297 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+0x194/0x257 lib/dump_stack.c:53 print_circular_bug.isra.38+0x2cd/0x2dc kernel/locking/lockdep.c:1223 check_prev_add kernel/locking/lockdep.c:1863 [inline] check_prevs_add kernel/locking/lockdep.c:1976 [inline] validate_chain kernel/locking/lockdep.c:2417 [inline] __lock_acquire+0x30a8/0x3e00 kernel/locking/lockdep.c:3431 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 lock_sock_nested+0xc2/0x110 net/core/sock.c:2777 lock_sock include/net/sock.h:1463 [inline] do_ip_setsockopt.isra.12+0x1d9/0x3210 net/ipv4/ip_sockglue.c:646 ip_setsockopt+0x3a/0xa0 net/ipv4/ip_sockglue.c:1252 udp_setsockopt+0x45/0x80 net/ipv4/udp.c:2401 sock_common_setsockopt+0x95/0xd0 net/core/sock.c:2975 SYSC_setsockopt net/socket.c:1849 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1828 do_syscall_64+0x282/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x26/0x9b RIP: 0033:0x453299 RSP: 002b:00007f1d559e0c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453299 RDX: 000000000000002a RSI: 0000000000000000 RDI: 0000000000000013 RBP: 0000000000000517 R08: 0000000000000090 R09: 0000000000000000 R10: 0000000020008000 R11: 0000000000000212 R12: 00000000006f6ac8 R13: 00000000ffffffff R14: 00007f1d559e16d4 R15: 0000000000000000 kauditd_printk_skb: 27 callbacks suppressed audit: type=1400 audit(1517826359.122:148): avc: denied { accept } for pid=7441 comm="syz-executor5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1517826359.156:149): avc: denied { getopt } for pid=7441 comm="syz-executor5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 device gre0 entered promiscuous mode binder: 7488:7490 BC_CLEAR_DEATH_NOTIFICATION death notification cookie mismatch 0000000000000000 != 0000000000000003 binder: 7488:7496 ERROR: BC_REGISTER_LOOPER called without request binder: 7496 RLIMIT_NICE not set binder: BINDER_SET_CONTEXT_MGR already set binder: 7488:7496 ioctl 40046207 0 returned -16 binder: 7488:7534 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 binder: 7488:7490 BC_CLEAR_DEATH_NOTIFICATION invalid ref 0 audit: type=1400 audit(1517826360.065:150): avc: denied { map } for pid=7721 comm="syz-executor3" path="/dev/sg0" dev="devtmpfs" ino=1066 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:scsi_generic_device_t:s0 tclass=chr_file permissive=1 device eql entered promiscuous mode audit: type=1400 audit(1517826360.169:151): avc: denied { create } for pid=7749 comm="syz-executor4" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_connector_socket permissive=1 audit: type=1400 audit(1517826360.197:152): avc: denied { setopt } for pid=7749 comm="syz-executor4" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_connector_socket permissive=1 ieee80211 phy2: Selected rate control algorithm 'minstrel_ht' audit: type=1400 audit(1517826360.345:153): avc: denied { getattr } for pid=7754 comm="syz-executor2" name="NETLINK" dev="sockfs" ino=22151 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 ieee80211 phy3: Selected rate control algorithm 'minstrel_ht' sctp: [Deprecated]: syz-executor7 (pid 7770) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead capability: warning: `syz-executor0' uses deprecated v2 capabilities in a way that may be insecure sctp: [Deprecated]: syz-executor7 (pid 7770) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead ip6t_REJECT: ECHOREPLY is not supported. ip6t_REJECT: ECHOREPLY is not supported. mmap: syz-executor4 (7883): VmData 17289216 exceed data ulimit 0. Update limits or use boot option ignore_rlimit_data. audit: type=1400 audit(1517826360.919:154): avc: denied { read } for pid=7877 comm="syz-executor3" path="socket:[23058]" dev="sockfs" ino=23058 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1517826360.959:155): avc: denied { setopt } for pid=7877 comm="syz-executor3" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1326 audit(1517826361.476:156): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=8044 comm="syz-executor6" exe="/root/syz-executor6" sig=0 arch=c000003e syscall=202 compat=0 ip=0x453299 code=0x7ffc0000 audit: type=1326 audit(1517826361.501:157): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=8044 comm="syz-executor6" exe="/root/syz-executor6" sig=0 arch=c000003e syscall=123 compat=0 ip=0x453299 code=0x7ffc0000 binder_alloc: binder_alloc_mmap_handler: 8083 20000000-20002000 already mapped failed -16 device eql entered promiscuous mode binder: BINDER_SET_CONTEXT_MGR already set binder: 8083:8099 ioctl 40046207 0 returned -16 binder: release 8083:8089 transaction 12 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 12, target dead Cannot find add_set index 0 as target binder: BINDER_SET_CONTEXT_MGR already set binder: 8183:8189 ioctl 40046207 0 returned -16 sctp: [Deprecated]: syz-executor3 (pid 8409) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sctp: [Deprecated]: syz-executor3 (pid 8409) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sock: sock_set_timeout: `syz-executor0' (pid 8428) tries to set negative timeout binder: 8427:8429 ioctl 8953 20002fbc returned -22 binder: 8427:8429 ioctl 80084504 20006000 returned -22 sock: sock_set_timeout: `syz-executor0' (pid 8428) tries to set negative timeout Protocol error: SET target dimension is over the limit! Protocol error: SET target dimension is over the limit! device eql entered promiscuous mode kvm [8757]: vcpu0, guest rIP: 0xfff0 disabled perfctr wrmsr: 0x186 data 0x9 kvm [8757]: vcpu0, guest rIP: 0xfff0 disabled perfctr wrmsr: 0x186 data 0x9 binder: 8913:8917 ERROR: BC_REGISTER_LOOPER called without request binder: 8913:8917 Acquire 1 refcount change on invalid ref 0 ret -22 binder: 8913:8930 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 device eql entered promiscuous mode binder: 9048:9053 ioctl 40045542 20019ffc returned -22 binder: 9048:9053 BC_REQUEST_DEATH_NOTIFICATION death notification already set kauditd_printk_skb: 56 callbacks suppressed audit: type=1400 audit(1517826365.071:214): avc: denied { dyntransition } for pid=9052 comm="syz-executor3" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=process permissive=1 binder: 9048:9053 ioctl 40045542 20019ffc returned -22 binder: 9048:9069 BC_REQUEST_DEATH_NOTIFICATION death notification already set audit: type=1400 audit(1517826365.337:215): avc: denied { map } for pid=9084 comm="syz-executor6" path="pipe:[25744]" dev="pipefs" ino=25744 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=fifo_file permissive=1 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 CPU: 1 PID: 9409 Comm: syz-executor7 Not tainted 4.15.0+ #297 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+0x194/0x257 lib/dump_stack.c:53 fail_dump lib/fault-inject.c:51 [inline] should_fail+0x8c0/0xa40 lib/fault-inject.c:149 should_failslab+0xec/0x120 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:422 [inline] slab_alloc mm/slab.c:3365 [inline] kmem_cache_alloc+0x47/0x760 mm/slab.c:3539 fcntl_dirnotify+0x170/0xc10 fs/notify/dnotify/dnotify.c:291 do_fcntl+0x5a4/0x1150 fs/fcntl.c:413 SYSC_fcntl fs/fcntl.c:463 [inline] SyS_fcntl+0xd6/0x110 fs/fcntl.c:448 do_syscall_64+0x282/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x26/0x9b RIP: 0033:0x453299 RSP: 002b:00007f1e75889c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000048 RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453299 RDX: ffffffffffffffff RSI: 0000800000000402 RDI: 0000000000000014 RBP: 000000000000008a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006efd90 R13: 0000000000000015 R14: 00007f1e7588a6d4 R15: ffffffffffffffff audit: type=1400 audit(1517826368.137:216): avc: denied { map } for pid=9871 comm="syz-executor7" path="/180/file0" dev="tmpfs" ino=27750 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:tmpfs_t:s0 tclass=dir permissive=1 binder: BINDER_SET_CONTEXT_MGR already set binder: 9893:9902 ioctl 40046207 0 returned -16