[v6.1] kernel BUG in __phys_addr

5 views
Skip to first unread message

syzbot

unread,
May 9, 2023, 6:09:52 AM5/9/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ca48fc16c493 Linux 6.1.27
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17bdee46280000
kernel config: https://syzkaller.appspot.com/x/.config?x=47d3bbfdb3b1ddd2
dashboard link: https://syzkaller.appspot.com/bug?extid=f9abe8ca9de083ef3c5b
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/658765c915fa/disk-ca48fc16.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d69e8a1aff2d/vmlinux-ca48fc16.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0317a9546209/bzImage-ca48fc16.xz

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

loop2: detected capacity change from 0 to 4096
ntfs3: loop2: Different NTFS' sector size (4096) and media sector size (512)
------------[ cut here ]------------
kernel BUG at arch/x86/mm/physaddr.c:28!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 28784 Comm: syz-executor.2 Not tainted 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
RIP: 0010:__phys_addr+0x151/0x170 arch/x86/mm/physaddr.c:28
Code: 45 9e a2 00 e9 41 ff ff ff e8 5b 58 4c 00 48 c7 c7 80 d3 d9 8c 4c 89 f6 4c 89 fa e8 19 92 21 03 e9 49 ff ff ff e8 3f 58 4c 00 <0f> 0b e8 38 58 4c 00 0f 0b e8 31 58 4c 00 0f 0b 66 2e 0f 1f 84 00
RSP: 0018:ffffc90014b478b8 EFLAGS: 00010283
RAX: ffffffff813d7081 RBX: dead4ead80000000 RCX: 0000000000040000
RDX: ffffc90003e81000 RSI: 00000000000071cf RDI: 00000000000071d0
RBP: dffffc0000000000 R08: ffffffff813d6f77 R09: ffff888087f30990
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff888087f309d8
R13: ffffffff8b1e6e30 R14: deadc62d00000000 R15: dffffc0000000000
FS: 00007fce9b132700(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f3473c86000 CR3: 000000003f5b2000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
virt_to_folio include/linux/mm.h:896 [inline]
kfree+0x42/0x190 mm/slab_common.c:999
run_close fs/ntfs3/ntfs_fs.h:930 [inline]
indx_clear+0x3a/0x80 fs/ntfs3/index.c:813
ni_clear+0x205/0x3d0 fs/ntfs3/frecord.c:121
evict+0x2a4/0x620 fs/inode.c:664
ntfs_loadlog_and_replay+0x2d9/0x530 fs/ntfs3/fsntfs.c:301
ntfs_fill_super+0x2505/0x4500 fs/ntfs3/super.c:1018
get_tree_bdev+0x3fe/0x620 fs/super.c:1346
vfs_get_tree+0x88/0x270 fs/super.c:1553
do_new_mount+0x28b/0xad0 fs/namespace.c:3040
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fce9a48d69a
Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 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:00007fce9b131f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 000000000001f233 RCX: 00007fce9a48d69a
RDX: 0000000020002380 RSI: 0000000020000180 RDI: 00007fce9b131fe0
RBP: 00007fce9b132020 R08: 00007fce9b132020 R09: 0000000000000013
R10: 0000000000000013 R11: 0000000000000202 R12: 0000000020002380
R13: 0000000020000180 R14: 00007fce9b131fe0 R15: 0000000020002280
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__phys_addr+0x151/0x170 arch/x86/mm/physaddr.c:28
Code: 45 9e a2 00 e9 41 ff ff ff e8 5b 58 4c 00 48 c7 c7 80 d3 d9 8c 4c 89 f6 4c 89 fa e8 19 92 21 03 e9 49 ff ff ff e8 3f 58 4c 00 <0f> 0b e8 38 58 4c 00 0f 0b e8 31 58 4c 00 0f 0b 66 2e 0f 1f 84 00
RSP: 0018:ffffc90014b478b8 EFLAGS: 00010283
RAX: ffffffff813d7081 RBX: dead4ead80000000 RCX: 0000000000040000
RDX: ffffc90003e81000 RSI: 00000000000071cf RDI: 00000000000071d0
RBP: dffffc0000000000 R08: ffffffff813d6f77 R09: ffff888087f30990
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff888087f309d8
R13: ffffffff8b1e6e30 R14: deadc62d00000000 R15: dffffc0000000000
FS: 00007fce9b132700(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020129030 CR3: 000000003f5b2000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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 bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

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

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

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

syzbot

unread,
Jun 9, 2023, 3:35:56 AM6/9/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 76ba310227d2 Linux 6.1.32
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11789ee9280000
kernel config: https://syzkaller.appspot.com/x/.config?x=662f56cd322cfd0e
dashboard link: https://syzkaller.appspot.com/bug?extid=f9abe8ca9de083ef3c5b
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107bba3b280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11169b59280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/18131e2f7e2f/disk-76ba3102.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d71316d229b0/vmlinux-76ba3102.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f0de40c3e8b5/bzImage-76ba3102.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/eac6860f36c9/mount_0.gz

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

loop0: detected capacity change from 0 to 4096
ntfs3: loop0: Different NTFS' sector size (4096) and media sector size (512)
------------[ cut here ]------------
kernel BUG at arch/x86/mm/physaddr.c:28!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 3538 Comm: syz-executor182 Not tainted 6.1.32-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
RIP: 0010:__phys_addr+0x151/0x170 arch/x86/mm/physaddr.c:28
Code: 15 ac a2 00 e9 41 ff ff ff e8 0b 65 4c 00 48 c7 c7 40 d4 d9 8c 4c 89 f6 4c 89 fa e8 59 fd 21 03 e9 49 ff ff ff e8 ef 64 4c 00 <0f> 0b e8 e8 64 4c 00 0f 0b e8 e1 64 4c 00 0f 0b 66 2e 0f 1f 84 00
RSP: 0018:ffffc900039ff8b8 EFLAGS: 00010293
RAX: ffffffff813d7081 RBX: dead4ead80000000 RCX: ffff8880221c3b80
RDX: 0000000000000000 RSI: dead4ead80000000 RDI: deadc62d00000000
RBP: dffffc0000000000 R08: ffffffff813d6f77 R09: ffff8880738f9850
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff8880738f9898
R13: ffffffff8b1e7430 R14: deadc62d00000000 R15: dffffc0000000000
FS: 0000555555b7f300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd9a9f5000 CR3: 0000000023984000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
virt_to_folio include/linux/mm.h:896 [inline]
kfree+0x42/0x190 mm/slab_common.c:999
run_close fs/ntfs3/ntfs_fs.h:931 [inline]
indx_clear+0x3a/0x80 fs/ntfs3/index.c:821
ni_clear+0x205/0x3d0 fs/ntfs3/frecord.c:121
evict+0x2a4/0x620 fs/inode.c:664
ntfs_loadlog_and_replay+0x2d9/0x530 fs/ntfs3/fsntfs.c:301
ntfs_fill_super+0x2505/0x4500 fs/ntfs3/super.c:1018
get_tree_bdev+0x3fe/0x620 fs/super.c:1346
vfs_get_tree+0x88/0x270 fs/super.c:1553
do_new_mount+0x28b/0xae0 fs/namespace.c:3040
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f38b3c8eaba
Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd9a9f4a48 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f38b3c8eaba
RDX: 0000000020002380 RSI: 0000000020000180 RDI: 00007ffd9a9f4a50
RBP: 00007ffd9a9f4a50 R08: 00007ffd9a9f4a90 R09: 000000000001f22c
R10: 0000000000000013 R11: 0000000000000286 R12: 0000000000000004
R13: 0000555555b7f2c0 R14: 00007ffd9a9f4a90 R15: 0000000000000000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__phys_addr+0x151/0x170 arch/x86/mm/physaddr.c:28
Code: 15 ac a2 00 e9 41 ff ff ff e8 0b 65 4c 00 48 c7 c7 40 d4 d9 8c 4c 89 f6 4c 89 fa e8 59 fd 21 03 e9 49 ff ff ff e8 ef 64 4c 00 <0f> 0b e8 e8 64 4c 00 0f 0b e8 e1 64 4c 00 0f 0b 66 2e 0f 1f 84 00
RSP: 0018:ffffc900039ff8b8 EFLAGS: 00010293
RAX: ffffffff813d7081 RBX: dead4ead80000000 RCX: ffff8880221c3b80
RDX: 0000000000000000 RSI: dead4ead80000000 RDI: deadc62d00000000
RBP: dffffc0000000000 R08: ffffffff813d6f77 R09: ffff8880738f9850
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff8880738f9898
R13: ffffffff8b1e7430 R14: deadc62d00000000 R15: dffffc0000000000
FS: 0000555555b7f300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd9a9f5000 CR3: 0000000023984000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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.

syzbot

unread,
Jul 17, 2023, 4:49:29 AM7/17/23
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit a8eaa9a06addbd9cb0238cb1c729921ecbb6504c
Author: Edward Lo <edwa...@ambergroup.io>
Date: Sat Nov 5 15:39:44 2022 +0000

fs/ntfs3: Validate MFT flags before replaying logs

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=162e351ea80000
start commit: 76ba310227d2 Linux 6.1.32
git tree: linux-6.1.y
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: fs/ntfs3: Validate MFT flags before replaying logs

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages