[syzbot] [mm?] WARNING in try_to_migrate_one (3)

10 views
Skip to first unread message

syzbot

unread,
Aug 9, 2025, 4:36:39 PMAug 9
to Liam.H...@oracle.com, ak...@linux-foundation.org, da...@redhat.com, harr...@oracle.com, linux-...@vger.kernel.org, linu...@kvack.org, lorenzo...@oracle.com, ri...@surriel.com, syzkall...@googlegroups.com, vba...@suse.cz
Hello,

syzbot found the following issue on:

HEAD commit: 0227b49b5027 Merge tag 'gpio-updates-for-v6.17-rc1-part2' ..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1422d434580000
kernel config: https://syzkaller.appspot.com/x/.config?x=2ae1da3a7f4a6ba4
dashboard link: https://syzkaller.appspot.com/bug?extid=63859a31071a369082b1
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=117c72f0580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17ab7ea2580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d0d0622733f6/disk-0227b49b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/6a993871f113/vmlinux-0227b49b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0f07823c6782/bzImage-0227b49b.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+63859a...@syzkaller.appspotmail.com

do_initcall_level+0x104/0x190 init/main.c:1331
do_initcalls+0x59/0xa0 init/main.c:1347
kernel_init_freeable+0x334/0x4b0 init/main.c:1579
kernel_init+0x1d/0x1d0 init/main.c:1469
ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5866 at mm/rmap.c:2452 try_to_migrate_one+0xf27/0x34d0 mm/rmap.c:2451
Modules linked in:
CPU: 0 UID: 0 PID: 5866 Comm: syz-executor265 Not tainted 6.16.0-syzkaller-12187-g0227b49b5027 #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:try_to_migrate_one+0xf27/0x34d0 mm/rmap.c:2451
Code: fb 00 00 00 f4 0f 84 35 0e 00 00 e8 f3 41 ae ff e9 73 f8 ff ff e8 e9 41 ae ff 4c 89 e7 48 c7 c6 00 79 96 8b e8 0a 92 16 ff 90 <0f> 0b 90 e9 60 ff ff ff e8 cc 41 ae ff 49 ff cf e9 3e fb ff ff e8
RSP: 0000:ffffc9000401f120 EFLAGS: 00010246
RAX: c3d51769d0dbd500 RBX: 0400000000000000 RCX: c3d51769d0dbd500
RDX: 0000000000000003 RSI: ffffffff8dba5e25 RDI: ffff8880115dda00
RBP: ffffc9000401f370 R08: ffff8880b8624253 R09: 1ffff110170c484a
R10: dffffc0000000000 R11: ffffed10170c484b R12: ffffea0001cd8000
R13: 0000000073603867 R14: dffffc0000000000 R15: ffffea0001cd8018
FS: 0000555590a54380(0000) GS:ffff888125c1c000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000045ad50 CR3: 00000000743ea000 CR4: 00000000003526f0
Call Trace:
<TASK>
rmap_walk_anon+0x550/0x730 mm/rmap.c:2842
rmap_walk_locked mm/rmap.c:2958 [inline]
try_to_migrate+0x3f5/0x670 mm/rmap.c:2619
unmap_folio+0x191/0x1f0 mm/huge_memory.c:3137
__folio_split+0x90d/0x1c60 mm/huge_memory.c:3711
try_split_folio+0x13f/0x310 mm/migrate.c:1550
migrate_pages_batch+0x653/0x3620 mm/migrate.c:1819
migrate_pages_sync mm/migrate.c:1974 [inline]
migrate_pages+0x1bcc/0x2930 mm/migrate.c:2083
do_mbind mm/mempolicy.c:1539 [inline]
kernel_mbind mm/mempolicy.c:1682 [inline]
__do_sys_mbind mm/mempolicy.c:1756 [inline]
__se_sys_mbind+0xa3e/0xc30 mm/mempolicy.c:1752
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb95004e539
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffa7b144d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ed
RAX: ffffffffffffffda RBX: 0000200000000000 RCX: 00007fb95004e539
RDX: 0000000000000001 RSI: 0000000000600000 RDI: 0000200000000000
RBP: 00007fb9500c15f0 R08: 0000000000000000 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

Hillf Danton

