syzbot


WARNING in __virt_to_phys

Status: fixed on 2023/06/19 12:27
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+34c5a5c79057eff2e8fa@syzkaller.appspotmail.com
Fix commit: a8eaa9a06add fs/ntfs3: Validate MFT flags before replaying logs
First crash: 578d, last: 571d
Fix bisection: fixed by (bisect log) :
commit a8eaa9a06addbd9cb0238cb1c729921ecbb6504c
Author: Edward Lo <edward.lo@ambergroup.io>
Date: Sat Nov 5 15:39:44 2022 +0000

  fs/ntfs3: Validate MFT flags before replaying logs

  
Bug presence (2)
Date Name Commit Repro Result
2023/05/18 linux-6.1.y (ToT) fa74641fb6b9 C [report] WARNING in __virt_to_phys
2023/05/18 upstream (ToT) 4d6d4c7f541d C Didn't crash
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING in __virt_to_phys (2) ntfs3 C 2 580d 576d 0/28 auto-obsoleted due to no activity on 2023/08/23 09:02
upstream WARNING in __virt_to_phys (4) bcachefs C 2 162d 158d 26/28 fixed on 2024/07/13 18:41
linux-6.1 WARNING in __virt_to_phys (2) origin:lts-only C inconclusive 3 226d 227d 0/3 upstream: reported C repro on 2024/04/27 00:06
upstream WARNING in __virt_to_phys (3) bcachefs C 447 187d 220d 25/28 fixed on 2024/06/05 13:52
upstream WARNING in __virt_to_phys (5) bcachefs 4 118d 114d 27/28 fixed on 2024/08/29 18:29
linux-5.15 WARNING in __virt_to_phys C error 4 62d 575d 0/3 upstream: reported C repro on 2023/05/14 19:50
upstream WARNING in __virt_to_phys nilfs C 19 729d 813d 0/28 closed as dup on 2022/09/19 06:44

Sample crash report:
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

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/11 14:54 linux-6.1.y ca48fc16c493 0fbd49f4 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 WARNING in __virt_to_phys
* Struck through repros no longer work on HEAD.