[v6.1] WARNING in __virt_to_phys

2 views
Skip to first unread message

syzbot

unread,
May 11, 2023, 10:56:07 AM5/11/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=14386092280000
kernel config: https://syzkaller.appspot.com/x/.config?x=aea4bb7802570997
dashboard link: https://syzkaller.appspot.com/bug?extid=34c5a5c79057eff2e8fa
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13494f82280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1027ad42280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ec11c1903c52/disk-ca48fc16.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8ce41c1ad391/vmlinux-ca48fc16.xz
kernel image: https://storage.googleapis.com/syzbot-assets/affba5631cad/Image-ca48fc16.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/1f1c5a1f809a/mount_0.gz

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

ntfs3: loop0: Different NTFS' sector size (4096) and media sector size (512)
------------[ cut here ]------------
virt_to_phys used for non-linear address: 0000000070d4a3bd (0xdead4ead00000000)
WARNING: CPU: 0 PID: 4217 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x84/0x9c arch/arm64/mm/physaddr.c:17
Modules linked in:
CPU: 0 PID: 4217 Comm: syz-executor424 Not tainted 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __virt_to_phys+0x84/0x9c arch/arm64/mm/physaddr.c:17
lr : __virt_to_phys+0x80/0x9c arch/arm64/mm/physaddr.c:12
sp : ffff80001d937510
x29: ffff80001d937510 x28: 1fffe0001c481433 x27: dfff800000000000
x26: 1fffe0001c481431 x25: dfff800000000000 x24: ffff800012542b20
x23: ffff8000096a5670 x22: ffff0000e240a0a8 x21: 0000000000040000
x20: deae4ead00000000 x19: dead4ead00000000 x18: 1fffe000368b6776
x17: ffff80001558d000 x16: ffff8000083042f0 x15: ffff0001b45b3bbc
x14: 1ffff00002ab20b0 x13: dfff800000000000 x12: 0000000000000001
x11: 1fffe0001af7f190 x10: 0000000000000000 x9 : ba8fed6b568d5900
x8 : ffff800014fa7000 x7 : ffff80000827b588 x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000001 x3 : ffff800008269190
x2 : 0000000000000001 x1 : 0000000000000004 x0 : 0000000000000001
Call trace:
__virt_to_phys+0x84/0x9c arch/arm64/mm/physaddr.c:17
virt_to_folio include/linux/mm.h:896 [inline]
kfree+0x90/0x1b8 mm/slab_common.c:999
kvfree+0x40/0x50 mm/util.c:627
run_close fs/ntfs3/ntfs_fs.h:930 [inline]
indx_clear+0x44/0x94 fs/ntfs3/index.c:813
ni_clear+0x248/0x4f0 fs/ntfs3/frecord.c:121
ntfs_evict_inode+0x90/0xc8 fs/ntfs3/inode.c:1762
evict+0x260/0x68c fs/inode.c:664
iput_final fs/inode.c:1747 [inline]
iput+0x7c0/0x8a4 fs/inode.c:1773
ntfs_loadlog_and_replay+0x248/0x448 fs/ntfs3/fsntfs.c:301
ntfs_fill_super+0x1e60/0x3a04 fs/ntfs3/super.c:1018
get_tree_bdev+0x360/0x54c fs/super.c:1346
ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1359
vfs_get_tree+0x90/0x274 fs/super.c:1553
do_new_mount+0x25c/0x8c8 fs/namespace.c:3040
path_mount+0x590/0xe58 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3568
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
irq event stamp: 27940
hardirqs last enabled at (27939): [<ffff80000827b628>] raw_spin_rq_unlock_irq kernel/sched/sched.h:1367 [inline]
hardirqs last enabled at (27939): [<ffff80000827b628>] finish_lock_switch+0xbc/0x1e8 kernel/sched/core.c:5000
hardirqs last disabled at (27940): [<ffff8000120e200c>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:405
softirqs last enabled at (27932): [<ffff800008020d74>] softirq_handle_end kernel/softirq.c:414 [inline]
softirqs last enabled at (27932): [<ffff800008020d74>] __do_softirq+0xc14/0xea0 kernel/softirq.c:600
softirqs last disabled at (27919): [<ffff80000802a948>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:79
---[ end trace 0000000000000000 ]---
Unable to handle kernel paging request at virtual address 007ab33ab9738008
Mem abort info:
ESR = 0x0000000096000004
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x04: level 0 translation fault
Data abort info:
ISV = 0, ISS = 0x00000004
CM = 0, WnR = 0
[007ab33ab9738008] address between user and kernel address ranges
Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 4217 Comm: syz-executor424 Tainted: G W 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : _compound_head include/linux/page-flags.h:253 [inline]
pc : virt_to_folio include/linux/mm.h:898 [inline]
pc : kfree+0xa4/0x1b8 mm/slab_common.c:999
lr : virt_to_folio include/linux/mm.h:896 [inline]
lr : kfree+0x90/0x1b8 mm/slab_common.c:999
sp : ffff80001d937530
x29: ffff80001d937530 x28: 1fffe0001c481433 x27: dfff800000000000
x26: 1fffe0001c481431 x25: dfff800000000000 x24: ffff800012542b20
x23: ffff8000096a5670 x22: ffff0000e240a0a8 x21: 0000000000040000
x20: ffff8000087e5028 x19: dead4ead00000000 x18: 1fffe000368b6776
x17: ffff80001558d000 x16: ffff8000083042f0 x15: ffff0001b45b3bbc
x14: 1ffff00002ab20b0 x13: dfff800000000000 x12: 0000000000000001
x11: 1fffe0001af7f190 x10: 0000000000000000 x9 : 037ab73ab9738000
x8 : fffffc0000000000 x7 : ffff80000827b588 x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000001 x3 : ffff800008269190
x2 : 0000000000000001 x1 : 0000000000000004 x0 : 037ab33ab9738000
Call trace:
virt_to_folio include/linux/mm.h:896 [inline]
kfree+0xa4/0x1b8 mm/slab_common.c:999
kvfree+0x40/0x50 mm/util.c:627
run_close fs/ntfs3/ntfs_fs.h:930 [inline]
indx_clear+0x44/0x94 fs/ntfs3/index.c:813
ni_clear+0x248/0x4f0 fs/ntfs3/frecord.c:121
ntfs_evict_inode+0x90/0xc8 fs/ntfs3/inode.c:1762
evict+0x260/0x68c fs/inode.c:664
iput_final fs/inode.c:1747 [inline]
iput+0x7c0/0x8a4 fs/inode.c:1773
ntfs_loadlog_and_replay+0x248/0x448 fs/ntfs3/fsntfs.c:301
ntfs_fill_super+0x1e60/0x3a04 fs/ntfs3/super.c:1018
get_tree_bdev+0x360/0x54c fs/super.c:1346
ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1359
vfs_get_tree+0x90/0x274 fs/super.c:1553
do_new_mount+0x25c/0x8c8 fs/namespace.c:3040
path_mount+0x590/0xe58 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3568
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
Code: b25657e8 927acd29 cb151929 8b080120 (f9400408)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: b25657e8 mov x8, #0xfffffc0000000000 // #-4398046511104
4: 927acd29 and x9, x9, #0x3ffffffffffffc0
8: cb151929 sub x9, x9, x21, lsl #6
c: 8b080120 add x0, x9, x8
* 10: f9400408 ldr x8, [x0, #8] <-- trapping instruction


---
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 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 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,
May 14, 2023, 3:50:58 PM5/14/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: b0ece631f84a Linux 5.15.111
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14cf8c81280000
kernel config: https://syzkaller.appspot.com/x/.config?x=db3750b003ff805e
dashboard link: https://syzkaller.appspot.com/bug?extid=a137dc0ed2993337b385
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1662b606280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12d12b62280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/eded75b6c3f9/disk-b0ece631.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/20e5ae802010/vmlinux-b0ece631.xz
kernel image: https://storage.googleapis.com/syzbot-assets/05d665c869f3/Image-b0ece631.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/78b88345b578/mount_0.gz

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

ntfs3: loop0: Different NTFS' sector size (4096) and media sector size (512)
------------[ cut here ]------------
virt_to_phys used for non-linear address: 000000007f72f6e1 (0xdead4ead00000000)
WARNING: CPU: 1 PID: 3961 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x114/0x15c arch/arm64/mm/physaddr.c:12
Modules linked in:
CPU: 1 PID: 3961 Comm: syz-executor152 Not tainted 5.15.111-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __virt_to_phys+0x114/0x15c arch/arm64/mm/physaddr.c:12
lr : __virt_to_phys+0x114/0x15c arch/arm64/mm/physaddr.c:12
sp : ffff80001a177470
x29: ffff80001a177470 x28: 1fffe0001be81433 x27: dfff800000000000
x26: 1fffe0001be81431 x25: dfff800000000000 x24: ffff800011d7fb00
x23: ffff800016ebf000 x22: ffff800016ebf000 x21: 0000600000000000
x20: dead4ead00000000 x19: deae4ead00000000 x18: 0000000000000001
x17: ff808000083359dc x16: ffff800011948074 x15: ffff8000083359dc
x14: 00000000ffffffff x13: ffffffffffffffff x12: 0000000000000000
x11: ff8080000832c484 x10: 0000000000000000 x9 : e61a3def619cd400
x8 : e61a3def619cd400 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff80001a176bd8 x4 : ffff8000149afce0 x3 : ffff80000854d4e0
x2 : 0000000000000001 x1 : 0000000100000000 x0 : 000000000000004f
Call trace:
__virt_to_phys+0x114/0x15c arch/arm64/mm/physaddr.c:12
virt_to_head_page include/linux/mm.h:900 [inline]
kfree+0xd4/0x410 mm/slub.c:4554
kvfree+0x40/0x50 mm/util.c:654
run_close fs/ntfs3/ntfs_fs.h:930 [inline]
indx_clear+0x44/0x94 fs/ntfs3/index.c:821
ni_clear+0x1c4/0x390 fs/ntfs3/frecord.c:120
ntfs_evict_inode+0x90/0xc8 fs/ntfs3/inode.c:1780
evict+0x260/0x68c fs/inode.c:587
iput_final fs/inode.c:1663 [inline]
iput+0x744/0x824 fs/inode.c:1689
ntfs_loadlog_and_replay+0x248/0x448 fs/ntfs3/fsntfs.c:301
ntfs_fill_super+0x1a58/0x33ec fs/ntfs3/super.c:1013
get_tree_bdev+0x360/0x54c fs/super.c:1303
ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1354
vfs_get_tree+0x90/0x274 fs/super.c:1508
do_new_mount+0x25c/0x8c8 fs/namespace.c:2994
path_mount+0x590/0x104c fs/namespace.c:3324
do_mount fs/namespace.c:3337 [inline]
__do_sys_mount fs/namespace.c:3545 [inline]
__se_sys_mount fs/namespace.c:3522 [inline]
__arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3522
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
irq event stamp: 25608
hardirqs last enabled at (25607): [<ffff80000832a61c>] __up_console_sem+0xb4/0x100 kernel/printk/printk.c:257
hardirqs last disabled at (25608): [<ffff800011943708>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:387
softirqs last enabled at (24966): [<ffff800008020ccc>] softirq_handle_end kernel/softirq.c:401 [inline]
softirqs last enabled at (24966): [<ffff800008020ccc>] __do_softirq+0xb5c/0xe20 kernel/softirq.c:587
softirqs last disabled at (24951): [<ffff8000081b573c>] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline]
softirqs last disabled at (24951): [<ffff8000081b573c>] invoke_softirq kernel/softirq.c:439 [inline]
softirqs last disabled at (24951): [<ffff8000081b573c>] __irq_exit_rcu+0x28c/0x534 kernel/softirq.c:636
---[ end trace 359e002bd8e56e53 ]---
Unable to handle kernel paging request at virtual address 007ab33ab9c38008
Mem abort info:
ESR = 0x0000000096000004
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x04: level 0 translation fault
Data abort info:
ISV = 0, ISS = 0x00000004
CM = 0, WnR = 0
[007ab33ab9c38008] address between user and kernel address ranges
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 3961 Comm: syz-executor152 Tainted: G W 5.15.111-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : _compound_head include/linux/page-flags.h:196 [inline]
pc : virt_to_head_page include/linux/mm.h:902 [inline]
pc : kfree+0xe8/0x410 mm/slub.c:4554
lr : virt_to_head_page include/linux/mm.h:900 [inline]
lr : kfree+0xd4/0x410 mm/slub.c:4554
sp : ffff80001a1774a0
x29: ffff80001a1774d0 x28: 1fffe0001be81433 x27: dfff800000000000
x26: 1fffe0001be81431 x25: dfff800000000000 x24: ffff800011d7fb00
x23: ffff800016ebf000 x22: ffff0000df40a0a8 x21: ffff80000875e5c8
x20: 037ab33ab9c38000 x19: dead4ead00000000 x18: 0000000000000001
x17: ff808000083359dc x16: ffff800011948074 x15: ffff8000083359dc
x14: 00000000ffffffff x13: ffffffffffffffff x12: 0000000000000000
x11: ff80800008096268 x10: 0000000000000000 x9 : 037ab73ab9c38000
x8 : fffffc0000000000 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff80001a176bd8 x4 : ffff8000149afce0 x3 : ffff80000854d4e0
x2 : 0000000000000001 x1 : 0000600000000000 x0 : deadceaeb0e00000
Call trace:
virt_to_head_page include/linux/mm.h:900 [inline]
kfree+0xe8/0x410 mm/slub.c:4554
kvfree+0x40/0x50 mm/util.c:654
run_close fs/ntfs3/ntfs_fs.h:930 [inline]
indx_clear+0x44/0x94 fs/ntfs3/index.c:821
ni_clear+0x1c4/0x390 fs/ntfs3/frecord.c:120
ntfs_evict_inode+0x90/0xc8 fs/ntfs3/inode.c:1780
evict+0x260/0x68c fs/inode.c:587
iput_final fs/inode.c:1663 [inline]
iput+0x744/0x824 fs/inode.c:1689
ntfs_loadlog_and_replay+0x248/0x448 fs/ntfs3/fsntfs.c:301
ntfs_fill_super+0x1a58/0x33ec fs/ntfs3/super.c:1013
get_tree_bdev+0x360/0x54c fs/super.c:1303
ntfs_fs_get_tree+0x28/0x38 fs/ntfs3/super.c:1354
vfs_get_tree+0x90/0x274 fs/super.c:1508
do_new_mount+0x25c/0x8c8 fs/namespace.c:2994
path_mount+0x590/0x104c fs/namespace.c:3324
do_mount fs/namespace.c:3337 [inline]
__do_sys_mount fs/namespace.c:3545 [inline]
__se_sys_mount fs/namespace.c:3522 [inline]
__arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3522
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
Code: b25657e8 927acd29 cb141929 8b080134 (f9400688)
---[ end trace 359e002bd8e56e54 ]---
----------------
Code disassembly (best guess):
0: b25657e8 mov x8, #0xfffffc0000000000 // #-4398046511104
4: 927acd29 and x9, x9, #0x3ffffffffffffc0
8: cb141929 sub x9, x9, x20, lsl #6
c: 8b080134 add x20, x9, x8
* 10: f9400688 ldr x8, [x20, #8] <-- trapping instruction

syzbot

unread,
Jun 18, 2023, 11:36:29 PM6/18/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=149a69bb280000
start commit: ca48fc16c493 Linux 6.1.27
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