[syzbot] [mm?] WARNING in swap_cache_get_folio

1 view
Skip to first unread message

syzbot

unread,
Nov 11, 2025, 10:03:32 AM (17 hours ago) Nov 11
to ak...@linux-foundation.org, bao...@kernel.org, b...@redhat.com, chr...@kernel.org, kas...@tencent.com, linux-...@vger.kernel.org, linu...@kvack.org, nph...@gmail.com, shik...@huaweicloud.com, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ab40c92c74c6 Add linux-next specific files for 20251110
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=17f69a58580000
kernel config: https://syzkaller.appspot.com/x/.config?x=84a798f69f994783
dashboard link: https://syzkaller.appspot.com/bug?extid=d7bc9ec4a100437aa7a2
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/34ed0f0c2fd0/disk-ab40c92c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a781fa106d0c/vmlinux-ab40c92c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/367c75242dc9/bzImage-ab40c92c.xz

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

------------[ cut here ]------------
WARNING: mm/swap.h:87 at __swap_offset_to_cluster mm/swap.h:87 [inline], CPU#0: swapoff/15184
WARNING: mm/swap.h:87 at __swap_entry_to_cluster mm/swap.h:93 [inline], CPU#0: swapoff/15184
WARNING: mm/swap.h:87 at swap_cache_get_folio+0x365/0x530 mm/swap_state.c:94, CPU#0: swapoff/15184
Modules linked in:
CPU: 0 UID: 0 PID: 15184 Comm: swapoff Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
RIP: 0010:__swap_offset_to_cluster mm/swap.h:87 [inline]
RIP: 0010:__swap_entry_to_cluster mm/swap.h:93 [inline]
RIP: 0010:swap_cache_get_folio+0x365/0x530 mm/swap_state.c:94
Code: ff 31 ed e9 2a ff ff ff e8 a8 d5 a2 ff 90 0f 0b 90 e9 3d fd ff ff e8 9a d5 a2 ff 90 0f 0b 90 e9 44 fd ff ff e8 8c d5 a2 ff 90 <0f> 0b 90 e9 6b fd ff ff 44 89 f1 80 e1 07 80 c1 03 38 c1 0f 8c 3e
RSP: 0018:ffffc90003237a40 EFLAGS: 00010293
RAX: ffffffff821e8784 RBX: 00000000000001ff RCX: ffff88802e633d00
RDX: 0000000000000000 RSI: 0000000000007a12 RDI: 0003ffffffffffff
RBP: ffffffff99cad4e0 R08: 0000000000000000 R09: ffffffff82139c79
R10: dffffc0000000000 R11: fffff9400022a327 R12: ffff8880317bf000
R13: dffffc0000000000 R14: 0000000000007a12 R15: 0003ffffffffffff
FS: 00007f3bed90fc80(0000) GS:ffff888125a83000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005640123d7005 CR3: 0000000034d9a000 CR4: 00000000003526f0
Call Trace:
<TASK>
unuse_pte_range mm/swapfile.c:2282 [inline]
unuse_pmd_range mm/swapfile.c:2332 [inline]
unuse_pud_range mm/swapfile.c:2352 [inline]
unuse_p4d_range mm/swapfile.c:2372 [inline]
unuse_vma mm/swapfile.c:2393 [inline]
unuse_mm mm/swapfile.c:2411 [inline]
try_to_unuse+0xd6f/0x2ce0 mm/swapfile.c:2488
__do_sys_swapoff mm/swapfile.c:2884 [inline]
__se_sys_swapoff+0x431/0xa10 mm/swapfile.c:2824
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f3bedad6ed7
Code: 00 66 90 48 83 fe 01 48 8b 15 1d 1f 0d 00 19 c0 83 e0 f0 83 c0 26 64 89 02 b8 ff ff ff ff c3 0f 1f 40 00 b8 a8 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f1 1e 0d 00 f7 d8 64 89 01 48
RSP: 002b:00007ffd9a359118 EFLAGS: 00000246 ORIG_RAX: 00000000000000a8
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f3bedad6ed7
RDX: 0000564029c35a70 RSI: 00007f3bedc5c4e8 RDI: 0000564029c35a20
RBP: 0000564029c35a20 R08: 0000000000000100 R09: 00007f3bedba9ac0
R10: 0000000000000004 R11: 0000000000000246 R12: 00007ffd9a359338
R13: 0000564029c352a0 R14: 00007f3bedcb9000 R15: 00005640123d8d98
</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 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

Kairui Song

unread,
Nov 11, 2025, 11:18:34 AM (15 hours ago) Nov 11
to syzbot, ak...@linux-foundation.org, chr...@kernel.org, bao...@kernel.org, b...@redhat.com, linux-...@vger.kernel.org, linu...@kvack.org, nph...@gmail.com, shik...@huaweicloud.com, syzkall...@googlegroups.com
Hmm, I think this might be also related to the soft leaf entry changes
recently, unuse_pte_range calls leafent_from_pte and passes the entry
from it to swap_cache_get_folio. In V2/V1 of softleaf (which is being
tested here) leafent_from_pte returns an invalid entry if the process
exit / unmap raced with swapoff.

The recent swap table series added some sanity checks and triggers a
WARN if the entry is invalid so we are seeing this. Softleaf v3 might
have fixed it.

Just guessing now. I'll also try review the code again in case I
missed anything...
Reply all
Reply to author
Forward
0 new messages