audit: type=1400 audit(1574529942.425:1843): avc: denied { create } for pid=14982 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 ====================================================== [ INFO: possible circular locking dependency detected ] 4.9.202+ #0 Not tainted ------------------------------------------------------- syz-executor.4/15041 is trying to acquire lock: (&mm->mmap_sem){++++++}, at: [<00000000daecaa07>] __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: [<0000000069573370>] inode_lock include/linux/fs.h:771 [inline] (&sb->s_type->i_mutex_key#10){+.+.+.}, at: [<0000000069573370>] 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: 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 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 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: 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.4/15041: #0: (sb_writers#6){.+.+.+}, at: [<0000000089bab9a9>] file_start_write include/linux/fs.h:2645 [inline] #0: (sb_writers#6){.+.+.+}, at: [<0000000089bab9a9>] vfs_write+0x3e9/0x520 fs/read_write.c:558 #1: (&sb->s_type->i_mutex_key#10){+.+.+.}, at: [<0000000069573370>] inode_lock include/linux/fs.h:771 [inline] #1: (&sb->s_type->i_mutex_key#10){+.+.+.}, at: [<0000000069573370>] generic_file_write_iter+0x9a/0x630 mm/filemap.c:3090 stack backtrace: CPU: 1 PID: 15041 Comm: syz-executor.4 Not tainted 4.9.202+ #0 ffff88018d9575d8 ffffffff81b55d2b ffffffff83caeb80 ffffffff83cb8000 ffffffff83cd2af0 ffffffff8424ff40 ffff8801a6d68000 ffff88018d957630 ffffffff81406d6a dffffc0000000000 ffffffff84033cc0 ffff8801a6d68900 Call Trace: [<00000000b53e964a>] __dump_stack lib/dump_stack.c:15 [inline] [<00000000b53e964a>] dump_stack+0xcb/0x130 lib/dump_stack.c:56 [<00000000ea2c14a2>] print_circular_bug.cold+0x2f6/0x454 kernel/locking/lockdep.c:1202 [<00000000f38e3b97>] check_prev_add kernel/locking/lockdep.c:1828 [inline] [<00000000f38e3b97>] check_prevs_add kernel/locking/lockdep.c:1938 [inline] [<00000000f38e3b97>] validate_chain kernel/locking/lockdep.c:2265 [inline] [<00000000f38e3b97>] __lock_acquire+0x2d22/0x4390 kernel/locking/lockdep.c:3345 [<00000000e6ff23f7>] lock_acquire+0x133/0x3d0 kernel/locking/lockdep.c:3759 [<00000000d55da2ca>] down_read+0x44/0xb0 kernel/locking/rwsem.c:22 [<00000000daecaa07>] __do_page_fault+0x7bd/0xa60 arch/x86/mm/fault.c:1337 [<000000003bf41734>] do_page_fault+0x28/0x30 arch/x86/mm/fault.c:1464 [<00000000771a205c>] page_fault+0x25/0x30 arch/x86/entry/entry_64.S:956 [<000000002e95beeb>] generic_perform_write+0x1b6/0x500 mm/filemap.c:2930 [<00000000ad237fb1>] __generic_file_write_iter+0x340/0x530 mm/filemap.c:3065 [<000000002110ddf3>] generic_file_write_iter+0x38a/0x630 mm/filemap.c:3093 [<00000000db3ad124>] new_sync_write fs/read_write.c:498 [inline] [<00000000db3ad124>] __vfs_write+0x3c1/0x560 fs/read_write.c:511 [<00000000f6c7aa30>] vfs_write+0x185/0x520 fs/read_write.c:559 [<0000000064090ca9>] SYSC_write fs/read_write.c:607 [inline] [<0000000064090ca9>] SyS_write+0x121/0x270 fs/read_write.c:599 [<00000000e5df6470>] do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 [<0000000091e8b7a0>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb netlink: 12 bytes leftover after parsing attributes in process `syz-executor.5'. audit_printk_skb: 54 callbacks suppressed audit: type=1400 audit(1574529944.954:1862): avc: denied { create } for pid=15054 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 netlink: 12 bytes leftover after parsing attributes in process `syz-executor.5'. audit: type=1400 audit(1574529945.172:1863): avc: denied { write } for pid=15054 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 audit: type=1400 audit(1574529945.172:1864): avc: denied { associate } for pid=15067 comm="syz-executor.0" name="cgroup.controllers" scontext=unconfined_u:object_r:unlabeled_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=filesystem permissive=1 F2FS-fs (loop2): Magic Mismatch, valid(0xf2f52010) - read(0x0) F2FS-fs (loop2): Can't find valid F2FS filesystem in 1th superblock attempt to access beyond end of device loop2: rw=48, want=8200, limit=20 IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE IPv6: NLM_F_CREATE should be set when creating new route IPv6: NLM_F_CREATE should be set when creating new route IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE IPv6: NLM_F_CREATE should be set when creating new route audit: type=1400 audit(1574529946.094:1865): avc: denied { create } for pid=15103 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 audit: type=1400 audit(1574529946.094:1866): avc: denied { write } for pid=15103 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 IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE audit: type=1400 audit(1574529946.283:1867): avc: denied { read } for pid=15103 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 attempt to access beyond end of device audit: type=1400 audit(1574529946.759:1868): avc: denied { create } for pid=15134 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(1574529946.759:1869): avc: denied { write } for pid=15134 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 IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE audit: type=1400 audit(1574529946.838:1870): avc: denied { create } for pid=15103 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 audit: type=1400 audit(1574529946.838:1871): avc: denied { write } for pid=15103 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 IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE loop2: rw=48, want=12296, limit=20 F2FS-fs (loop2): Failed to get valid F2FS checkpoint F2FS-fs (loop2): Magic Mismatch, valid(0xf2f52010) - read(0x0) F2FS-fs (loop2): Can't find valid F2FS filesystem in 1th superblock attempt to access beyond end of device loop2: rw=48, want=8200, limit=20 attempt to access beyond end of device loop2: rw=48, want=12296, limit=20 F2FS-fs (loop2): Failed to get valid F2FS checkpoint audit_printk_skb: 48 callbacks suppressed audit: type=1400 audit(1574529950.369:1888): avc: denied { set_context_mgr } for pid=15210 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=binder permissive=1 audit: type=1400 audit(1574529950.388:1889): avc: denied { create } for pid=15213 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 audit: type=1400 audit(1574529950.398:1890): avc: denied { write } for pid=15213 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 audit: type=1400 audit(1574529950.448:1891): avc: denied { create } for pid=15212 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(1574529950.468:1892): avc: denied { write } for pid=15212 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(1574529950.517:1893): avc: denied { read } for pid=15213 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 audit: type=1400 audit(1574529950.577:1894): avc: denied { read } for pid=15212 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(1574529950.835:1895): avc: denied { create } for pid=15233 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(1574529950.845:1896): avc: denied { write } for pid=15233 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(1574529950.964:1897): avc: denied { read } for pid=15233 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 F2FS-fs (loop2): Magic Mismatch, valid(0xf2f52010) - read(0x0) F2FS-fs (loop2): Can't find valid F2FS filesystem in 1th superblock attempt to access beyond end of device loop2: rw=48, want=8200, limit=20 attempt to access beyond end of device loop2: rw=48, want=12296, limit=20 F2FS-fs (loop2): Failed to get valid F2FS checkpoint F2FS-fs (loop2): Magic Mismatch, valid(0xf2f52010) - read(0x0) F2FS-fs (loop2): Can't find valid F2FS filesystem in 1th superblock attempt to access beyond end of device loop2: rw=48, want=8200, limit=20 attempt to access beyond end of device loop2: rw=48, want=12296, limit=20 F2FS-fs (loop2): Failed to get valid F2FS checkpoint