====================================================== [ INFO: possible circular locking dependency detected ] 4.9.202+ #0 Not tainted ------------------------------------------------------- syz-executor.2/4448 is trying to acquire lock: (&mm->mmap_sem){++++++}, at: [<00000000ce16e4d8>] __do_page_fault+0x7bd/0xa60 arch/x86/mm/fault.c:1337 but task is already holding lock: (&sb->s_type->i_mutex_key#10){+.+.+.}, at: [<000000000a4334fd>] inode_lock include/linux/fs.h:771 [inline] (&sb->s_type->i_mutex_key#10){+.+.+.}, at: [<000000000a4334fd>] generic_file_write_iter+0x9a/0x630 mm/filemap.c:3090 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&sb->s_type->i_mutex_key#10){+.+.+.}: lock_acquire+0x133/0x3d0 kernel/locking/lockdep.c:3759 down_write+0x41/0xa0 kernel/locking/rwsem.c:52 inode_lock include/linux/fs.h:771 [inline] shmem_fallocate+0x143/0xab0 mm/shmem.c:2683 ashmem_shrink_scan drivers/staging/android/ashmem.c:462 [inline] ashmem_shrink_scan+0x1c3/0x4c0 drivers/staging/android/ashmem.c:446 ashmem_ioctl+0x29b/0xdd0 drivers/staging/android/ashmem.c:804 vfs_ioctl fs/ioctl.c:43 [inline] file_ioctl fs/ioctl.c:493 [inline] do_vfs_ioctl+0xb87/0x11d0 fs/ioctl.c:677 SYSC_ioctl fs/ioctl.c:694 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 entry_SYSCALL_64_after_swapgs+0x5d/0xdb -> #1 (ashmem_mutex){+.+.+.}: lock_acquire+0x133/0x3d0 kernel/locking/lockdep.c:3759 __mutex_lock_common kernel/locking/mutex.c:521 [inline] mutex_lock_nested+0xc7/0x920 kernel/locking/mutex.c:621 ashmem_mmap+0x53/0x470 drivers/staging/android/ashmem.c:378 mmap_region+0x7e7/0xfa0 mm/mmap.c:1726 do_mmap+0x539/0xbc0 mm/mmap.c:1505 do_mmap_pgoff include/linux/mm.h:2066 [inline] vm_mmap_pgoff+0x179/0x1c0 mm/util.c:329 SYSC_mmap_pgoff mm/mmap.c:1555 [inline] SyS_mmap_pgoff+0xfa/0x1b0 mm/mmap.c:1513 SYSC_mmap arch/x86/kernel/sys_x86_64.c:96 [inline] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:87 do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 entry_SYSCALL_64_after_swapgs+0x5d/0xdb -> #0 (&mm->mmap_sem){++++++}: check_prev_add kernel/locking/lockdep.c:1828 [inline] check_prevs_add kernel/locking/lockdep.c:1938 [inline] validate_chain kernel/locking/lockdep.c:2265 [inline] __lock_acquire+0x2d22/0x4390 kernel/locking/lockdep.c:3345 lock_acquire+0x133/0x3d0 kernel/locking/lockdep.c:3759 down_read+0x44/0xb0 kernel/locking/rwsem.c:22 __do_page_fault+0x7bd/0xa60 arch/x86/mm/fault.c:1337 do_page_fault+0x28/0x30 arch/x86/mm/fault.c:1464 page_fault+0x25/0x30 arch/x86/entry/entry_64.S:956 generic_perform_write+0x1b6/0x500 mm/filemap.c:2930 __generic_file_write_iter+0x340/0x530 mm/filemap.c:3065 generic_file_write_iter+0x38a/0x630 mm/filemap.c:3093 new_sync_write fs/read_write.c:498 [inline] __vfs_write+0x3c1/0x560 fs/read_write.c:511 vfs_write+0x185/0x520 fs/read_write.c:559 SYSC_write fs/read_write.c:607 [inline] SyS_write+0x121/0x270 fs/read_write.c:599 do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 entry_SYSCALL_64_after_swapgs+0x5d/0xdb other info that might help us debug this: Chain exists of: &mm->mmap_sem --> ashmem_mutex --> &sb->s_type->i_mutex_key#10 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#10); lock(ashmem_mutex); lock(&sb->s_type->i_mutex_key#10); lock(&mm->mmap_sem); *** DEADLOCK *** 2 locks held by syz-executor.2/4448: #0: (sb_writers#6){.+.+.+}, at: [<000000009c32b07a>] file_start_write include/linux/fs.h:2645 [inline] #0: (sb_writers#6){.+.+.+}, at: [<000000009c32b07a>] vfs_write+0x3e9/0x520 fs/read_write.c:558 #1: (&sb->s_type->i_mutex_key#10){+.+.+.}, at: [<000000000a4334fd>] inode_lock include/linux/fs.h:771 [inline] #1: (&sb->s_type->i_mutex_key#10){+.+.+.}, at: [<000000000a4334fd>] generic_file_write_iter+0x9a/0x630 mm/filemap.c:3090 stack backtrace: CPU: 1 PID: 4448 Comm: syz-executor.2 Not tainted 4.9.202+ #0 ffff8801a62af5d8 ffffffff81b55d2b ffffffff83cae9d0 ffffffff83cb8000 ffffffff83cee6c0 ffffffff8424ff40 ffff8801d676af80 ffff8801a62af630 ffffffff81406d6a dffffc0000000000 ffffffff84092140 ffff8801d676b880 Call Trace: [<00000000e3487003>] __dump_stack lib/dump_stack.c:15 [inline] [<00000000e3487003>] dump_stack+0xcb/0x130 lib/dump_stack.c:56 [<00000000ad9c1ed0>] print_circular_bug.cold+0x2f6/0x454 kernel/locking/lockdep.c:1202 [<0000000015de9bb0>] check_prev_add kernel/locking/lockdep.c:1828 [inline] [<0000000015de9bb0>] check_prevs_add kernel/locking/lockdep.c:1938 [inline] [<0000000015de9bb0>] validate_chain kernel/locking/lockdep.c:2265 [inline] [<0000000015de9bb0>] __lock_acquire+0x2d22/0x4390 kernel/locking/lockdep.c:3345 [<000000009c426d83>] lock_acquire+0x133/0x3d0 kernel/locking/lockdep.c:3759 [<000000004644f435>] down_read+0x44/0xb0 kernel/locking/rwsem.c:22 [<00000000ce16e4d8>] __do_page_fault+0x7bd/0xa60 arch/x86/mm/fault.c:1337 [<000000005d27e80d>] do_page_fault+0x28/0x30 arch/x86/mm/fault.c:1464 [<00000000f46036f3>] page_fault+0x25/0x30 arch/x86/entry/entry_64.S:956 [<000000002b488ec5>] generic_perform_write+0x1b6/0x500 mm/filemap.c:2930 [<00000000ed698c9c>] __generic_file_write_iter+0x340/0x530 mm/filemap.c:3065 [<00000000d430f449>] generic_file_write_iter+0x38a/0x630 mm/filemap.c:3093 [<00000000b2e27e42>] new_sync_write fs/read_write.c:498 [inline] [<00000000b2e27e42>] __vfs_write+0x3c1/0x560 fs/read_write.c:511 [<0000000061c6e313>] vfs_write+0x185/0x520 fs/read_write.c:559 [<000000002171b956>] SYSC_write fs/read_write.c:607 [inline] [<000000002171b956>] SyS_write+0x121/0x270 fs/read_write.c:599 [<000000003e5d52fb>] do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 [<0000000080338f73>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb audit: type=1400 audit(1261.013:1874): avc: denied { prog_load } for pid=4453 comm="syz-executor.1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf permissive=1 audit: type=1400 audit(1261.123:1875): avc: denied { write } for pid=4453 comm="syz-executor.1" name="net" dev="proc" ino=64269 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=dir permissive=1 audit: type=1400 audit(1261.133:1877): avc: denied { create } for pid=4425 comm="syz-executor.3" 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 A link change request failed with some changes committed already. Interface lo may have been left with an inconsistent configuration, please check. A link change request failed with some changes committed already. Interface lo may have been left with an inconsistent configuration, please check. binder: BINDER_SET_CONTEXT_MGR bad uid 0 != 255 binder: 4489:4493 ioctl 40046207 0 returned -1 binder: 4489:4493 Acquire 1 refcount change on invalid ref 0 ret -22 binder: 4489:4493 transaction failed 29189/-22, size 88-24 line 3138 loop0: p1 < > p4 loop0: p1 size 2 extends beyond EOD, truncated loop0: p4 start 1854537728 is beyond EOD, truncated SELinux: duplicate or incompatible mount options binder: undelivered TRANSACTION_ERROR: 29189 loop0: p1 < > p4 loop0: p1 size 2 extends beyond EOD, truncated loop0: p4 start 1854537728 is beyond EOD, truncated audit_printk_skb: 42 callbacks suppressed audit: type=1400 audit(1263.533:1891): avc: denied { create } for pid=4534 comm="syz-executor.1" 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 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: unknown main item tag 0x0 hid-generic 0400:0000:0000.0003: hidraw0: HID v0.00 Device [syz0] on syz1 EXT4-fs (loop3): ext4_check_descriptors: Block bitmap for group 0 not in group (block 2493867833)! EXT4-fs (loop3): group descriptors corrupted! audit: type=1400 audit(1264.253:1892): avc: denied { create } for pid=4534 comm="syz-executor.1" 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(1264.253:1893): avc: denied { write } for pid=4534 comm="syz-executor.1" 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(1265.093:1894): avc: denied { create } for pid=4605 comm="syz-executor.4" 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(1265.093:1895): avc: denied { write } for pid=4605 comm="syz-executor.4" 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(1265.283:1896): avc: denied { read } for pid=4605 comm="syz-executor.4" 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(1265.333:1897): avc: denied { create } for pid=4613 comm="syz-executor.2" 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(1265.493:1898): avc: denied { write } for pid=4613 comm="syz-executor.2" 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(1265.733:1899): avc: denied { read } for pid=4613 comm="syz-executor.2" 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(1265.803:1900): avc: denied { create } for pid=4613 comm="syz-executor.2" 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 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 IPv4: Oversized IP packet from 127.0.0.1 SELinux: unrecognized netlink message: protocol=6 nlmsg_type=571 sclass=netlink_xfrm_socket pig=4703 comm=syz-executor.0 audit_printk_skb: 63 callbacks suppressed audit: type=1400 audit(1268.653:1922): avc: denied { read } for pid=4723 comm="syz-executor.0" 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(1268.993:1923): avc: denied { create } for pid=4746 comm="syz-executor.4" 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(1269.093:1924): avc: denied { write } for pid=4746 comm="syz-executor.4" 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(1269.213:1925): avc: denied { create } for pid=4723 comm="syz-executor.0" 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(1269.213:1926): avc: denied { read } for pid=4746 comm="syz-executor.4" 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(1269.283:1927): avc: denied { create } for pid=4746 comm="syz-executor.4" 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(1269.283:1928): avc: denied { write } for pid=4746 comm="syz-executor.4" 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(1269.373:1929): avc: denied { read } for pid=4746 comm="syz-executor.4" 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(1269.823:1930): avc: denied { map_create } for pid=4773 comm="syz-executor.4" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf permissive=1 audit: type=1400 audit(1269.913:1931): avc: denied { map_create } for pid=4773 comm="syz-executor.4" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=48847 sclass=netlink_route_socket pig=4803 comm=syz-executor.5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=4803 comm=syz-executor.5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=4803 comm=syz-executor.5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=4803 comm=syz-executor.5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=4803 comm=syz-executor.5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=4803 comm=syz-executor.5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=4803 comm=syz-executor.5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=4803 comm=syz-executor.5