unread,
Aug 9, 2025, 9:36:13 PMAug 9
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
> Date: Sat, 09 Aug 2025 13:36:38 -0700 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 0227b49b5027 Merge tag 'gpio-updates-for-v6.17-rc1-part2' ..
> git tree: upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=1422d434580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=2ae1da3a7f4a6ba4
> dashboard link: https://syzkaller.appspot.com/bug?extid=63859a31071a369082b1
#syz test

--- x/mm/rmap.c
+++ y/mm/rmap.c
@@ -2366,6 +2366,7 @@ static bool try_to_migrate_one(struct fo
subpage = folio_page(folio, pfn - folio_pfn(folio));
address = pvmw.address;
anon_exclusive = folio_test_anon(folio) &&
+ pfn == folio_pfn(folio) &&
PageAnonExclusive(subpage);

if (folio_test_hugetlb(folio)) {
--

syzbot

unread,
Aug 9, 2025, 9:55:04 PMAug 9
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in try_to_migrate_one

vms_complete_munmap_vmas+0x206/0x8a0 mm/vma.c:1277
do_vmi_align_munmap+0x358/0x420 mm/vma.c:1536
do_vmi_munmap+0x253/0x2e0 mm/vma.c:1584
__vm_munmap+0x23b/0x3d0 mm/vma.c:3155
__do_sys_munmap mm/mmap.c:1080 [inline]
__se_sys_munmap mm/mmap.c:1077 [inline]
__x64_sys_munmap+0x60/0x70 mm/mmap.c:1077
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
------------[ cut here ]------------
WARNING: CPU: 0 PID: 6686 at mm/rmap.c:2453 try_to_migrate_one+0xf99/0x3540 mm/rmap.c:2452
Modules linked in:
CPU: 0 UID: 0 PID: 6686 Comm: syz.0.17 Not tainted 6.16.0-syzkaller-12256-g561c80369df0-dirty #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:try_to_migrate_one+0xf99/0x3540 mm/rmap.c:2452
Code: 00 e8 cb 3f ae ff 49 be 00 00 00 00 00 fc ff df e9 f2 f7 ff ff e8 b7 3f ae ff 4c 89 ff 48 c7 c6 00 79 96 8b e8 08 90 16 ff 90 <0f> 0b 90 e9 52 ff ff ff e8 9a 3f ae ff 49 ff cf e9 bb f8 ff ff e8
RSP: 0018:ffffc90003ddf120 EFLAGS: 00010246
RAX: 9446046ff81e8900 RBX: 0400000000000000 RCX: 9446046ff81e8900
RDX: 0000000000000003 RSI: ffffffff8dba5fb3 RDI: ffff88805cd51e00
RBP: ffffc90003ddf370 R08: ffffc90003ddeae7 R09: 1ffff920007bbd5c
R10: dffffc0000000000 R11: fffff520007bbd5d R12: ffffea0001988018
R13: 0000000066203867 R14: dffffc0000000000 R15: ffffea0001988000
FS: 00007fe5b6a1b6c0(0000) GS:ffff888125c1c000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000000012c0 CR3: 000000005c8a8000 CR4: 00000000003526f0
Call Trace:
<TASK>
rmap_walk_anon+0x550/0x730 mm/rmap.c:2843
rmap_walk_locked mm/rmap.c:2959 [inline]
try_to_migrate+0x3f5/0x670 mm/rmap.c:2620
unmap_folio+0x191/0x1f0 mm/huge_memory.c:3137
__folio_split+0x90d/0x1c60 mm/huge_memory.c:3711
try_split_folio+0x13f/0x310 mm/migrate.c:1550
migrate_pages_batch+0x653/0x3620 mm/migrate.c:1819
migrate_pages_sync mm/migrate.c:1974 [inline]
migrate_pages+0x1bcc/0x2930 mm/migrate.c:2083
do_mbind mm/mempolicy.c:1539 [inline]
kernel_mbind mm/mempolicy.c:1682 [inline]
__do_sys_mbind mm/mempolicy.c:1756 [inline]
__se_sys_mbind+0xa3e/0xc30 mm/mempolicy.c:1752
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe5b5b8ebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe5b6a1b038 EFLAGS: 00000246 ORIG_RAX: 00000000000000ed
RAX: ffffffffffffffda RBX: 00007fe5b5db5fa0 RCX: 00007fe5b5b8ebe9
RDX: 0000000000000001 RSI: 0000000000600000 RDI: 0000200000000000
RBP: 00007fe5b5c11e19 R08: 0000000000000000 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fe5b5db6038 R14: 00007fe5b5db5fa0 R15: 00007ffc7a58f7a8
</TASK>


Tested on:

commit: 561c8036 Merge tag 'tty-6.16-rc1-2' of git://git.kerne..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=167fd434580000
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
patch: https://syzkaller.appspot.com/x/patch.diff?x=17cefea2580000

Hillf Danton

unread,
Aug 9, 2025, 10:02:32 PMAug 9
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
> Date: Sat, 09 Aug 2025 13:36:38 -0700 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 0227b49b5027 Merge tag 'gpio-updates-for-v6.17-rc1-part2' ..
> git tree: upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=1422d434580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=2ae1da3a7f4a6ba4
> dashboard link: https://syzkaller.appspot.com/bug?extid=63859a31071a369082b1
#syz test

--- x/mm/rmap.c
+++ y/mm/rmap.c
@@ -2366,6 +2366,7 @@ static bool try_to_migrate_one(struct fo
subpage = folio_page(folio, pfn - folio_pfn(folio));
address = pvmw.address;
anon_exclusive = folio_test_anon(folio) &&
+ pfn != folio_pfn(folio) &&
PageAnonExclusive(subpage);

if (folio_test_hugetlb(folio)) {
--

syzbot

unread,
Aug 9, 2025, 10:56:05 PMAug 9
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in try_to_migrate_one

folios_put include/linux/mm.h:1419 [inline]
folio_batch_move_lru+0x319/0x3a0 mm/swap.c:175
__folio_batch_add_and_move+0x5ad/0xd20 mm/swap.c:196
map_anon_folio_pmd+0x1c9/0x5a0 mm/huge_memory.c:1208
__do_huge_pmd_anonymous_page mm/huge_memory.c:1253 [inline]
do_huge_pmd_anonymous_page+0x518/0xb60 mm/huge_memory.c:1371
create_huge_pmd mm/memory.c:5917 [inline]
__handle_mm_fault+0x1139/0x5440 mm/memory.c:6166
handle_mm_fault+0x40a/0x8e0 mm/memory.c:6364
do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1336
handle_page_fault arch/x86/mm/fault.c:1476 [inline]
exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
------------[ cut here ]------------
WARNING: CPU: 0 PID: 6632 at mm/rmap.c:2453 try_to_migrate_one+0xf99/0x3540 mm/rmap.c:2452
Modules linked in:
CPU: 0 UID: 0 PID: 6632 Comm: syz.0.17 Not tainted 6.16.0-syzkaller-12256-g561c80369df0-dirty #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:try_to_migrate_one+0xf99/0x3540 mm/rmap.c:2452
Code: 00 e8 cb 3f ae ff 49 be 00 00 00 00 00 fc ff df e9 f2 f7 ff ff e8 b7 3f ae ff 4c 89 ff 48 c7 c6 00 79 96 8b e8 08 90 16 ff 90 <0f> 0b 90 e9 52 ff ff ff e8 9a 3f ae ff 49 ff cf e9 bb f8 ff ff e8
RSP: 0018:ffffc900034f7360 EFLAGS: 00010246
RAX: ac960e1a3b7e2b00 RBX: 0400000000000000 RCX: ac960e1a3b7e2b00
RDX: 0000000000000003 RSI: ffffffff8dba5fb3 RDI: ffff888029dd9e00
RBP: ffffc900034f75b0 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffffbfff1bfa1ec R12: ffffea0001c1c198
R13: 0000000070706867 R14: dffffc0000000000 R15: ffffea0001c1c180
FS: 00007fbdca6816c0(0000) GS:ffff888125c1c000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002000000012c0 CR3: 000000002d9e6000 CR4: 00000000003526f0
Call Trace:
<TASK>
rmap_walk_anon+0x550/0x730 mm/rmap.c:2843
rmap_walk mm/rmap.c:2948 [inline]
try_to_migrate+0x3bc/0x670 mm/rmap.c:2622
migrate_folio_unmap mm/migrate.c:1302 [inline]
migrate_pages_batch+0x116f/0x3620 mm/migrate.c:1851
migrate_pages_sync mm/migrate.c:1974 [inline]
migrate_pages+0x1bcc/0x2930 mm/migrate.c:2083
do_mbind mm/mempolicy.c:1539 [inline]
kernel_mbind mm/mempolicy.c:1682 [inline]
__do_sys_mbind mm/mempolicy.c:1756 [inline]
__se_sys_mbind+0xa3e/0xc30 mm/mempolicy.c:1752
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fbdc978ebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbdca681038 EFLAGS: 00000246 ORIG_RAX: 00000000000000ed
RAX: ffffffffffffffda RBX: 00007fbdc99b5fa0 RCX: 00007fbdc978ebe9
RDX: 0000000000000001 RSI: 0000000000600000 RDI: 0000200000000000
RBP: 00007fbdc9811e19 R08: 0000000000000000 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fbdc99b6038 R14: 00007fbdc99b5fa0 R15: 00007ffd9d17a4b8
</TASK>


Tested on:

commit: 561c8036 Merge tag 'tty-6.16-rc1-2' of git://git.kerne..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1109fea2580000
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
patch: https://syzkaller.appspot.com/x/patch.diff?x=15403434580000

Hillf Danton

unread,
Aug 10, 2025, 2:06:05 AMAug 10
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
> Date: Sat, 09 Aug 2025 13:36:38 -0700 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 0227b49b5027 Merge tag 'gpio-updates-for-v6.17-rc1-part2' ..
> git tree: upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=1422d434580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=2ae1da3a7f4a6ba4
> dashboard link: https://syzkaller.appspot.com/bug?extid=63859a31071a369082b1
#syz test

--- x/mm/rmap.c
+++ y/mm/rmap.c
@@ -2283,6 +2283,7 @@ static bool try_to_migrate_one(struct fo
struct mm_struct *mm = vma->vm_mm;
DEFINE_FOLIO_VMA_WALK(pvmw, folio, vma, address, 0);
bool anon_exclusive, writable, ret = true;
+ int check_excl = 1;
pte_t pteval;
struct page *subpage;
struct mmu_notifier_range range;
@@ -2422,6 +2423,7 @@ static bool try_to_migrate_one(struct fo
if (pte_dirty(pteval))
folio_mark_dirty(folio);
writable = pte_write(pteval);
+ check_excl = 0;
} else if (likely(pte_present(pteval))) {
flush_cache_page(vma, address, pfn);
/* Nuke the page table entry. */
@@ -2446,10 +2448,17 @@ static bool try_to_migrate_one(struct fo
} else {
pte_clear(mm, address, pvmw.pte);
writable = is_writable_device_private_entry(pte_to_swp_entry(pteval));
+ check_excl = 0;
}

- VM_WARN_ON_FOLIO(writable && folio_test_anon(folio) &&
- !anon_exclusive, folio);
+ if (check_excl) {
+ pfn = pte_pfn(pteval);
+ subpage = folio_page(folio, pfn - folio_pfn(folio));
+ anon_exclusive = folio_test_anon(folio) &&
+ PageAnonExclusive(subpage);
+ VM_WARN_ON_FOLIO(writable && folio_test_anon(folio) &&
+ !anon_exclusive, folio);
+ }

/* Update high watermark before we lower rss */
update_hiwater_rss(mm);
--

syzbot

unread,
Aug 10, 2025, 3:16:03 AMAug 10
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING in try_to_migrate_one

vms_complete_munmap_vmas+0x206/0x8a0 mm/vma.c:1277
do_vmi_align_munmap+0x358/0x420 mm/vma.c:1536
do_vmi_munmap+0x253/0x2e0 mm/vma.c:1584
__vm_munmap+0x23b/0x3d0 mm/vma.c:3155
__do_sys_munmap mm/mmap.c:1080 [inline]
__se_sys_munmap mm/mmap.c:1077 [inline]
__x64_sys_munmap+0x60/0x70 mm/mmap.c:1077
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
------------[ cut here ]------------
WARNING: CPU: 1 PID: 6665 at mm/rmap.c:2460 try_to_migrate_one+0x20a9/0x3cb0 mm/rmap.c:2459
Modules linked in:
CPU: 1 UID: 0 PID: 6665 Comm: syz.0.17 Not tainted 6.16.0-syzkaller-12288-g2b38afce25c4-dirty #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:try_to_migrate_one+0x20a9/0x3cb0 mm/rmap.c:2459
Code: c7 c7 a0 79 96 8b e8 36 cd 71 ff 90 0f 0b 90 90 e9 a8 f8 ff ff e8 a7 2e ae ff 4c 89 ff 48 c7 c6 c0 78 96 8b e8 f8 7e 16 ff 90 <0f> 0b 90 e9 22 ef ff ff e8 8a 2e ae ff 49 ff cf e9 e5 ef ff ff e8
RSP: 0018:ffffc90002f87120 EFLAGS: 00010246
RAX: 1f9183d47663e300 RBX: 0000000000000001 RCX: 1f9183d47663e300
RDX: 0000000000000003 RSI: ffffffff8dba5fbd RDI: ffff88802540da00
RBP: ffffc90002f87370 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffffbfff1bfa1ec R12: ffffea0001ad8018
R13: dffffc0000000000 R14: 0000000000000000 R15: ffffea0001ad8000
FS: 00007f6cc346c6c0(0000) GS:ffff888125d1c000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056399b4b5008 CR3: 0000000074e12000 CR4: 00000000003526f0
Call Trace:
<TASK>
rmap_walk_anon+0x553/0x730 mm/rmap.c:2851
rmap_walk_locked mm/rmap.c:2967 [inline]
try_to_migrate+0x3f5/0x670 mm/rmap.c:2628
unmap_folio+0x191/0x1f0 mm/huge_memory.c:3137
__folio_split+0x90d/0x1c60 mm/huge_memory.c:3711
try_split_folio+0x13f/0x310 mm/migrate.c:1550
migrate_pages_batch+0x653/0x3620 mm/migrate.c:1819
migrate_pages_sync mm/migrate.c:1974 [inline]
migrate_pages+0x1bcc/0x2930 mm/migrate.c:2083
do_mbind mm/mempolicy.c:1539 [inline]
kernel_mbind mm/mempolicy.c:1682 [inline]
__do_sys_mbind mm/mempolicy.c:1756 [inline]
__se_sys_mbind+0xa3e/0xc30 mm/mempolicy.c:1752
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f6cc258ebe9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6cc346c038 EFLAGS: 00000246 ORIG_RAX: 00000000000000ed
RAX: ffffffffffffffda RBX: 00007f6cc27b5fa0 RCX: 00007f6cc258ebe9
RDX: 0000000000000001 RSI: 0000000000600000 RDI: 0000200000000000
RBP: 00007f6cc2611e19 R08: 0000000000000000 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f6cc27b6038 R14: 00007f6cc27b5fa0 R15: 00007ffd706df1a8
</TASK>


Tested on:

commit: 2b38afce Merge tag 'turbostat-2025.09.09' of git://git..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16b8f2f0580000
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
patch: https://syzkaller.appspot.com/x/patch.diff?x=13f3fea2580000

syzbot

unread,
Aug 10, 2025, 10:50:06 AMAug 10
to Liam.H...@oracle.com, ak...@linux-foundation.org, da...@redhat.com, dev....@arm.com, harr...@oracle.com, hda...@sina.com, liam.h...@oracle.com, linux-...@vger.kernel.org, linu...@kvack.org, lorenzo...@oracle.com, ri...@surriel.com, syzkall...@googlegroups.com, vba...@suse.cz, z...@nvidia.com
syzbot has bisected this issue to:

commit cac1db8c3aad97d6ffb56ced8868d6cbbbd2bfbe
Author: Dev Jain <dev....@arm.com>
Date: Fri Jul 18 09:02:43 2025 +0000

mm: optimize mprotect() by PTE batching

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=12ac8842580000
start commit: 0227b49b5027 Merge tag 'gpio-updates-for-v6.17-rc1-part2' ..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=11ac8842580000
console output: https://syzkaller.appspot.com/x/log.txt?x=16ac8842580000
Reported-by: syzbot+63859a...@syzkaller.appspotmail.com
Fixes: cac1db8c3aad ("mm: optimize mprotect() by PTE batching")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Lorenzo Stoakes

unread,
Aug 11, 2025, 1:12:11 AMAug 11
to syzbot, Liam.H...@oracle.com, ak...@linux-foundation.org, da...@redhat.com, harr...@oracle.com, linux-...@vger.kernel.org, linu...@kvack.org, ri...@surriel.com, syzkall...@googlegroups.com, vba...@suse.cz



On Sat, Aug 09, 2025 at 01:36:38PM -0700, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 0227b49b5027 Merge tag 'gpio-updates-for-v6.17-rc1-part2' ..
> git tree: upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=1422d434580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=2ae1da3a7f4a6ba4
> dashboard link: https://syzkaller.appspot.com/bug?extid=63859a31071a369082b1
> compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=117c72f0580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17ab7ea2580000

This seems to be racey so as is often the case the repro doesn't repro for me...

Upstream hasn't yet got [0] which is is very likely the cause of this.

[0]:https://lore.kernel.org/all/20250806145611....@arm.com/

Let's have syzbot test it:

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-hotfixes-unstable

>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/d0d0622733f6/disk-0227b49b.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/6a993871f113/vmlinux-0227b49b.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/0f07823c6782/bzImage-0227b49b.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+63859a...@syzkaller.appspotmail.com
>
> do_initcall_level+0x104/0x190 init/main.c:1331
> do_initcalls+0x59/0xa0 init/main.c:1347
> kernel_init_freeable+0x334/0x4b0 init/main.c:1579
> kernel_init+0x1d/0x1d0 init/main.c:1469
> ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
> ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 5866 at mm/rmap.c:2452 try_to_migrate_one+0xf27/0x34d0 mm/rmap.c:2451

Presumably:

VM_WARN_ON_FOLIO(writable && folio_test_anon(folio) &&
!anon_exclusive, folio);

Likely the anon exclusive flag has not been propagated correctly because of
the bug in commit cac1db8c3aad (" mm: optimize mprotect() by PTE
batching"), which means if the PTE range doesn't include the 0th page of
the folio we accidentily consider it and pages offset by it in
page_anon_exclusive_sub_batch(), which really does point to this being the bug.

This is fixed by [0].

syzbot

unread,
Aug 11, 2025, 2:34:04 AMAug 11
to ak...@linux-foundation.org, da...@redhat.com, harr...@oracle.com, liam.h...@oracle.com, linux-...@vger.kernel.org, linu...@kvack.org, lorenzo...@oracle.com, ri...@surriel.com, syzkall...@googlegroups.com, vba...@suse.cz
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+63859a...@syzkaller.appspotmail.com
Tested-by: syzbot+63859a...@syzkaller.appspotmail.com

Tested on:

commit: f1f00681 mm/userfaultfd: fix kmap_local LIFO ordering ..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-hotfixes-unstable
console output: https://syzkaller.appspot.com/x/log.txt?x=11990af0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=75e522434dc68cb9
dashboard link: https://syzkaller.appspot.com/bug?extid=63859a31071a369082b1
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Oct 9, 2025, 12:37:04 AM (24 hours ago) Oct 9
to Liam.H...@oracle.com, ak...@linux-foundation.org, da...@redhat.com, dev....@arm.com, harr...@oracle.com, hda...@sina.com, liam.h...@oracle.com, linux-...@vger.kernel.org, linu...@kvack.org, lorenzo...@oracle.com, ri...@surriel.com, syzkall...@googlegroups.com, vba...@suse.cz, z...@nvidia.com
syzbot suspects this issue was fixed by commit:

commit cf1b80dc31a1137b8b4568c138b453bf7453204a
Author: Dev Jain <dev....@arm.com>
Date: Wed Aug 6 14:56:11 2025 +0000

mm: pass page directly instead of using folio_page

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11f121e2580000
start commit: 0227b49b5027 Merge tag 'gpio-updates-for-v6.17-rc1-part2' ..
git tree: upstream
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: mm: pass page directly instead of using folio_page
Reply all
Reply to author
Forward
0 new messages