====================================================== WARNING: possible circular locking dependency detected 4.18.0+ #190 Not tainted ------------------------------------------------------ syz-executor7/611 is trying to acquire lock: 000000000908832e (sb_writers#3){.+.+}, at: file_start_write include/linux/fs.h:2752 [inline] 000000000908832e (sb_writers#3){.+.+}, at: vfs_fallocate+0x5be/0x8d0 fs/open.c:318 netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. but task is already holding lock: 000000007606f3e9 (ashmem_mutex){+.+.}, at: ashmem_shrink_scan+0xb4/0x580 drivers/staging/android/ashmem.c:442 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (ashmem_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:757 [inline] __mutex_lock+0x17f/0x18a0 kernel/locking/mutex.c:894 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:909 ashmem_mmap+0x53/0x4a0 drivers/staging/android/ashmem.c:361 call_mmap include/linux/fs.h:1813 [inline] mmap_region+0xe39/0x1b50 mm/mmap.c:1762 do_mmap+0xa06/0x1320 mm/mmap.c:1535 do_mmap_pgoff include/linux/mm.h:2306 [inline] vm_mmap_pgoff+0x213/0x2c0 mm/util.c:357 ksys_mmap_pgoff+0x4da/0x660 mm/mmap.c:1585 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:100 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:91 [inline] __x64_sys_mmap+0xe9/0x1b0 arch/x86/kernel/sys_x86_64.c:91 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #2 (&mm->mmap_sem){++++}: __might_fault+0x155/0x1e0 mm/memory.c:4589 _copy_to_user+0x30/0x110 lib/usercopy.c:25 copy_to_user include/linux/uaccess.h:155 [inline] filldir+0x1ea/0x3a0 fs/readdir.c:196 dir_emit_dot include/linux/fs.h:3417 [inline] dir_emit_dots include/linux/fs.h:3428 [inline] dcache_readdir+0x13a/0x620 fs/libfs.c:192 iterate_dir+0x4b0/0x5d0 fs/readdir.c:51 __do_sys_getdents fs/readdir.c:231 [inline] __se_sys_getdents fs/readdir.c:212 [inline] __x64_sys_getdents+0x29f/0x510 fs/readdir.c:212 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&sb->s_type->i_mutex_key#10){++++}: down_write+0x8f/0x130 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:730 [inline] generic_file_write_iter+0xed/0x870 mm/filemap.c:3289 call_write_iter include/linux/fs.h:1808 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x6af/0x9d0 fs/read_write.c:487 vfs_write+0x1f8/0x560 fs/read_write.c:549 kernel_write+0xab/0x120 fs/read_write.c:526 fork_usermode_blob+0x11c/0x1b0 kernel/umh.c:493 load_umh+0x2b/0xbd net/bpfilter/bpfilter_kern.c:93 do_one_initcall+0x127/0x913 init/main.c:884 do_initcall_level init/main.c:952 [inline] do_initcalls init/main.c:960 [inline] do_basic_setup init/main.c:978 [inline] kernel_init_freeable+0x49b/0x58e init/main.c:1142 kernel_init+0x11/0x1b3 init/main.c:1061 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413 -> #0 (sb_writers#3){.+.+}: lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x1e9/0x300 fs/super.c:1403 file_start_write include/linux/fs.h:2752 [inline] vfs_fallocate+0x5be/0x8d0 fs/open.c:318 ashmem_shrink_scan+0x1f9/0x580 drivers/staging/android/ashmem.c:449 ashmem_ioctl+0x3dd/0x13c0 drivers/staging/android/ashmem.c:791 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:684 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:701 __do_sys_ioctl fs/ioctl.c:708 [inline] __se_sys_ioctl fs/ioctl.c:706 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:706 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Chain exists of: sb_writers#3 --> &mm->mmap_sem --> ashmem_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(ashmem_mutex); lock(&mm->mmap_sem); lock(ashmem_mutex); lock(sb_writers#3); *** DEADLOCK *** 1 lock held by syz-executor7/611: #0: 000000007606f3e9 (ashmem_mutex){+.+.}, at: ashmem_shrink_scan+0xb4/0x580 drivers/staging/android/ashmem.c:442 stack backtrace: CPU: 0 PID: 611 Comm: syz-executor7 Not tainted 4.18.0+ #190 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 print_circular_bug.isra.36.cold.57+0x1bd/0x27d kernel/locking/lockdep.c:1227 check_prev_add kernel/locking/lockdep.c:1867 [inline] check_prevs_add kernel/locking/lockdep.c:1980 [inline] validate_chain kernel/locking/lockdep.c:2421 [inline] __lock_acquire+0x3449/0x5020 kernel/locking/lockdep.c:3435 lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x1e9/0x300 fs/super.c:1403 file_start_write include/linux/fs.h:2752 [inline] vfs_fallocate+0x5be/0x8d0 fs/open.c:318 ashmem_shrink_scan+0x1f9/0x580 drivers/staging/android/ashmem.c:449 ashmem_ioctl+0x3dd/0x13c0 drivers/staging/android/ashmem.c:791 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:684 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:701 __do_sys_ioctl fs/ioctl.c:708 [inline] __se_sys_ioctl fs/ioctl.c:706 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:706 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457089 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fdf6d113c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fdf6d1146d4 RCX: 0000000000457089 RDX: 0000000000000000 RSI: 000000000000770a RDI: 0000000000000004 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000004cd2f0 R14: 00000000004c3dca R15: 0000000000000000 netlink: 20 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. nla_parse: 14 callbacks suppressed netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 0 PID: 1235 Comm: syz-executor7 Not tainted 4.18.0+ #190 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0xa/0x11 lib/fault-inject.c:149 __should_failslab+0x124/0x180 mm/failslab.c:32 should_failslab+0x9/0x14 mm/slab_common.c:1557 slab_pre_alloc_hook mm/slab.h:423 [inline] slab_alloc mm/slab.c:3378 [inline] kmem_cache_alloc_trace+0x2cb/0x780 mm/slab.c:3618 kmalloc include/linux/slab.h:513 [inline] kzalloc include/linux/slab.h:707 [inline] perf_event_alloc.part.92+0x1e2/0x33c0 kernel/events/core.c:9927 perf_event_alloc kernel/events/core.c:10399 [inline] __do_sys_perf_event_open+0xa9c/0x2f30 kernel/events/core.c:10500 __se_sys_perf_event_open kernel/events/core.c:10389 [inline] __x64_sys_perf_event_open+0xbe/0x150 kernel/events/core.c:10389 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457089 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fdf6d113c78 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007fdf6d1146d4 RCX: 0000000000457089 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000140 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000003 R13: 00000000004d3230 R14: 00000000004c8215 R15: 0000000000000000 netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 0 PID: 1284 Comm: syz-executor7 Not tainted 4.18.0+ #190 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0xa/0x11 lib/fault-inject.c:149 __should_failslab+0x124/0x180 mm/failslab.c:32 should_failslab+0x9/0x14 mm/slab_common.c:1557 slab_pre_alloc_hook mm/slab.h:423 [inline] slab_alloc mm/slab.c:3378 [inline] kmem_cache_alloc_trace+0x2cb/0x780 mm/slab.c:3618 kmalloc include/linux/slab.h:513 [inline] allocate_probes kernel/tracepoint.c:65 [inline] func_add kernel/tracepoint.c:120 [inline] tracepoint_add_func kernel/tracepoint.c:208 [inline] tracepoint_probe_register_prio+0x7b9/0xa60 kernel/tracepoint.c:282 tracepoint_probe_register+0x2a/0x40 kernel/tracepoint.c:302 trace_event_reg+0x19a/0x350 kernel/trace/trace_events.c:305 perf_trace_event_reg kernel/trace/trace_event_perf.c:123 [inline] perf_trace_event_init+0x4fe/0x990 kernel/trace/trace_event_perf.c:198 perf_trace_init+0x186/0x250 kernel/trace/trace_event_perf.c:222 perf_tp_event_init+0xa6/0x120 kernel/events/core.c:8345 perf_try_init_event+0x137/0x2f0 kernel/events/core.c:9739 perf_init_event kernel/events/core.c:9777 [inline] perf_event_alloc.part.92+0x12a0/0x33c0 kernel/events/core.c:10043 perf_event_alloc kernel/events/core.c:10399 [inline] __do_sys_perf_event_open+0xa9c/0x2f30 kernel/events/core.c:10500 __se_sys_perf_event_open kernel/events/core.c:10389 [inline] __x64_sys_perf_event_open+0xbe/0x150 kernel/events/core.c:10389 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457089 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fdf6d113c78 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007fdf6d1146d4 RCX: 0000000000457089 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000140 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000003 R13: 00000000004d3230 R14: 00000000004c8215 R15: 0000000000000001 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 1325 Comm: syz-executor7 Not tainted 4.18.0+ #190 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0xa/0x11 lib/fault-inject.c:149 __should_failslab+0x124/0x180 mm/failslab.c:32 should_failslab+0x9/0x14 mm/slab_common.c:1557 slab_pre_alloc_hook mm/slab.h:423 [inline] slab_alloc mm/slab.c:3378 [inline] kmem_cache_alloc+0x2af/0x760 mm/slab.c:3552 __d_alloc+0xc8/0xd50 fs/dcache.c:1613 d_alloc_pseudo+0x1d/0x30 fs/dcache.c:1741 alloc_file_pseudo+0x158/0x3f0 fs/file_table.c:197 anon_inode_getfile+0xd8/0x200 fs/anon_inodes.c:87 __do_sys_perf_event_open+0x177e/0x2f30 kernel/events/core.c:10620 __se_sys_perf_event_open kernel/events/core.c:10389 [inline] __x64_sys_perf_event_open+0xbe/0x150 kernel/events/core.c:10389 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457089 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fdf6d113c78 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007fdf6d1146d4 RCX: 0000000000457089 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000140 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000003 R13: 00000000004d3230 R14: 00000000004c8215 R15: 0000000000000002 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 1351 Comm: syz-executor7 Not tainted 4.18.0+ #190 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0xa/0x11 lib/fault-inject.c:149 __should_failslab+0x124/0x180 mm/failslab.c:32 should_failslab+0x9/0x14 mm/slab_common.c:1557 slab_pre_alloc_hook mm/slab.h:423 [inline] slab_alloc mm/slab.c:3378 [inline] kmem_cache_alloc+0x2af/0x760 mm/slab.c:3552 __d_alloc+0xc8/0xd50 fs/dcache.c:1613 d_alloc_pseudo+0x1d/0x30 fs/dcache.c:1741 alloc_file_pseudo+0x158/0x3f0 fs/file_table.c:197 anon_inode_getfile+0xd8/0x200 fs/anon_inodes.c:87 __do_sys_perf_event_open+0x177e/0x2f30 kernel/events/core.c:10620 netlink: 20 bytes leftover after parsing attributes in process `syz-executor5'. __se_sys_perf_event_open kernel/events/core.c:10389 [inline] __x64_sys_perf_event_open+0xbe/0x150 kernel/events/core.c:10389 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457089 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fdf6d113c78 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007fdf6d1146d4 RCX: 0000000000457089 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000140 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000003 R13: 00000000004d3230 R14: 00000000004c8215 R15: 0000000000000003 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 1425 Comm: syz-executor7 Not tainted 4.18.0+ #190 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0xa/0x11 lib/fault-inject.c:149 __should_failslab+0x124/0x180 mm/failslab.c:32 should_failslab+0x9/0x14 mm/slab_common.c:1557 slab_pre_alloc_hook mm/slab.h:423 [inline] slab_alloc mm/slab.c:3378 [inline] kmem_cache_alloc+0x2af/0x760 mm/slab.c:3552 kmem_cache_zalloc include/linux/slab.h:697 [inline] alloc_empty_file+0x11a/0x580 fs/file_table.c:122 alloc_file+0x5c/0x430 fs/file_table.c:165 alloc_file_pseudo+0x261/0x3f0 fs/file_table.c:204 anon_inode_getfile+0xd8/0x200 fs/anon_inodes.c:87 __do_sys_perf_event_open+0x177e/0x2f30 kernel/events/core.c:10620 __se_sys_perf_event_open kernel/events/core.c:10389 [inline] __x64_sys_perf_event_open+0xbe/0x150 kernel/events/core.c:10389 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457089 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fdf6d113c78 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 00007fdf6d1146d4 RCX: 0000000000457089 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000140 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000003 R13: 00000000004d3230 R14: 00000000004c8215 R15: 0000000000000004