Free memory is -13060kB above reserved lowmemorykiller: Killing 'syz-executor.1' (22343) (tgid 22343), adj 1000, to free 36012kB on behalf of 'syz-executor.3' (958) because cache 62796kB is below limit 65536kB for oom_score_adj 12 Free memory is -13124kB above reserved BUG: sleeping function called from invalid context at kernel/fork.c:905 in_atomic(): 0, irqs_disabled(): 0, pid: 958, name: syz-executor.3 2 locks held by syz-executor.3/958: #0: (shrinker_rwsem){++++..}, at: [<0000000057c8e5ca>] shrink_slab.part.0+0xb2/0xa20 mm/vmscan.c:472 #1: (rcu_read_lock){......}, at: [<00000000d3e9e687>] lowmem_scan+0x242/0xb50 drivers/staging/android/lowmemorykiller.c:272 Preemption disabled at: [<00000000168adfa4>] spin_lock include/linux/spinlock.h:302 [inline] [<00000000168adfa4>] task_lock include/linux/sched.h:3217 [inline] [<00000000168adfa4>] get_task_mm+0x20/0xc0 kernel/fork.c:1012 CPU: 0 PID: 958 Comm: syz-executor.3 Not tainted 4.9.189+ #21 ffff880168c8f2c8 ffffffff81b65c01 0000000000000000 0000000000000001 ffff8801794a8000 ffffffff810d1010 ffff8801794a8000 ffff880168c8f300 ffffffff814018f3 ffff8801794a8000 ffffffff82a39fc0 0000000000000389 Call Trace: [<00000000d4f0720e>] __dump_stack lib/dump_stack.c:15 [inline] [<00000000d4f0720e>] dump_stack+0xc1/0x120 lib/dump_stack.c:51 [<000000004f6bb7ad>] ___might_sleep.cold+0x1c1/0x1fa kernel/sched/core.c:8004 [<000000009efa78b8>] __might_sleep+0x95/0x1a0 kernel/sched/core.c:7961 [<00000000abaa66c7>] mmput+0x28/0x370 kernel/fork.c:905 [<000000000d83522d>] handle_lmk_event+0xea/0x8a0 drivers/staging/android/lowmemorykiller.c:111 [<00000000c47423fb>] lowmem_scan+0x695/0xb50 drivers/staging/android/lowmemorykiller.c:345 [<00000000f3c710ed>] do_shrink_slab mm/vmscan.c:399 [inline] [<00000000f3c710ed>] shrink_slab.part.0+0x3cf/0xa20 mm/vmscan.c:502 [<00000000ff84b9be>] shrink_slab mm/vmscan.c:466 [inline] [<00000000ff84b9be>] shrink_node+0x1ed/0x750 mm/vmscan.c:2604 [<00000000a09d50b5>] shrink_zones mm/vmscan.c:2751 [inline] [<00000000a09d50b5>] do_try_to_free_pages mm/vmscan.c:2793 [inline] [<00000000a09d50b5>] try_to_free_pages+0x397/0xbd0 mm/vmscan.c:3004 [<00000000d7d0c519>] __perform_reclaim mm/page_alloc.c:3332 [inline] [<00000000d7d0c519>] __alloc_pages_direct_reclaim mm/page_alloc.c:3354 [inline] [<00000000d7d0c519>] __alloc_pages_slowpath mm/page_alloc.c:3704 [inline] [<00000000d7d0c519>] __alloc_pages_nodemask+0x930/0x1a80 mm/page_alloc.c:3861 [<00000000ba83bd9c>] __alloc_pages include/linux/gfp.h:433 [inline] [<00000000ba83bd9c>] __alloc_pages_node include/linux/gfp.h:446 [inline] [<00000000ba83bd9c>] alloc_pages_node include/linux/gfp.h:460 [inline] [<00000000ba83bd9c>] __vmalloc_area_node mm/vmalloc.c:1648 [inline] [<00000000ba83bd9c>] __vmalloc_node_range+0x25b/0x610 mm/vmalloc.c:1706 [<00000000dad1f166>] __vmalloc_node mm/vmalloc.c:1749 [inline] [<00000000dad1f166>] __vmalloc_node_flags mm/vmalloc.c:1763 [inline] [<00000000dad1f166>] vmalloc+0x5c/0x70 mm/vmalloc.c:1778 [<000000005544c946>] xt_alloc_entry_offsets+0x44/0x50 net/netfilter/x_tables.c:758 [<000000005b0aae7d>] translate_table+0x215/0x16c0 net/ipv6/netfilter/ip6_tables.c:733 [<0000000062ed845a>] do_replace net/ipv6/netfilter/ip6_tables.c:1186 [inline] [<0000000062ed845a>] do_ip6t_set_ctl+0x2d4/0x480 net/ipv6/netfilter/ip6_tables.c:1712 [<00000000846da368>] nf_sockopt net/netfilter/nf_sockopt.c:105 [inline] [<00000000846da368>] nf_setsockopt+0x6d/0xc0 net/netfilter/nf_sockopt.c:114 [<0000000018647aba>] ipv6_setsockopt net/ipv6/ipv6_sockglue.c:922 [inline] [<0000000018647aba>] ipv6_setsockopt+0x10b/0x140 net/ipv6/ipv6_sockglue.c:906 [<0000000094341472>] tcp_setsockopt net/ipv4/tcp.c:2759 [inline] [<0000000094341472>] tcp_setsockopt+0x8a/0xe0 net/ipv4/tcp.c:2753 [<00000000d83c7c83>] sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:2710 [<00000000605f10d4>] SYSC_setsockopt net/socket.c:1786 [inline] [<00000000605f10d4>] SyS_setsockopt+0x159/0x240 net/socket.c:1765 [<0000000042f79eaa>] do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 [<000000007f50caed>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb ================================= [ INFO: inconsistent lock state ] 4.9.189+ #21 Tainted: G W --------------------------------- inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-R} usage. syz-executor.3/958 [HC0[0]:SC0[0]:HE1:SE1] takes: (&mm->mmap_sem){+++++?}, at: [<000000004b045669>] get_cmdline+0xa3/0x2d0 mm/util.c:641 mark_held_locks+0xb1/0x100 kernel/locking/lockdep.c:2660 __lockdep_trace_alloc kernel/locking/lockdep.c:2882 [inline] lockdep_trace_alloc+0x18c/0x2b0 kernel/locking/lockdep.c:2897 __alloc_pages_nodemask+0x143/0x1a80 mm/page_alloc.c:3803 __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] pmd_alloc_one arch/x86/include/asm/pgalloc.h:88 [inline] __pmd_alloc+0x4a/0x330 mm/memory.c:3742 pmd_alloc include/linux/mm.h:1625 [inline] alloc_new_pmd mm/mremap.c:64 [inline] move_page_tables+0xadb/0xd60 mm/mremap.c:212 shift_arg_pages+0x1ae/0x470 fs/exec.c:642 setup_arg_pages+0x60d/0x7c0 fs/exec.c:754 load_elf_binary+0xa84/0x4a90 fs/binfmt_elf.c:860 search_binary_handler fs/exec.c:1621 [inline] search_binary_handler+0x14f/0x700 fs/exec.c:1599 exec_binprm fs/exec.c:1663 [inline] do_execveat_common.isra.0+0xf81/0x1db0 fs/exec.c:1785 do_execve+0x3a/0x50 fs/exec.c:1829 run_init_process+0x33/0x37 init/main.c:904 try_to_run_init_process+0x18/0x48 init/main.c:913 kernel_init+0xf2/0x163 init/main.c:984 ret_from_fork+0x5c/0x70 arch/x86/entry/entry_64.S:375 irq event stamp: 2718297 hardirqs last enabled at (2718297): [<00000000eb9f94c2>] dump_stack+0x100/0x120 lib/dump_stack.c:56 hardirqs last disabled at (2718296): [<00000000a21d4983>] dump_stack+0x2c/0x120 lib/dump_stack.c:38 softirqs last enabled at (2714508): [<00000000c96e6574>] __do_softirq+0x474/0x964 kernel/softirq.c:314 softirqs last disabled at (2714501): [<00000000b0bad637>] invoke_softirq kernel/softirq.c:368 [inline] softirqs last disabled at (2714501): [<00000000b0bad637>] irq_exit+0x119/0x160 kernel/softirq.c:409 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&mm->mmap_sem); lock(&mm->mmap_sem); *** DEADLOCK *** 3 locks held by syz-executor.3/958: #0: (shrinker_rwsem){++++..}, at: [<0000000057c8e5ca>] shrink_slab.part.0+0xb2/0xa20 mm/vmscan.c:472 #1: (rcu_read_lock){......}, at: [<00000000d3e9e687>] lowmem_scan+0x242/0xb50 drivers/staging/android/lowmemorykiller.c:272 #2: (lmk_event_lock){+.+.-.}, at: [<0000000061ce5bb2>] spin_lock include/linux/spinlock.h:302 [inline] #2: (lmk_event_lock){+.+.-.}, at: [<0000000061ce5bb2>] handle_lmk_event+0xfb/0x8a0 drivers/staging/android/lowmemorykiller.c:114 stack backtrace: CPU: 0 PID: 958 Comm: syz-executor.3 Tainted: G W 4.9.189+ #21 ffff880168c8f010 ffffffff81b65c01 00000000000000f0 ffff8801794a8000 ffffffff83caf7a0 ffff8801794a8948 ffffffff84250fc0 ffff880168c8f088 ffffffff81408330 0000000000000000 ffffffff00000001 0000000000000001 Call Trace: [<00000000d4f0720e>] __dump_stack lib/dump_stack.c:15 [inline] [<00000000d4f0720e>] dump_stack+0xc1/0x120 lib/dump_stack.c:51 [<000000003d27d72f>] print_usage_bug kernel/locking/lockdep.c:2387 [inline] [<000000003d27d72f>] print_usage_bug.cold+0x452/0x5a2 kernel/locking/lockdep.c:2354 [<00000000afc76d90>] valid_state kernel/locking/lockdep.c:2400 [inline] [<00000000afc76d90>] mark_lock_irq kernel/locking/lockdep.c:2602 [inline] [<00000000afc76d90>] mark_lock+0x6c7/0x12e0 kernel/locking/lockdep.c:3065 [<00000000b8897e1b>] mark_irqflags kernel/locking/lockdep.c:2958 [inline] [<00000000b8897e1b>] __lock_acquire+0x5be/0x4390 kernel/locking/lockdep.c:3302 [<00000000e4632ac6>] lock_acquire+0x133/0x3d0 kernel/locking/lockdep.c:3756 [<00000000d3ef4509>] down_read+0x44/0xb0 kernel/locking/rwsem.c:22 [<000000004b045669>] get_cmdline+0xa3/0x2d0 mm/util.c:641 [<00000000040ec327>] handle_lmk_event+0x13c/0x8a0 drivers/staging/android/lowmemorykiller.c:128 [<00000000c47423fb>] lowmem_scan+0x695/0xb50 drivers/staging/android/lowmemorykiller.c:345 [<00000000f3c710ed>] do_shrink_slab mm/vmscan.c:399 [inline] [<00000000f3c710ed>] shrink_slab.part.0+0x3cf/0xa20 mm/vmscan.c:502 [<00000000ff84b9be>] shrink_slab mm/vmscan.c:466 [inline] [<00000000ff84b9be>] shrink_node+0x1ed/0x750 mm/vmscan.c:2604 [<00000000a09d50b5>] shrink_zones mm/vmscan.c:2751 [inline] [<00000000a09d50b5>] do_try_to_free_pages mm/vmscan.c:2793 [inline] [<00000000a09d50b5>] try_to_free_pages+0x397/0xbd0 mm/vmscan.c:3004 [<00000000d7d0c519>] __perform_reclaim mm/page_alloc.c:3332 [inline] [<00000000d7d0c519>] __alloc_pages_direct_reclaim mm/page_alloc.c:3354 [inline] [<00000000d7d0c519>] __alloc_pages_slowpath mm/page_alloc.c:3704 [inline] [<00000000d7d0c519>] __alloc_pages_nodemask+0x930/0x1a80 mm/page_alloc.c:3861 [<00000000ba83bd9c>] __alloc_pages include/linux/gfp.h:433 [inline] [<00000000ba83bd9c>] __alloc_pages_node include/linux/gfp.h:446 [inline] [<00000000ba83bd9c>] alloc_pages_node include/linux/gfp.h:460 [inline] [<00000000ba83bd9c>] __vmalloc_area_node mm/vmalloc.c:1648 [inline] [<00000000ba83bd9c>] __vmalloc_node_range+0x25b/0x610 mm/vmalloc.c:1706 [<00000000dad1f166>] __vmalloc_node mm/vmalloc.c:1749 [inline] [<00000000dad1f166>] __vmalloc_node_flags mm/vmalloc.c:1763 [inline] [<00000000dad1f166>] vmalloc+0x5c/0x70 mm/vmalloc.c:1778 [<000000005544c946>] xt_alloc_entry_offsets+0x44/0x50 net/netfilter/x_tables.c:758 [<000000005b0aae7d>] translate_table+0x215/0x16c0 net/ipv6/netfilter/ip6_tables.c:733 [<0000000062ed845a>] do_replace net/ipv6/netfilter/ip6_tables.c:1186 [inline] [<0000000062ed845a>] do_ip6t_set_ctl+0x2d4/0x480 net/ipv6/netfilter/ip6_tables.c:1712 [<00000000846da368>] nf_sockopt net/netfilter/nf_sockopt.c:105 [inline] [<00000000846da368>] nf_setsockopt+0x6d/0xc0 net/netfilter/nf_sockopt.c:114 [<0000000018647aba>] ipv6_setsockopt net/ipv6/ipv6_sockglue.c:922 [inline] [<0000000018647aba>] ipv6_setsockopt+0x10b/0x140 net/ipv6/ipv6_sockglue.c:906 [<0000000094341472>] tcp_setsockopt net/ipv4/tcp.c:2759 [inline] [<0000000094341472>] tcp_setsockopt+0x8a/0xe0 net/ipv4/tcp.c:2753 [<00000000d83c7c83>] sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:2710 [<00000000605f10d4>] SYSC_setsockopt net/socket.c:1786 [inline] [<00000000605f10d4>] SyS_setsockopt+0x159/0x240 net/socket.c:1765 [<0000000042f79eaa>] do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 [<000000007f50caed>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb lowmemorykiller: Killing 'syz-executor.0' (10190) (tgid 10190), adj 1000, to free 35980kB on behalf of 'syz-executor.3' (958) because cache 61356kB is below limit 65536kB for oom_score_adj 12 Free memory is -13116kB above reserved lowmemorykiller: Killing 'syz-executor.0' (7246) (tgid 7246), adj 1000, to free 35956kB on behalf of 'syz-executor.3' (958) because cache 60756kB is below limit 65536kB for oom_score_adj 12 Free memory is -13188kB above reserved lowmemorykiller: Killing 'syz-executor.1' (11385) (tgid 11385), adj 1000, to free 35956kB on behalf of 'syz-executor.3' (958) because cache 60108kB is below limit 65536kB for oom_score_adj 12 Free memory is -13228kB above reserved lowmemorykiller: Killing 'syz-executor.1' (12759) (tgid 12759), adj 1000, to free 35944kB on behalf of 'syz-executor.3' (958) because cache 59508kB is below limit 65536kB for oom_score_adj 12 Free memory is -13228kB above reserved lowmemorykiller: Killing 'syz-executor.1' (12766) (tgid 12766), adj 1000, to free 35944kB on behalf of 'syz-executor.3' (958) because cache 58908kB is below limit 65536kB for oom_score_adj 12 Free memory is -13096kB above reserved lowmemorykiller: Killing 'syz-executor.1' (12777) (tgid 12777), adj 1000, to free 35944kB on behalf of 'syz-executor.3' (958) because cache 58208kB is below limit 65536kB for oom_score_adj 12 Free memory is -13064kB above reserved lowmemorykiller: Killing 'syz-executor.1' (12913) (tgid 12913), adj 1000, to free 35944kB on behalf of 'syz-executor.3' (958) because cache 57608kB is below limit 65536kB for oom_score_adj 12 Free memory is -13032kB above reserved lowmemorykiller: Killing 'syz-executor.1' (12928) (tgid 12928), adj 1000, to free 35944kB on behalf of 'syz-executor.3' (958) because cache 57008kB is below limit 65536kB for oom_score_adj 12 Free memory is -13032kB above reserved lowmemorykiller: Killing 'syz-executor.1' (12935) (tgid 12935), adj 1000, to free 35944kB on behalf of 'syz-executor.3' (958) because cache 56508kB is below limit 65536kB for oom_score_adj 12 Free memory is -13292kB above reserved