[syzbot] [fs?] WARNING in pagemap_scan_pmd_entry (2)

From: syzbot
Date: Fri Feb 09 2024 - 13:52:54 EST


syzbot found the following issue on:

HEAD commit: 547ab8fc4cb0 Merge tag 'loongarch-fixes-6.8-2' of git://gi..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=146d3360180000
kernel config: https://syzkaller.appspot.com/x/.config?x=3d64aaed894826fe
dashboard link: https://syzkaller.appspot.com/bug?extid=0748a3a1931714d970d0
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107153c4180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17b1c918180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/baf9b6ea7fce/disk-547ab8fc.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4387f7514b49/vmlinux-547ab8fc.xz
kernel image: https://storage.googleapis.com/syzbot-assets/26bbd5d6cf3a/bzImage-547ab8fc.xz

The issue was bisected to:

commit 12f6b01a0bcbeeab8cc9305673314adb3adf80f7
Author: Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx>
Date: Mon Aug 21 14:15:15 2023 +0000

fs/proc/task_mmu: add fast paths to get/clear PAGE_IS_WRITTEN flag

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=126a175c180000
final oops: https://syzkaller.appspot.com/x/report.txt?x=116a175c180000
console output: https://syzkaller.appspot.com/x/log.txt?x=166a175c180000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0748a3a1931714d970d0@xxxxxxxxxxxxxxxxxxxxxxxxx
Fixes: 12f6b01a0bcb ("fs/proc/task_mmu: add fast paths to get/clear PAGE_IS_WRITTEN flag")

------------[ cut here ]------------
WARNING: CPU: 1 PID: 5069 at arch/x86/include/asm/pgtable.h:404 pte_uffd_wp arch/x86/include/asm/pgtable.h:404 [inline]
WARNING: CPU: 1 PID: 5069 at arch/x86/include/asm/pgtable.h:404 pagemap_scan_pmd_entry+0xa15/0x2e10 fs/proc/task_mmu.c:2195
Modules linked in:
CPU: 1 PID: 5069 Comm: syz-executor103 Not tainted 6.8.0-rc3-syzkaller-00041-g547ab8fc4cb0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
RIP: 0010:pte_uffd_wp arch/x86/include/asm/pgtable.h:404 [inline]
RIP: 0010:pagemap_scan_pmd_entry+0xa15/0x2e10 fs/proc/task_mmu.c:2195
Code: 2d 67 ff 83 e3 42 bf 40 00 00 00 48 89 de e8 b2 32 67 ff 48 83 fb 40 0f 85 6d fe ff ff e8 c3 2d 67 ff eb 05 e8 bc 2d 67 ff 90 <0f> 0b 90 e9 5d fe ff ff e8 ae 2d 67 ff 31 c0 48 89 44 24 20 4d 89
RSP: 0018:ffffc9000395f5c0 EFLAGS: 00010293
RAX: ffffffff822c3974 RBX: 07ffffffffff040a RCX: ffff888023abbb80
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000
RBP: ffffc9000395f830 R08: ffffffff822c393b R09: fffff5200072be88
R10: dffffc0000000000 R11: fffff5200072be88 R12: dffffc0000000000
R13: 000000002007d000 R14: ffffc9000395f740 R15: ffff888023eef3e0
FS: 000055555572c380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200007c8 CR3: 0000000075868000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
walk_pmd_range mm/pagewalk.c:143 [inline]
walk_pud_range mm/pagewalk.c:221 [inline]
walk_p4d_range mm/pagewalk.c:256 [inline]
walk_pgd_range+0xba1/0x17e0 mm/pagewalk.c:293
__walk_page_range+0x132/0x720 mm/pagewalk.c:395
walk_page_range+0x4c8/0x6c0 mm/pagewalk.c:521
do_pagemap_scan fs/proc/task_mmu.c:2471 [inline]
do_pagemap_cmd+0xb11/0x1340 fs/proc/task_mmu.c:2513
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl+0xfc/0x170 fs/ioctl.c:857
RIP: 0033:0x7f948bf61b69
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffffdc7d4d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffffdc7d510 RCX: 00007f948bf61b69
RDX: 00000000200007c0 RSI: 00000000c0606610 RDI: 0000000000000004
RBP: 00007ffffdc7d510 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffffdc7d4f0 R14: 0000000000000001 R15: 0000000000000001

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 syzkaller@xxxxxxxxxxxxxxxx.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection

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