Re: [syzbot] [mm?] WARNING in mas_nomem

"Vlastimil Babka (SUSE)" <[email protected]>
Newsgroups org.kvack.linux-mm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 7/31/26 17:59, Liam R. Howlett wrote:
> On 26/07/31 12:30AM, syzbot wrote:
>> Hello,
>> 
>> syzbot found the following issue on:
>> 
>> HEAD commit:    cc2b5f627e8c Add linux-next specific files for 20260714
>> git tree:       linux-next
>> console output: https://syzkaller.appspot.com/x/log.txt?x=15ce5632580000
>> kernel config:  https://syzkaller.appspot.com/x/.config?x=2290ccbf984c524f
>> dashboard link: https://syzkaller.appspot.com/bug?extid=78a7af91b68fc6394771
>> compiler:       Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
>> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=179151b9580000
>> 
>> Downloadable assets:
>> disk image: https://storage.googleapis.com/syzbot-assets/6836f8efb1da/disk-cc2b5f62.raw.xz
>> vmlinux: https://storage.googleapis.com/syzbot-assets/0109d3477cc7/vmlinux-cc2b5f62.xz
>> kernel image: https://storage.googleapis.com/syzbot-assets/c2e49e350bbf/bzImage-cc2b5f62.xz
>> 
>> IMPORTANT: if you fix the issue, please add the following tag to the commit:
>> Reported-by: [email protected]
>> 
>> ------------[ cut here ]------------
>> !mas->sheaf && !mas->alloc
>> WARNING: lib/maple_tree.c:5751 at mas_nomem+0x1cc/0x210 lib/maple_tree.c:5751, CPU#0: udevd/5627
>> Modules linked in:
>> CPU: 0 UID: 0 PID: 5627 Comm: udevd Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
>> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
>> RIP: 0010:mas_nomem+0x1cc/0x210 lib/maple_tree.c:5751
>> Code: 4c 89 ff e8 d6 85 ea f6 49 c7 07 00 00 00 00 b0 01 e9 95 fe ff ff e8 f3 2d 7e f6 90 0f 0b 90 e9 2b ff ff ff e8 e5 2d 7e f6 90 <0f> 0b 90 e9 77 fe ff ff 89 d1 80 e1 07 80 c1 03 38 c1 0f 8c ce fe
>> RSP: 0018:ffffc9000562f8f0 EFLAGS: 00010293
>> RAX: ffffffff8b4775cb RBX: 1ffff92000ac5fbf RCX: ffff8880366e3e80
>> RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
>> RBP: 0000000000000cc0 R08: 00000000ffffffff R09: 1ffffffff1ca1a86
>> R10: dffffc0000000000 R11: fffffbfff1ca1a87 R12: dffffc0000000000
>> R13: ffffc9000562fe18 R14: ffffc9000562fde0 R15: ffffc9000562fdf8
>> FS:  00007f9021203880(0000) GS:ffff8881259f2000(0000) knlGS:0000000000000000
>> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> CR2: 000056467bb0d750 CR3: 0000000046416000 CR4: 00000000003526f0
>> Call Trace:
>>  <TASK>
>>  mas_store_gfp+0x37a/0x820 lib/maple_tree.c:4987
>>  vma_iter_clear_gfp include/linux/mm.h:1674 [inline]
>>  do_vmi_align_munmap+0x30c/0x4d0 mm/vma.c:1644
>>  do_vmi_munmap+0x252/0x2d0 mm/vma.c:1697
>>  __vm_munmap+0x241/0x3e0 mm/vma.c:3347
>>  __do_sys_munmap mm/mmap.c:1079 [inline]
>>  __se_sys_munmap mm/mmap.c:1076 [inline]
>>  __x64_sys_munmap+0x60/0x70 mm/mmap.c:1076
>>  do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
>>  do_syscall_64+0x17b/0x530 arch/x86/entry/syscall_64.c:85
>>  entry_SYSCALL_64_after_hwframe+0x77/0x7f
>> RIP: 0033:0x7f9021368097
>> Code: 73 01 c3 48 8b 0d 61 2d 0d 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 0b 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 31 2d 0d 00 f7 d8 64 89 01 48
>> RSP: 002b:00007ffeaf32d0a8 EFLAGS: 00000206 ORIG_RAX: 000000000000000b
>> RAX: ffffffffffffffda RBX: 000056467bad9bf0 RCX: 00007f9021368097
>> RDX: 0000000000000000 RSI: 00000000009480e8 RDI: 00007f90208ba000
>> RBP: 000056467bad9910 R08: 000056467baec140 R09: 0000000000000006
>> R10: 0000000000000000 R11: 0000000000000206 R12: 00005646569e2588
>> R13: 00007ffeaf32d130 R14: 0000000000000000 R15: 0000000000000000
>>  </TASK>
> 
> 
> Okay, so I'm going to change this warn_on again.
> 
> The plan is to:
> 1. Make mas_erase() and mtree_erase() use __NO_FAIL on retry.

__GFP_NOFAIL to be precise.

> 2. Remove the warning so that any failures won't cause the warning.
> 3. Make mas_store() use __NO_FAIL on retry, like mas_erase().
> 4. Add the check for locks that cannot sleep to mas_store().
> 
> Basically any caller that cannot correctly return the failure will avoid
> failing by allocating with __NO_FAIL.  This means the warning is not
> necessary.

Sounds good.

> Thanks to Vlastimil and Pedro for the help on the plan.
> 
> Summary of previous conversation is here:
> https://lore.kernel.org/all/[email protected]/

Yeah, unfortunately, "too small to fail" is a lie, because in some cases it
can fail (such as the task itself becoming oom killer victim) or any of the
other conditions that can cause __alloc_pages_may_oom() return with
*did_some_progress == 0.

And syzbot knows how to remind us of this, using fault injection.

> 
> Cheers,
> Liam
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.