====================================================== WARNING: possible circular locking dependency detected 4.16.0-rc5+ #352 Not tainted ------------------------------------------------------ syz-executor1/16540 is trying to acquire lock: (&sb->s_type->i_mutex_key#11){++++}, at: [<000000000be18c8e>] inode_lock include/linux/fs.h:713 [inline] (&sb->s_type->i_mutex_key#11){++++}, at: [<000000000be18c8e>] shmem_file_llseek+0xef/0x240 mm/shmem.c:2579 but task is already holding lock: (ashmem_mutex){+.+.}, at: [<00000000c84fc41d>] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:326 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (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+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #1 (&mm->mmap_sem){++++}: __might_fault+0x13a/0x1d0 mm/memory.c:4571 _copy_to_user+0x2c/0xc0 lib/usercopy.c:25 copy_to_user include/linux/uaccess.h:155 [inline] filldir+0x1a7/0x320 fs/readdir.c:196 dir_emit_dot include/linux/fs.h:3370 [inline] dir_emit_dots include/linux/fs.h:3381 [inline] dcache_readdir+0x12d/0x5e0 fs/libfs.c:192 iterate_dir+0x1ca/0x530 fs/readdir.c:51 SYSC_getdents fs/readdir.c:231 [inline] SyS_getdents+0x225/0x450 fs/readdir.c:212 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 -> #0 (&sb->s_type->i_mutex_key#11){++++}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:3920 down_write+0x87/0x120 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:713 [inline] shmem_file_llseek+0xef/0x240 mm/shmem.c:2579 vfs_llseek+0xa2/0xd0 fs/read_write.c:300 ashmem_llseek+0xe7/0x1f0 drivers/staging/android/ashmem.c:338 vfs_llseek fs/read_write.c:300 [inline] SYSC_lseek fs/read_write.c:313 [inline] SyS_lseek+0xeb/0x170 fs/read_write.c:304 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#11 --> &mm->mmap_sem --> ashmem_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(ashmem_mutex); lock(&mm->mmap_sem); lock(ashmem_mutex); lock(&sb->s_type->i_mutex_key#11); *** DEADLOCK *** 1 lock held by syz-executor1/16540: #0: (ashmem_mutex){+.+.}, at: [<00000000c84fc41d>] ashmem_llseek+0x56/0x1f0 drivers/staging/android/ashmem.c:326 stack backtrace: CPU: 0 PID: 16540 Comm: syz-executor1 Not tainted 4.16.0-rc5+ #352 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 down_write+0x87/0x120 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:713 [inline] shmem_file_llseek+0xef/0x240 mm/shmem.c:2579 vfs_llseek+0xa2/0xd0 fs/read_write.c:300 ashmem_llseek+0xe7/0x1f0 drivers/staging/android/ashmem.c:338 vfs_llseek fs/read_write.c:300 [inline] SYSC_lseek fs/read_write.c:313 [inline] SyS_lseek+0xeb/0x170 fs/read_write.c:304 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453e69 RSP: 002b:00007fdb744efc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000008 RAX: ffffffffffffffda RBX: 00007fdb744f06d4 RCX: 0000000000453e69 RDX: 0000000000000004 RSI: ffffffffffffffff RDI: 0000000000000014 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000003da R14: 00000000006f5d10 R15: 0000000000000000 audit: type=1400 audit(1521036916.073:131): avc: denied { bind } for pid=16546 comm="syz-executor0" 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 kernel msg: ebtables bug: please report to author: Valid hook without chain kernel msg: ebtables bug: please report to author: Valid hook without chain audit: type=1400 audit(1521036916.162:132): avc: denied { map } for pid=16559 comm="syz-executor2" path="/sys/kernel/debug/kcov" dev="debugfs" ino=164 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:debugfs_t:s0 tclass=file permissive=1 netlink: 'syz-executor4': attribute type 33 has an invalid length. QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl TCP: request_sock_TCP: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. IPVS: ftp: loaded support on port[0] = 21 capability: warning: `syz-executor7' uses deprecated v2 capabilities in a way that may be insecure audit: type=1400 audit(1521036917.359:133): avc: denied { read } for pid=16887 comm="syz-executor2" path="socket:[52816]" dev="sockfs" ino=52816 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_crypto_socket permissive=1 binder: 16898:16901 ioctl c0306201 20007fd0 returned -14 binder: BINDER_SET_CONTEXT_MGR already set binder: 16898:16903 ioctl 40046207 0 returned -16 binder: 16898:16901 ioctl c0306201 20007fd0 returned -14 kernel msg: ebtables bug: please report to author: EBT_ENTRY_OR_ENTRIES shouldn't be set in distinguisher MPI: mpi too large (16392 bits) netlink: 8 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor7'. TCP: request_sock_TCP: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. audit: type=1400 audit(1521036918.632:134): avc: denied { setattr } for pid=17085 comm="syz-executor5" name="NETLINK" dev="sockfs" ino=53038 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 syz-executor1 (17073) used greatest stack depth: 14224 bytes left audit: type=1400 audit(1521036918.960:135): avc: denied { read } for pid=17208 comm="syz-executor3" dev="sockfs" ino=53245 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 kernel msg: ebtables bug: please report to author: nentries does not equal the nr of entries in the (last) chain syz-executor5 (17413) used greatest stack depth: 13520 bytes left sg_write: data in/out 1048540/8 bytes for SCSI command 0x0-- guessing data in; program syz-executor2 not setting count and/or reply_len properly mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium binder: 17456:17459 ioctl c018620b 20000040 returned -14 QAT: Invalid ioctl binder: BINDER_SET_CONTEXT_MGR already set binder_alloc: 17456: binder_alloc_buf, no vma binder: 17456:17459 ioctl 40046207 0 returned -16 binder: 17456:17468 transaction failed 29189/-3, size 0-0 line 2963 QAT: Invalid ioctl binder: 17456:17472 ioctl c018620b 20000040 returned -14 kernel msg: ebtables bug: please report to author: Wrong len argument audit: type=1400 audit(1521036920.686:136): avc: denied { write } for pid=17471 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_crypto_socket permissive=1 binder: undelivered TRANSACTION_ERROR: 29189 binder: release 17456:17459 transaction 54 out, still active binder: undelivered TRANSACTION_COMPLETE binder: send failed reply for transaction 54, target dead kernel msg: ebtables bug: please report to author: Wrong len argument netlink: 3584 bytes leftover after parsing attributes in process `syz-executor1'. netlink: 3584 bytes leftover after parsing attributes in process `syz-executor1'. binder_alloc: binder_alloc_mmap_handler: 17612 20000000-20002000 already mapped failed -16 syz-executor5: vmalloc: allocation failure: 17045651456 bytes, mode:0x14080c0(GFP_KERNEL|__GFP_ZERO), nodemask=(null) syz-executor5 cpuset=/ mems_allowed=0 CPU: 1 PID: 17642 Comm: syz-executor5 Not tainted 4.16.0-rc5+ #352 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 warn_alloc+0x19a/0x2b0 mm/page_alloc.c:3310 __vmalloc_node_range+0x4f0/0x650 mm/vmalloc.c:1775 __vmalloc_node mm/vmalloc.c:1804 [inline] __vmalloc_node_flags_caller+0x50/0x60 mm/vmalloc.c:1826 kvmalloc_node+0x82/0xd0 mm/util.c:428 kvmalloc include/linux/mm.h:541 [inline] kvmalloc_array include/linux/mm.h:557 [inline] xt_alloc_entry_offsets+0x21/0x30 net/netfilter/x_tables.c:778 translate_table+0x235/0x1690 net/ipv6/netfilter/ip6_tables.c:703 do_replace net/ipv6/netfilter/ip6_tables.c:1164 [inline] do_ip6t_set_ctl+0x370/0x5f0 net/ipv6/netfilter/ip6_tables.c:1690 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x67/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x10b/0x130 net/ipv6/ipv6_sockglue.c:927 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+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453e69 RSP: 002b:00007f29a7c32c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f29a7c336d4 RCX: 0000000000453e69 RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000013 RBP: 000000000072bea0 R08: 0000000000000004 R09: 0000000000000000 R10: 0000000020001fde R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000520 R14: 00000000006f7ba0 R15: 0000000000000000 warn_alloc_show_mem: 1 callbacks suppressed Mem-Info: active_anon:106036 inactive_anon:60 isolated_anon:0 active_file:3621 inactive_file:8677 isolated_file:0 unevictable:0 dirty:79 writeback:0 unstable:0 slab_reclaimable:10292 slab_unreclaimable:92297 mapped:24324 shmem:67 pagetables:803 bounce:0 free:1380344 free_pcp:380 free_cma:0 Node 0 active_anon:424144kB inactive_anon:240kB active_file:14484kB inactive_file:34708kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:97296kB dirty:316kB writeback:0kB shmem:268kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 180224kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no Node 0 DMA free:15908kB min:164kB low:204kB high:244kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:15992kB managed:15908kB mlocked:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB lowmem_reserve[]: 0 2864 6373 6373 Node 0 DMA32 free:2934568kB min:30292kB low:37864kB high:45436kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:3129292kB managed:2935316kB mlocked:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:740kB local_pcp:68kB free_cma:0kB lowmem_reserve[]: 0 0 3509 3509 Node 0 Normal free:2566816kB min:37120kB low:46400kB high:55680kB active_anon:428216kB inactive_anon:240kB active_file:14484kB inactive_file:34708kB unevictable:0kB writepending:316kB present:4718592kB managed:3593744kB mlocked:0kB kernel_stack:5056kB pagetables:3212kB bounce:0kB free_pcp:712kB local_pcp:96kB free_cma:0kB lowmem_reserve[]: 0 0 0 0 Node 0 DMA: 1*4kB (U) 0*8kB 0*16kB 1*32kB (U) 2*64kB (U) 1*128kB (U) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB (M) = 15908kB Node 0 DMA32: 6*4kB (UM) 6*8kB (UM) 4*16kB (UM) 5*32kB (UM) 0*64kB 2*128kB (M) 3*256kB (UM) 3*512kB (UM) 3*1024kB (UM) 2*2048kB (UM) 714*4096kB (M) = 2934568kB Node 0 Normal: 547*4kB (UME) 429*8kB (UME) 1261*16kB (UME) 915*32kB (UM) 348*64kB (UME) 74*128kB (UME) 22*256kB (UM) 9*512kB (UM) 10*1024kB (UME) 8*2048kB (UME) 599*4096kB (M) = 2577188kB Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB 12364 total pagecache pages 0 pages in swap cache Swap cache stats: add 0, delete 0, find 0/0 Free swap = 0kB Total swap = 0kB 1965969 pages RAM 0 pages HighMem/MovableOnly 329727 pages reserved kernel msg: ebtables bug: please report to author: bad policy audit: type=1400 audit(1521036922.612:137): avc: denied { map } for pid=17862 comm="syz-executor2" path="pipe:[56171]" dev="pipefs" ino=56171 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 kernel msg: ebtables bug: please report to author: bad policy netlink: 8 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor0'. kernel msg: ebtables bug: please report to author: bad policy kernel msg: ebtables bug: please report to author: bad policy kernel msg: ebtables bug: please report to author: bad policy kernel msg: ebtables bug: please report to author: Wrong len argument QAT: Invalid ioctl QAT: Invalid ioctl audit: type=1400 audit(1521036924.021:138): avc: denied { net_bind_service } for pid=18301 comm="syz-executor2" 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 binder: 18434:18442 got transaction with invalid handle, 0 binder: 18434:18442 transaction failed 29201/-22, size 56-8 line 3055 sctp: [Deprecated]: syz-executor2 (pid 18460) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead binder_alloc: binder_alloc_mmap_handler: 18434 20000000-20002000 already mapped failed -16 sctp: [Deprecated]: syz-executor2 (pid 18460) Use of int in maxseg socket option. Use struct sctp_assoc_value instead binder: BINDER_SET_CONTEXT_MGR already set binder: 18434:18463 ioctl 40046207 0 returned -16 binder: undelivered TRANSACTION_ERROR: 29201 x_tables: eb_tables: arpreply.0 target: invalid size 16 (kernel) != (user) 15 kernel msg: ebtables bug: please report to author: entry offsets not in right order x_tables: eb_tables: arpreply.0 target: invalid size 16 (kernel) != (user) 15 kernel msg: ebtables bug: please report to author: entry offsets not in right order