================================= [ INFO: inconsistent lock state ] 4.9.141+ #1 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: 7257 hardirqs last enabled at (7257): [] __mutex_trylock_slowpath kernel/locking/mutex.c:885 [inline] hardirqs last enabled at (7257): [] mutex_trylock+0x258/0x3e0 kernel/locking/mutex.c:908 lowmemorykiller: Killing 'syz-executor.0' (3635) (tgid 3635), adj 1000, to free 52520kB on behalf of 'syz-executor.5' (20330) because cache 65208kB is below limit 65536kB for oom_score_adj 12 Free memory is -13176kB above reserved hardirqs last disabled at (7256): [] __mutex_trylock_slowpath kernel/locking/mutex.c:873 [inline] hardirqs last disabled at (7256): [] mutex_trylock+0xaf/0x3e0 kernel/locking/mutex.c:908 softirqs last enabled at (6004): [] __do_softirq+0x46d/0x964 kernel/softirq.c:314 softirqs last disabled at (5881): [] invoke_softirq kernel/softirq.c:368 [inline] softirqs last disabled at (5881): [] 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: 0 PID: 33 Comm: kswapd0 Not tainted 4.9.141+ #1 ffff8801d8417380 ffffffff81b42e79 ffff8801d8408000 ffffffff83cac960 ffff8801d8408900 ffff8801d8408920 ffffffff84244d40 ffff8801d84173f8 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.0' (3557) (tgid 3557), adj 1000, to free 52088kB on behalf of 'syz-executor.5' (20330) because cache 1156kB is below limit 6144kB for oom_score_adj 0 Free memory is -11432kB above reserved lowmemorykiller: Killing 'syz-executor.1' (14735) (tgid 14735), adj 1000, to free 52072kB on behalf of 'syz-executor.5' (20330) because cache 1156kB is below limit 65536kB for oom_score_adj 12 Free memory is 21968kB above reserved lowmemorykiller: Killing 'syz-executor.2' (3854) (tgid 3854), adj 1000, to free 52068kB on behalf of 'syz-executor.5' (20330) because cache 1452kB is below limit 65536kB for oom_score_adj 12 Free memory is 39800kB above reserved lowmemorykiller: Killing 'syz-executor.3' (7215) (tgid 7215), adj 1000, to free 52068kB on behalf of 'syz-executor.5' (20330) because cache 1452kB is below limit 65536kB for oom_score_adj 12 Free memory is 57064kB above reserved lowmemorykiller: Killing 'syz-executor.0' (13470) (tgid 13470), adj 1000, to free 51932kB on behalf of 'syz-executor.5' (20330) because cache 2028kB is below limit 6144kB for oom_score_adj 0 Free memory is -13348kB above reserved lowmemorykiller: Killing 'syz-executor.2' (7141) (tgid 7141), adj 1000, to free 51924kB on behalf of 'syz-executor.5' (20330) because cache 2028kB is below limit 6144kB for oom_score_adj 0 Free memory is 3340kB above reserved lowmemorykiller: Killing 'syz-executor.2' (16432) (tgid 16432), adj 1000, to free 51908kB on behalf of 'syz-executor.5' (20330) because cache 2028kB is below limit 65536kB for oom_score_adj 12 Free memory is 36640kB above reserved lowmemorykiller: Killing 'syz-executor.2' (13104) (tgid 13104), adj 1000, to free 51900kB on behalf of 'syz-executor.5' (20330) because cache 2028kB is below limit 65536kB for oom_score_adj 12 Free memory is 53320kB above reserved lowmemorykiller: Killing 'syz-executor.2' (13108) (tgid 13108), adj 1000, to free 51900kB on behalf of 'syz-executor.5' (20330) because cache 2028kB is below limit 65536kB for oom_score_adj 12 Free memory is 53432kB above reserved lowmemorykiller: Killing 'syz-executor.1' (14017) (tgid 14017), adj 1000, to free 51808kB on behalf of 'syz-executor.5' (20330) because cache 2028kB is below limit 65536kB for oom_score_adj 12 Free memory is 53432kB above reserved lowmemorykiller: Killing 'syz-executor.3' (7161) (tgid 7161), adj 1000, to free 51420kB on behalf of 'kswapd0' (33) because cache 1624kB is below limit 6144kB for oom_score_adj 0 Free memory is -13252kB above reserved lowmemorykiller: Killing 'syz-executor.3' (7190) (tgid 7190), adj 1000, to free 51668kB on behalf of 'kswapd0' (33) because cache 1572kB is below limit 6144kB for oom_score_adj 0 Free memory is -13152kB above reserved lowmemorykiller: Killing 'syz-executor.0' (14207) (tgid 14207), adj 1000, to free 51288kB on behalf of 'kswapd0' (33) because cache 1720kB is below limit 6144kB for oom_score_adj 0 Free memory is 3980kB above reserved lowmemorykiller: Killing 'syz-executor.0' (14208) (tgid 14208), adj 1000, to free 51288kB on behalf of 'kswapd0' (33) because cache 1620kB is below limit 6144kB for oom_score_adj 0 Free memory is -13316kB above reserved lowmemorykiller: Killing 'syz-executor.2' (8239) (tgid 8239), adj 1000, to free 51280kB on behalf of 'kswapd0' (33) because cache 468kB is below limit 6144kB for oom_score_adj 0 Free memory is -28092kB above reserved oom_reaper: reaped process 20330 (syz-executor.5), now anon-rss:0kB, file-rss:16kB, shmem-rss:0kB syz-executor.5: vmalloc: allocation failure, allocated 1350176768 of 4294975488 bytes, mode:0x24000c2(GFP_KERNEL|__GFP_HIGHMEM) CPU: 1 PID: 20330 Comm: syz-executor.5 Not tainted 4.9.141+ #1 ffff88008362f9c8 ffffffff81b42e79 1ffff100106c5f3b dffffc0000000000 ffffffff82aa8ba0 0000000000000000 0000000000400000 ffff88008362fb10 ffffffff814fc7c8 0000000041b58ab3 ffffffff82e37a10 ffffffff81427db0 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] warn_alloc.cold.31+0x7f/0x9c mm/page_alloc.c:3068 [] __vmalloc_area_node mm/vmalloc.c:1661 [inline] [] __vmalloc_node_range+0x3f8/0x600 mm/vmalloc.c:1702 [] __vmalloc_node mm/vmalloc.c:1745 [inline] [] __vmalloc_node_flags mm/vmalloc.c:1759 [inline] [] vmalloc+0x5b/0x70 mm/vmalloc.c:1774 [] xt_alloc_table_info+0xc9/0x100 net/netfilter/x_tables.c:997 [] do_replace net/ipv4/netfilter/ip_tables.c:1146 [inline] [] do_ipt_set_ctl+0x235/0x460 net/ipv4/netfilter/ip_tables.c:1693 [] nf_sockopt net/netfilter/nf_sockopt.c:105 [inline] [] nf_setsockopt+0x6d/0xc0 net/netfilter/nf_sockopt.c:114 [] ip_setsockopt+0x88/0xa0 net/ipv4/ip_sockglue.c:1249 [] udp_setsockopt+0x4a/0x90 net/ipv4/udp.c:2110 [] sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:2706 [] SYSC_setsockopt net/socket.c:1785 [inline] [] SyS_setsockopt+0x166/0x260 net/socket.c:1764 [] do_syscall_64+0x19f/0x550 arch/x86/entry/common.c:285 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Mem-Info: active_anon:92968 inactive_anon:33157 isolated_anon:0 active_file:35 inactive_file:39 isolated_file:0 unevictable:1 dirty:0 writeback:0 unstable:0 slab_reclaimable:6849 slab_unreclaimable:60436 mapped:56387 shmem:33423 pagetables:7435 bounce:0 free:0 free_pcp:64 free_cma:0 Node 0 active_anon:371872kB inactive_anon:132628kB active_file:140kB inactive_file:156kB unevictable:4kB isolated(anon):0kB isolated(file):0kB mapped:225548kB dirty:0kB writeback:0kB shmem:133692kB writeback_tmp:0kB unstable:0kB pages_scanned:6 all_unreclaimable? no DMA32 free:0kB min:4696kB low:7712kB high:10728kB active_anon:20kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:3145324kB managed:3020132kB mlocked:0kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:32kB pagetables:0kB bounce:0kB free_pcp:20kB local_pcp:20kB free_cma:0kB Normal free:28kB min:5580kB low:9168kB high:12756kB active_anon:371852kB inactive_anon:132628kB active_file:140kB inactive_file:156kB unevictable:4kB writepending:0kB present:4718592kB managed:3589316kB mlocked:0kB slab_reclaimable:27396kB slab_unreclaimable:241744kB kernel_stack:12480kB pagetables:29740kB bounce:0kB free_pcp:236kB local_pcp:40kB free_cma:0kB DMA32: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 0kB 0 pages in swap cache Swap cache stats: add 0, delete 0, find 0/0 Free swap = 0kB Total swap = 0kB 1965979 pages RAM 0 pages HighMem/MovableOnly 313617 pages reserved BUG: Bad rss-counter state mm:ffff8801a033d800 idx:0 val:3