================================= [ INFO: inconsistent lock state ] 4.9.141+ #23 Not tainted --------------------------------- inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage. kswapd0/33 [HC0[0]:SC0[0]:HE1:SE1] takes: (&sb->s_type->i_mutex_key#10){+.+.?.}, at: [] inode_lock include/linux/fs.h:766 [inline] (&sb->s_type->i_mutex_key#10){+.+.?.}, at: [] shmem_fallocate+0x13c/0xb10 mm/shmem.c:2676 mark_held_locks+0xc7/0x130 kernel/locking/lockdep.c:2660 __lockdep_trace_alloc kernel/locking/lockdep.c:2882 [inline] lockdep_trace_alloc+0x18e/0x2a0 kernel/locking/lockdep.c:2897 __alloc_pages_nodemask+0x14a/0x1bd0 mm/page_alloc.c:3804 __alloc_pages include/linux/gfp.h:433 [inline] __alloc_pages_node include/linux/gfp.h:446 [inline] alloc_pages_node include/linux/gfp.h:460 [inline] shmem_alloc_page mm/shmem.c:1420 [inline] shmem_alloc_and_acct_page mm/shmem.c:1450 [inline] shmem_getpage_gfp+0xc7c/0x18f0 mm/shmem.c:1724 shmem_getpage mm/shmem.c:123 [inline] shmem_write_begin+0xf4/0x1a0 mm/shmem.c:2205 generic_perform_write+0x28a/0x500 mm/filemap.c:2753 __generic_file_write_iter+0x352/0x540 mm/filemap.c:2878 generic_file_write_iter+0x37a/0x620 mm/filemap.c:2906 new_sync_write fs/read_write.c:496 [inline] __vfs_write+0x3d7/0x580 fs/read_write.c:509 vfs_write+0x187/0x520 fs/read_write.c:557 SYSC_write fs/read_write.c:604 [inline] SyS_write+0xd9/0x1c0 fs/read_write.c:596 do_syscall_64+0x19f/0x550 arch/x86/entry/common.c:285 entry_SYSCALL_64_after_swapgs+0x5d/0xdb irq event stamp: 881325 hardirqs last enabled at (881325): [] __mutex_trylock_slowpath kernel/locking/mutex.c:885 [inline] hardirqs last enabled at (881325): [] mutex_trylock+0x258/0x3e0 kernel/locking/mutex.c:908 hardirqs last disabled at (881324): [] __mutex_trylock_slowpath kernel/locking/mutex.c:873 [inline] hardirqs last disabled at (881324): [] mutex_trylock+0xaf/0x3e0 kernel/locking/mutex.c:908 softirqs last enabled at (875270): [] __do_softirq+0x46d/0x964 kernel/softirq.c:314 softirqs last disabled at (875263): [] invoke_softirq kernel/softirq.c:368 [inline] softirqs last disabled at (875263): [] irq_exit+0x11c/0x150 kernel/softirq.c:409 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&sb->s_type->i_mutex_key#10); lock(&sb->s_type->i_mutex_key#10); *** DEADLOCK *** 2 locks held by kswapd0/33: #0: (shrinker_rwsem){++++..}, at: [] shrink_slab.part.8+0xb2/0xa00 mm/vmscan.c:471 #1: (ashmem_mutex){+.+.+.}, at: [] ashmem_shrink_scan+0x55/0x4c0 drivers/staging/android/ashmem.c:455 stack backtrace: CPU: 1 PID: 33 Comm: kswapd0 Not tainted 4.9.141+ #23 ffff8801d842f380 ffffffff81b42e79 ffff8801d8420000 ffffffff83cacb10 ffff8801d8420900 ffff8801d8420920 ffffffff84244d40 ffff8801d842f3f8 ffffffff81400780 0000000000000000 ffffffff00000001 0000000000000001 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_usage_bug.cold.40+0x44e/0x57e kernel/locking/lockdep.c:2387 [] valid_state kernel/locking/lockdep.c:2400 [inline] [] mark_lock_irq kernel/locking/lockdep.c:2602 [inline] [] mark_lock+0x2f2/0x1290 kernel/locking/lockdep.c:3065 [] mark_irqflags kernel/locking/lockdep.c:2958 [inline] [] __lock_acquire+0x632/0x4a10 kernel/locking/lockdep.c:3302 [] lock_acquire+0x130/0x3e0 kernel/locking/lockdep.c:3756 [] down_write+0x41/0xa0 kernel/locking/rwsem.c:52 [] inode_lock include/linux/fs.h:766 [inline] [] shmem_fallocate+0x13c/0xb10 mm/shmem.c:2676 [] ashmem_shrink_scan+0x1b9/0x4c0 drivers/staging/android/ashmem.c:462 [] do_shrink_slab mm/vmscan.c:398 [inline] [] shrink_slab.part.8+0x3c6/0xa00 mm/vmscan.c:501 [] shrink_slab mm/vmscan.c:465 [inline] [] shrink_node+0x1ed/0x740 mm/vmscan.c:2602 [] kswapd_shrink_node mm/vmscan.c:3202 [inline] [] balance_pgdat mm/vmscan.c:3319 [inline] [] kswapd+0x7e9/0x13b0 mm/vmscan.c:3512 [] kthread+0x26d/0x300 kernel/kthread.c:211 [] ret_from_fork+0x5c/0x70 arch/x86/entry/entry_64.S:373 lowmemorykiller: Killing 'syz-executor.5' (20349) (tgid 20349), adj 1000, to free 52248kB on behalf of 'kswapd0' (33) because cache 65028kB is below limit 65536kB for oom_score_adj 12 Free memory is -3540kB above reserved lowmemorykiller: Killing 'syz-executor.4' (20586) (tgid 20586), adj 1000, to free 52240kB on behalf of 'kswapd0' (33) because cache 62224kB is below limit 65536kB for oom_score_adj 12 Free memory is 3464kB above reserved lowmemorykiller: Killing 'syz-executor.0' (8257) (tgid 8257), adj 1000, to free 52200kB on behalf of 'kswapd0' (33) because cache 61524kB is below limit 65536kB for oom_score_adj 12 Free memory is 15500kB above reserved SELinux: unrecognized netlink message: protocol=0 nlmsg_type=29541 sclass=netlink_route_socket pig=20734 comm=syz-executor.4 lowmemorykiller: Killing 'syz-executor.5' (24264) (tgid 24264), adj 1000, to free 52196kB on behalf of 'kswapd0' (33) because cache 61524kB is below limit 65536kB for oom_score_adj 12 Free memory is 28624kB above reserved SELinux: unrecognized netlink message: protocol=0 nlmsg_type=29541 sclass=netlink_route_socket pig=20734 comm=syz-executor.4 binder: 20733:20740 ioctl 6611 0 returned -22 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=29541 sclass=netlink_route_socket pig=20752 comm=syz-executor.2 audit_printk_skb: 1860 callbacks suppressed audit: type=1400 audit(1573710268.908:113215): avc: denied { net_admin } for pid=20750 comm="syz-executor.2" capability=12 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 audit: type=1400 audit(1573710268.908:113216): avc: denied { create } for pid=20745 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(1573710268.908:113217): avc: denied { write } for pid=20745 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(1573710268.918:113218): avc: denied { dac_override } for pid=20765 comm="syz-executor.5" capability=1 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 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=29541 sclass=netlink_route_socket pig=20766 comm=syz-executor.2 audit: type=1400 audit(1573710268.928:113219): avc: denied { net_admin } for pid=2082 comm="syz-executor.4" capability=12 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 audit: type=1400 audit(1573710268.928:113220): avc: denied { net_admin } for pid=2082 comm="syz-executor.4" capability=12 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 audit: type=1400 audit(1573710268.948:113221): avc: denied { dac_override } for pid=20765 comm="syz-executor.5" capability=1 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 audit: type=1400 audit(1573710268.958:113222): avc: denied { sys_admin } for pid=2078 comm="syz-executor.5" capability=21 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 audit: type=1400 audit(1573710268.958:113223): avc: denied { read } for pid=20745 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(1573710268.958:113224): avc: denied { sys_admin } for pid=2078 comm="syz-executor.5" capability=21 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 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=29541 sclass=netlink_route_socket pig=20788 comm=syz-executor.2 netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=54 sclass=netlink_route_socket pig=20782 comm=syz-executor.4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=54 sclass=netlink_route_socket pig=20824 comm=syz-executor.4 netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=115 sclass=netlink_route_socket pig=20831 comm=syz-executor.5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=115 sclass=netlink_route_socket pig=20836 comm=syz-executor.5 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=59137 sclass=netlink_route_socket pig=20918 comm=syz-executor.2 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=12344 sclass=netlink_route_socket pig=20968 comm=syz-executor.4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=12337 sclass=netlink_route_socket pig=20968 comm=syz-executor.4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=8224 sclass=netlink_route_socket pig=20968 comm=syz-executor.4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=12389 sclass=netlink_route_socket pig=20968 comm=syz-executor.4 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=8224 sclass=netlink_route_socket pig=20968 comm=syz-executor.4 audit_printk_skb: 3438 callbacks suppressed audit: type=1400 audit(1573710273.918:114372): avc: denied { net_admin } for pid=2081 comm="syz-executor.2" capability=12 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 audit: type=1400 audit(1573710273.918:114373): avc: denied { net_admin } for pid=2081 comm="syz-executor.2" capability=12 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 audit: type=1400 audit(1573710273.918:114374): avc: denied { dac_override } for pid=20974 comm="syz-executor.5" capability=1 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 audit: type=1400 audit(1573710273.918:114375): avc: denied { net_admin } for pid=2080 comm="syz-executor.0" capability=12 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 audit: type=1400 audit(1573710273.918:114376): avc: denied { net_admin } for pid=2081 comm="syz-executor.2" capability=12 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 audit: type=1400 audit(1573710273.928:114377): avc: denied { net_admin } for pid=2080 comm="syz-executor.0" capability=12 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 audit: type=1400 audit(1573710273.928:114378): avc: denied { net_admin } for pid=2081 comm="syz-executor.2" capability=12 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 audit: type=1400 audit(1573710273.928:114379): avc: denied { net_admin } for pid=2081 comm="syz-executor.2" capability=12 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 audit: type=1400 audit(1573710273.928:114380): avc: denied { net_admin } for pid=2080 comm="syz-executor.0" capability=12 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 audit: type=1400 audit(1573710273.938:114383): avc: denied { dac_override } for pid=20974 comm="syz-executor.5" capability=1 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 lowmemorykiller: Killing 'syz-executor.3' (564) (tgid 564), adj 1000, to free 52196kB on behalf of 'syz-executor.4' (21028) because cache 62396kB is below limit 65536kB for oom_score_adj 12 Free memory is -2324kB above reserved lowmemorykiller: Killing 'syz-executor.3' (564) (tgid 564), adj 1000, to free 52196kB on behalf of 'kswapd0' (33) because cache 62396kB is below limit 65536kB for oom_score_adj 12 Free memory is -2324kB above reserved lowmemorykiller: Killing 'syz-executor.3' (576) (tgid 576), adj 1000, to free 52200kB on behalf of 'kworker/u4:10' (7974) because cache 61356kB is below limit 65536kB for oom_score_adj 12 Free memory is -2192kB above reserved lowmemorykiller: Killing 'syz-executor.5' (21016) (tgid 21001), adj 1000, to free 52232kB on behalf of 'syz-executor.4' (21028) because cache 61160kB is below limit 65536kB for oom_score_adj 12 Free memory is 44304kB above reserved lowmemorykiller: Killing 'syz-executor.2' (19373) (tgid 19373), adj 1000, to free 52196kB on behalf of 'syz-executor.4' (21028) because cache 61100kB is below limit 65536kB for oom_score_adj 12 Free memory is 61408kB above reserved