================================= [ INFO: inconsistent lock state ] 4.9.194+ #0 Not tainted --------------------------------- inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-R} usage. udevd/5740 [HC0[0]:SC0[0]:HE1:SE1] takes: (&mm->mmap_sem){+++++?}, at: [<00000000db9a10dd>] 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: 11549195 hardirqs last enabled at (11549195): [<00000000656a8eed>] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:162 [inline] hardirqs last enabled at (11549195): [<00000000656a8eed>] _raw_spin_unlock_irqrestore+0x5a/0x70 kernel/locking/spinlock.c:191 hardirqs last disabled at (11549194): [<000000007bb6decf>] rcu_read_unlock_special+0x3a/0xb30 kernel/rcu/tree_plugin.h:393 softirqs last enabled at (11549184): [<00000000a07acb44>] __do_softirq+0x474/0x964 kernel/softirq.c:314 softirqs last disabled at (11549173): [<00000000393d5dca>] invoke_softirq kernel/softirq.c:368 [inline] softirqs last disabled at (11549173): [<00000000393d5dca>] 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 *** 2 locks held by udevd/5740: #0: (sb_writers#3){.+.+.+}, at: [<000000005311fc53>] file_start_write include/linux/fs.h:2646 [inline] #0: (sb_writers#3){.+.+.+}, at: [<000000005311fc53>] vfs_write+0x3e9/0x520 fs/read_write.c:558 #1: (shrinker_rwsem){++++..}, at: [<00000000809b1451>] shrink_slab.part.0+0xb2/0xa20 mm/vmscan.c:472 stack backtrace: CPU: 0 PID: 5740 Comm: udevd Not tainted 4.9.194+ #0 ffff8801ccbf7140 ffffffff81b67001 00000000000000f0 ffff8801a4eb4740 ffffffff83cb0990 ffff8801a4eb5060 ffffffff84252000 ffff8801ccbf71b8 ffffffff81408710 0000000000000000 ffffffff00000001 0000000000000001 Call Trace: [<0000000005a5d34e>] __dump_stack lib/dump_stack.c:15 [inline] [<0000000005a5d34e>] dump_stack+0xc1/0x120 lib/dump_stack.c:51 [<00000000b537bf25>] print_usage_bug kernel/locking/lockdep.c:2387 [inline] [<00000000b537bf25>] print_usage_bug.cold+0x452/0x5a2 kernel/locking/lockdep.c:2354 [<000000001c8f3e58>] valid_state kernel/locking/lockdep.c:2400 [inline] [<000000001c8f3e58>] mark_lock_irq kernel/locking/lockdep.c:2602 [inline] [<000000001c8f3e58>] mark_lock+0x6c7/0x12e0 kernel/locking/lockdep.c:3065 [<00000000ca4e81ce>] mark_irqflags kernel/locking/lockdep.c:2958 [inline] [<00000000ca4e81ce>] __lock_acquire+0x5be/0x4390 kernel/locking/lockdep.c:3302 [<00000000ecbf81a9>] lock_acquire+0x133/0x3d0 kernel/locking/lockdep.c:3756 [<00000000410d39cb>] down_read+0x44/0xb0 kernel/locking/rwsem.c:22 [<00000000db9a10dd>] get_cmdline+0xa3/0x2d0 mm/util.c:641 [<000000007694b02f>] handle_lmk_event+0x169/0x920 drivers/staging/android/lowmemorykiller.c:116 [<000000002ce94b9f>] lowmem_scan+0x6f3/0xb70 drivers/staging/android/lowmemorykiller.c:354 [<00000000d923f233>] do_shrink_slab mm/vmscan.c:399 [inline] [<00000000d923f233>] shrink_slab.part.0+0x3cf/0xa20 mm/vmscan.c:502 [<00000000540443d7>] shrink_slab mm/vmscan.c:466 [inline] [<00000000540443d7>] shrink_node+0x1ed/0x750 mm/vmscan.c:2604 [<0000000022003bbe>] shrink_zones mm/vmscan.c:2751 [inline] [<0000000022003bbe>] do_try_to_free_pages mm/vmscan.c:2793 [inline] [<0000000022003bbe>] try_to_free_pages+0x397/0xbd0 mm/vmscan.c:3004 [<0000000082dd15d7>] __perform_reclaim mm/page_alloc.c:3332 [inline] [<0000000082dd15d7>] __alloc_pages_direct_reclaim mm/page_alloc.c:3354 [inline] [<0000000082dd15d7>] __alloc_pages_slowpath mm/page_alloc.c:3704 [inline] [<0000000082dd15d7>] __alloc_pages_nodemask+0x930/0x1a80 mm/page_alloc.c:3861 [<00000000d6ee96b0>] __alloc_pages include/linux/gfp.h:433 [inline] [<00000000d6ee96b0>] __alloc_pages_node include/linux/gfp.h:446 [inline] [<00000000d6ee96b0>] alloc_pages_node include/linux/gfp.h:460 [inline] [<00000000d6ee96b0>] __get_free_pages+0x18/0x50 mm/page_alloc.c:3892 [<00000000fb76d8db>] get_zeroed_page+0x11/0x20 mm/page_alloc.c:3901 [<00000000b937421f>] simple_transaction_get fs/libfs.c:737 [inline] [<00000000b937421f>] simple_transaction_get+0x54/0x140 fs/libfs.c:729 [<0000000096f6d464>] selinux_transaction_write+0xb1/0x130 security/selinux/selinuxfs.c:740 [<00000000e086a2f7>] __vfs_write+0x116/0x560 fs/read_write.c:509 [<000000005dc6005a>] vfs_write+0x185/0x520 fs/read_write.c:559 [<000000000e7e2ddf>] SYSC_write fs/read_write.c:607 [inline] [<000000000e7e2ddf>] SyS_write+0x121/0x270 fs/read_write.c:599 [<0000000011e88ddb>] do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 [<00000000a89e3c72>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb lowmemorykiller: Killing 'syz-executor.4' (3505) (tgid 3505), adj 1000, to free 52388kB on behalf of 'syz-executor.4' (5210) because cache 64624kB is below limit 65536kB for oom_score_adj 12 Free memory is -11232kB above reserved lowmemorykiller: Killing 'syz-executor.4' (3629) (tgid 3629), adj 1000, to free 52388kB on behalf of 'syz-executor.4' (5210) because cache 64524kB is below limit 65536kB for oom_score_adj 12 Free memory is 14444kB above reserved lowmemorykiller: Killing 'syz-executor.4' (5125) (tgid 5125), adj 1000, to free 52388kB on behalf of 'syz-executor.0' (5211) because cache 64624kB is below limit 65536kB for oom_score_adj 12 Free memory is 14444kB above reserved lowmemorykiller: Killing 'syz-executor.4' (18959) (tgid 18959), adj 1000, to free 52384kB on behalf of 'syz-executor.4' (5210) because cache 64524kB is below limit 65536kB for oom_score_adj 12 Free memory is 42044kB above reserved lowmemorykiller: Killing 'syz-executor.4' (18959) (tgid 18959), adj 1000, to free 52384kB on behalf of 'syz-executor.0' (5211) because cache 64524kB is below limit 65536kB for oom_score_adj 12 Free memory is 49640kB above reserved lowmemorykiller: Killing 'syz-executor.4' (5231) (tgid 5231), adj 1000, to free 52388kB on behalf of 'kswapd0' (33) because cache 64484kB is below limit 65536kB for oom_score_adj 12 Free memory is -7584kB above reserved lowmemorykiller: Killing 'syz-executor.4' (5280) (tgid 5280), adj 1000, to free 52388kB on behalf of 'kswapd0' (33) because cache 64384kB is below limit 65536kB for oom_score_adj 12 Free memory is -7556kB above reserved lowmemorykiller: Killing 'syz-executor.4' (5289) (tgid 5289), adj 1000, to free 52388kB on behalf of 'syz-executor.4' (5345) because cache 63984kB is below limit 65536kB for oom_score_adj 12 Free memory is -13192kB above reserved lowmemorykiller: Killing 'syz-executor.4' (18979) (tgid 18979), adj 1000, to free 52384kB on behalf of 'syz-executor.4' (5345) because cache 63984kB is below limit 65536kB for oom_score_adj 12 Free memory is 17080kB above reserved