====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc2+ #328 Not tainted audit: type=1400 audit(1519568949.013:64): avc: denied { map } for pid=7997 comm="syz-executor5" path="socket:[22151]" 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=udp_socket permissive=1 ------------------------------------------------------ syz-executor7/8003 is trying to acquire lock: (&mm->mmap_sem){++++}, at: [<00000000567093af>] __might_fault+0xe0/0x1d0 mm/memory.c:4570 but task is already holding lock: (ashmem_mutex){+.+.}, at: [<000000002100e4ed>] ashmem_pin_unpin drivers/staging/android/ashmem.c:705 [inline] (ashmem_mutex){+.+.}, at: [<000000002100e4ed>] ashmem_ioctl+0x3db/0x11b0 drivers/staging/android/ashmem.c:782 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (ashmem_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 ashmem_mmap+0x53/0x410 drivers/staging/android/ashmem.c:362 call_mmap include/linux/fs.h:1786 [inline] mmap_region+0xa99/0x15a0 mm/mmap.c:1705 do_mmap+0x6c0/0xe00 mm/mmap.c:1483 do_mmap_pgoff include/linux/mm.h:2223 [inline] vm_mmap_pgoff+0x1de/0x280 mm/util.c:355 SYSC_mmap_pgoff mm/mmap.c:1533 [inline] SyS_mmap_pgoff+0x462/0x5f0 mm/mmap.c:1491 SYSC_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:91 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #0 (&mm->mmap_sem){++++}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 __might_fault+0x13a/0x1d0 mm/memory.c:4571 _copy_from_user+0x2c/0x110 lib/usercopy.c:10 copy_from_user include/linux/uaccess.h:147 [inline] ashmem_pin_unpin drivers/staging/android/ashmem.c:710 [inline] ashmem_ioctl+0x438/0x11b0 drivers/staging/android/ashmem.c:782 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(ashmem_mutex); lock(&mm->mmap_sem); lock(ashmem_mutex); lock(&mm->mmap_sem); *** DEADLOCK *** 1 lock held by syz-executor7/8003: #0: (ashmem_mutex){+.+.}, at: [<000000002100e4ed>] ashmem_pin_unpin drivers/staging/android/ashmem.c:705 [inline] #0: (ashmem_mutex){+.+.}, at: [<000000002100e4ed>] ashmem_ioctl+0x3db/0x11b0 drivers/staging/android/ashmem.c:782 stack backtrace: CPU: 0 PID: 8003 Comm: syz-executor7 Not tainted 4.16.0-rc2+ #328 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/0x24d 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 __might_fault+0x13a/0x1d0 mm/memory.c:4571 _copy_from_user+0x2c/0x110 lib/usercopy.c:10 copy_from_user include/linux/uaccess.h:147 [inline] ashmem_pin_unpin drivers/staging/android/ashmem.c:710 [inline] ashmem_ioctl+0x438/0x11b0 drivers/staging/android/ashmem.c:782 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453de9 RSP: 002b:00007f45dccb3c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f45dccb46d4 RCX: 0000000000453de9 RDX: 0000000000000000 RSI: 0000000000007709 RDI: 0000000000000013 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 000000000000017a R14: 00000000006f2410 R15: 0000000000000000 audit: type=1400 audit(1519568949.875:65): avc: denied { getopt } for pid=8127 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_netfilter_socket permissive=1 ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x2 x_tables: ip6_tables: TCPOPTSTRIP target: only valid for protocol 6 ip_tunnel: non-ECT from 0.0.0.0 with TOS=0x2 can: request_module (can-proto-0) failed. 9pnet_virtio: no channels available for device ./file0 can: request_module (can-proto-0) failed. audit: type=1400 audit(1519568950.390:66): avc: denied { map } for pid=8318 comm="syz-executor3" path="socket:[23081]" dev="sockfs" ino=23081 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=tcp_socket permissive=1 dccp_close: ABORT with 65423 bytes unread binder: 8529:8540 ioctl 5206 20000000 returned -22 binder: 8529:8540 got reply transaction with no transaction stack binder: 8529:8540 transaction failed 29201/-71, size 0-32 line 2763 binder: BINDER_SET_CONTEXT_MGR already set binder: 8529:8566 ioctl 40046207 0 returned -16 binder: 8529:8574 ioctl 5206 20000000 returned -22 binder: 8529:8540 got reply transaction with no transaction stack binder: 8529:8540 transaction failed 29201/-71, size 0-32 line 2763 binder: undelivered TRANSACTION_ERROR: 29201 binder: undelivered TRANSACTION_ERROR: 29201 netlink: 'syz-executor3': attribute type 1 has an invalid length. TCP: request_sock_TCP: Possible SYN flooding on port 20026. Sending cookies. Check SNMP counters. binder: 8891:8902 BC_FREE_BUFFER uffffffffffffffff no match binder: 8891:8920 BC_FREE_BUFFER uffffffffffffffff no match audit: type=1400 audit(1519568952.844:67): avc: denied { net_broadcast } for pid=9030 comm="syz-executor2" capability=11 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1 xt_hashlimit: max count of 1 reached xt_hashlimit: max count of 1 reached ICMPv6: NA: 00:00:00:00:00:00 advertised our address fe80::aa on syz0! ICMPv6: NA: 00:00:00:00:00:00 advertised our address fe80::aa on syz0! audit: type=1400 audit(1519568953.213:68): avc: denied { relabelto } for pid=9164 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=packet permissive=1 raw_sendmsg: syz-executor7 forgot to set AF_INET. Fix it! binder: 9166:9172 ioctl 40046205 0 returned -22 device eql entered promiscuous mode syz-executor6 (9169) used greatest stack depth: 14624 bytes left binder: 9166:9184 ioctl 40046205 0 returned -22 QAT: Invalid ioctl QAT: Invalid ioctl kauditd_printk_skb: 2 callbacks suppressed audit: type=1400 audit(1519568953.732:71): avc: denied { map } for pid=9325 comm="syz-executor6" path="/dev/snd/pcmC0D0p" dev="devtmpfs" ino=1187 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sound_device_t:s0 tclass=chr_file permissive=1 audit: type=1400 audit(1519568953.925:72): avc: denied { relabelto } for pid=9387 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sulogin_exec_t:s0 tclass=packet permissive=1 audit: type=1400 audit(1519568953.930:73): avc: denied { relabelto } for pid=9387 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:inetd_exec_t:s0 tclass=packet permissive=1 audit: type=1400 audit(1519568953.932:74): avc: denied { send } for pid=9387 comm="syz-executor6" saddr=::1 src=20024 daddr=::1 dest=20024 netif=lo scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:inetd_exec_t:s0 tclass=packet permissive=1 audit: type=1400 audit(1519568953.932:75): avc: denied { recv } for pid=9387 comm="syz-executor6" saddr=::1 src=20024 daddr=::1 dest=20024 netif=lo scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:inetd_exec_t:s0 tclass=packet permissive=1 audit: type=1400 audit(1519568953.941:76): avc: denied { send } for pid=9387 comm="syz-executor6" saddr=::1 src=20024 daddr=::1 dest=43654 netif=lo scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:inetd_exec_t:s0 tclass=packet permissive=1 audit: type=1400 audit(1519568954.117:77): avc: denied { read } for pid=9429 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 binder: 9434:9440 Acquire 1 refcount change on invalid ref 0 ret -22 binder: 9434:9444 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 binder: 9444 RLIMIT_NICE not set binder: 9434:9440 BC_DEAD_BINDER_DONE 0000000000000000 not found binder: 9434:9440 Acquire 1 refcount change on invalid ref 0 ret -22 binder: 9434:9462 BC_REQUEST_DEATH_NOTIFICATION invalid ref 0 binder: 9434:9461 BC_DEAD_BINDER_DONE 0000000000000000 not found binder: 9440 RLIMIT_NICE not set binder: 9569:9575 transaction failed 29201/-28, size 0-0 line 2963 binder: BINDER_SET_CONTEXT_MGR already set binder: 9569:9592 ioctl 40046207 0 returned -16 binder_alloc: 9569: binder_alloc_buf, no vma binder: 9569:9575 transaction failed 29189/-3, size 0-0 line 2963 binder: undelivered TRANSACTION_ERROR: 29189 binder: undelivered TRANSACTION_ERROR: 29201 binder: BINDER_SET_CONTEXT_MGR already set binder: 9655:9674 ioctl 40046207 0 returned -16 binder_alloc: 9655: binder_alloc_buf, no vma binder: 9655:9663 transaction failed 29189/-3, size 0-0 line 2963 binder: undelivered transaction 15, process died. binder: undelivered transaction 18, process died. audit: type=1400 audit(1519568955.104:78): avc: denied { read } for pid=9743 comm="syz-executor6" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_netfilter_socket permissive=1 binder: BINDER_SET_CONTEXT_MGR already set binder_alloc: 9750: binder_alloc_buf, no vma binder: 9750:9758 transaction failed 29189/-3, size 80-16 line 2963 binder: 9750:9764 DecRefs 0 refcount change on invalid ref 2 ret -22 binder: 9750:9754 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 9750:9754 transaction 20 out, still active binder: unexpected work type, 4, not freed binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 20, target dead device eql entered promiscuous mode binder: 9937:9942 ioctl c0306201 20007000 returned -14 ion_mmap: failure mapping buffer to userspace audit: type=1400 audit(1519568955.739:79): avc: denied { net_bind_service } for pid=9931 comm="syz-executor5" capability=10 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1 ion_mmap: failure mapping buffer to userspace binder_alloc: binder_alloc_mmap_handler: 9937 20000000-20002000 already mapped failed -16 binder: BINDER_SET_CONTEXT_MGR already set binder: 9937:9942 ioctl 40046207 0 returned -16 binder_alloc: 9937: binder_alloc_buf, no vma binder: 9937:9952 transaction failed 29189/-3, size 0-0 line 2963 binder: 9937:9952 ioctl c0306201 20007000 returned -14 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 9937:9952 transaction 28 out, still active binder: release 9937:9942 transaction 27 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 27, target dead binder: send failed reply for transaction 28, target dead audit: type=1326 audit(1519568956.112:80): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=10040 comm="syz-executor0" exe="/root/syz-executor0" sig=9 arch=c000003e syscall=202 compat=0 ip=0x453de9 code=0x0 QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl device eql entered promiscuous mode encrypted_key: insufficient parameters specified encrypted_key: insufficient parameters specified x_tables: ip6_tables: TCPOPTSTRIP target: only valid for protocol 6 x_tables: ip6_tables: TCPOPTSTRIP target: only valid for protocol 6 openvswitch: netlink: Flow get message rejected, Key attribute missing. openvswitch: netlink: Flow get message rejected, Key attribute missing. kernel msg: ebtables bug: please report to author: Valid hook without chain kernel msg: ebtables bug: please report to author: Valid hook without chain RDS: rds_bind could not find a transport for 224.0.0.1, load rds_tcp or rds_rdma? RDS: rds_bind could not find a transport for 224.0.0.1, load rds_tcp or rds_rdma? syz-executor7 (10941) used greatest stack depth: 13792 bytes left Can not set IPV6_FL_F_REFLECT if flowlabel_consistency sysctl is enable Can not set IPV6_FL_F_REFLECT if flowlabel_consistency sysctl is enable