syzbot


WARNING in __virt_to_phys (2)

Status: upstream: reported C repro on 2024/04/27 00:06
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+30c4e2d7a249cce8b266@syzkaller.appspotmail.com
First crash: 49d, last: 48d
Fix bisection: failed (error log, bisect log)
  
Bug presence (2)
Date Name Commit Repro Result
2024/04/27 linux-6.1.y (ToT) 6741e066ec76 C [report] WARNING in __virt_to_phys
2024/04/27 upstream (ToT) 5eb4573ea63d C Didn't crash
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING in __virt_to_phys (2) ntfs3 C 2 403d 399d 0/27 auto-obsoleted due to no activity on 2023/08/23 09:02
linux-6.1 WARNING in __virt_to_phys origin:lts-only C done 1 394d 401d 3/3 fixed on 2023/06/19 12:27
upstream WARNING in __virt_to_phys (3) bcachefs C 447 10d 43d 26/27 fixed on 2024/06/05 13:52
linux-5.15 WARNING in __virt_to_phys origin:lts-only C error 4 48d 397d 0/3 upstream: reported C repro on 2023/05/14 19:50
upstream WARNING in __virt_to_phys nilfs C 19 551d 635d 0/27 closed as dup on 2022/09/19 06:44

Sample crash report:
loop0: detected capacity change from 0 to 4096
------------[ cut here ]------------
virt_to_phys used for non-linear address: 0000000029a40bb7 (0xffff80001f109000)
WARNING: CPU: 0 PID: 4221 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x84/0x9c arch/arm64/mm/physaddr.c:17
Modules linked in:
CPU: 0 PID: 4221 Comm: syz-executor309 Not tainted 6.1.87-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
pstate: 60401005 (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 : ffff80001e3078e0
x29: ffff80001e3078e0 x28: 1ffff00002b09aa9 x27: dfff800000000000
x26: 0000000000000002 x25: 1fffe0001976a4cf x24: dfff800000000000
x23: dfff800000000000 x22: ffff0000d7d44900 x21: 0000000000040000
x20: 000080001f109000 x19: ffff80001f109000 x18: ffff80001e306ce0
x17: 6666783028203762 x16: ffff80001215c9dc x15: 0000000000000000
x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000000001
x11: 0000000000ff0100 x10: 0000000000000000 x9 : e33d9ce777365600
x8 : ffff800015262000 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff80001e3071d8 x4 : ffff800015932b00 x3 : ffff80000858856c
x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000
Call trace:
 __virt_to_phys+0x84/0x9c arch/arm64/mm/physaddr.c:17
 virt_to_folio include/linux/mm.h:898 [inline]
 kfree+0x90/0x1b8 mm/slab_common.c:999
 put_ntfs+0x80/0x240 fs/ntfs3/super.c:444
 ntfs_put_super+0xbc/0x10c fs/ntfs3/super.c:486
 generic_shutdown_super+0x130/0x328 fs/super.c:501
 kill_block_super+0x70/0xdc fs/super.c:1459
 deactivate_locked_super+0xac/0x124 fs/super.c:332
 deactivate_super+0xf0/0x110 fs/super.c:363
 cleanup_mnt+0x394/0x41c fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0x240/0x2f0 kernel/task_work.c:179
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0x554/0x1a88 kernel/exit.c:869
 do_group_exit+0x194/0x22c kernel/exit.c:1019
 __do_sys_exit_group kernel/exit.c:1030 [inline]
 __se_sys_exit_group kernel/exit.c:1028 [inline]
 __wake_up_parent+0x0/0x60 kernel/exit.c:1028
 __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:585
irq event stamp: 44798
hardirqs last  enabled at (44797): [<ffff800008343d08>] __up_console_sem+0xb4/0x100 kernel/printk/printk.c:261
hardirqs last disabled at (44798): [<ffff800012158694>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:405
softirqs last  enabled at (43316): [<ffff800008020d7c>] softirq_handle_end kernel/softirq.c:414 [inline]
softirqs last  enabled at (43316): [<ffff800008020d7c>] __do_softirq+0xc1c/0xe38 kernel/softirq.c:600
softirqs last disabled at (43311): [<ffff80000802a99c>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 4221 at mm/slab_common.c:923 free_large_kmalloc+0x34/0x15c mm/slab_common.c:924
Modules linked in:
CPU: 0 PID: 4221 Comm: syz-executor309 Tainted: G        W          6.1.87-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
pstate: 60401005 (nZCv daif +PAN -UAO -TCO -DIT +SSBS BTYPE=--)
pc : free_large_kmalloc+0x34/0x15c mm/slab_common.c:924
lr : kfree+0x10c/0x1b8 mm/slab_common.c:1001
sp : ffff80001e3078d0
x29: ffff80001e3078d0 x28: 1ffff00002b09aa9 x27: dfff800000000000
x26: 0000000000000002 x25: 1fffe0001976a4cf x24: dfff800000000000
x23: dfff800000000000 x22: ffff0000d7d44900 x21: ffff800008812394
x20: ffff80001f109000 x19: fffffc0005edc240 x18: ffff80001e306ce0
x17: 6666783028203762 x16: ffff80001215c9dc x15: 0000000000000000
x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000000001
x11: 0000000000ff0100 x10: 0000000000000000 x9 : 0000000005edc240
x8 : ffff800018178000 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff80001e3071d8 x4 : ffff800015932b00 x3 : ffff80000858856c
x2 : 0000000000000001 x1 : ffff80001f109000 x0 : fffffc0005edc240
Call trace:
 free_large_kmalloc+0x34/0x15c mm/slab_common.c:924
 kfree+0x10c/0x1b8 mm/slab_common.c:1001
 put_ntfs+0x80/0x240 fs/ntfs3/super.c:444
 ntfs_put_super+0xbc/0x10c fs/ntfs3/super.c:486
 generic_shutdown_super+0x130/0x328 fs/super.c:501
 kill_block_super+0x70/0xdc fs/super.c:1459
 deactivate_locked_super+0xac/0x124 fs/super.c:332
 deactivate_super+0xf0/0x110 fs/super.c:363
 cleanup_mnt+0x394/0x41c fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0x240/0x2f0 kernel/task_work.c:179
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0x554/0x1a88 kernel/exit.c:869
 do_group_exit+0x194/0x22c kernel/exit.c:1019
 __do_sys_exit_group kernel/exit.c:1030 [inline]
 __se_sys_exit_group kernel/exit.c:1028 [inline]
 __wake_up_parent+0x0/0x60 kernel/exit.c:1028
 __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:585
irq event stamp: 44822
hardirqs last  enabled at (44821): [<ffff80001215aaa8>] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:84 [inline]
hardirqs last  enabled at (44821): [<ffff80001215aaa8>] exit_to_kernel_mode+0xe8/0x118 arch/arm64/kernel/entry-common.c:94
hardirqs last disabled at (44822): [<ffff800012158694>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:405
softirqs last  enabled at (44816): [<ffff800008020d7c>] softirq_handle_end kernel/softirq.c:414 [inline]
softirqs last  enabled at (44816): [<ffff800008020d7c>] __do_softirq+0xc1c/0xe38 kernel/softirq.c:600
softirqs last disabled at (44803): [<ffff80000802a99c>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80
---[ end trace 0000000000000000 ]---
object pointer: 0x0000000029a40bb7
------------[ cut here ]------------
virt_to_phys used for non-linear address: 0000000029a40bb7 (0xffff80001f109000)
WARNING: CPU: 0 PID: 4221 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0x84/0x9c arch/arm64/mm/physaddr.c:17
Modules linked in:
CPU: 0 PID: 4221 Comm: syz-executor309 Tainted: G        W          6.1.87-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
pstate: 60401005 (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 : ffff80001e307870
x29: ffff80001e307870 x28: 1ffff00002b09aa9 x27: dfff800000000000
x26: 0000000000000002 x25: 1fffe0001976a4cf x24: dfff800000000000
x23: 0000000000040000 x22: ffff800015262000 x21: fffffc0000000000
x20: 000080001f109000 x19: ffff80001f109000 x18: ffff80001e306ce0
x17: 6666783028203762 x16: ffff80001215c9dc x15: 0000000000000000
x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000000001
x11: 0000000000ff0100 x10: 0000000000000000 x9 : e33d9ce777365600
x8 : ffff800015262000 x7 : 0000000000000001 x6 : 0000000000000001
x5 : ffff80001e307158 x4 : ffff800015932b00 x3 : ffff80000aa9158c
x2 : ffff0001b4357cd0 x1 : 0000000100000000 x0 : 0000000000000000
Call trace:
 __virt_to_phys+0x84/0x9c arch/arm64/mm/physaddr.c:17
 virt_to_head_page include/linux/mm.h:891 [inline]
 ____kasan_kfree_large mm/kasan/common.c:252 [inline]
 __kasan_kfree_large+0x34/0xc0 mm/kasan/common.c:272
 kasan_kfree_large include/linux/kasan.h:185 [inline]
 free_large_kmalloc+0x70/0x15c mm/slab_common.c:927
 kfree+0x10c/0x1b8 mm/slab_common.c:1001
 put_ntfs+0x80/0x240 fs/ntfs3/super.c:444
 ntfs_put_super+0xbc/0x10c fs/ntfs3/super.c:486
 generic_shutdown_super+0x130/0x328 fs/super.c:501
 kill_block_super+0x70/0xdc fs/super.c:1459
 deactivate_locked_super+0xac/0x124 fs/super.c:332
 deactivate_super+0xf0/0x110 fs/super.c:363
 cleanup_mnt+0x394/0x41c fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0x240/0x2f0 kernel/task_work.c:179
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0x554/0x1a88 kernel/exit.c:869
 do_group_exit+0x194/0x22c kernel/exit.c:1019
 __do_sys_exit_group kernel/exit.c:1030 [inline]
 __se_sys_exit_group kernel/exit.c:1028 [inline]
 __wake_up_parent+0x0/0x60 kernel/exit.c:1028
 __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:585
irq event stamp: 45072
hardirqs last  enabled at (45071): [<ffff800008343d08>] __up_console_sem+0xb4/0x100 kernel/printk/printk.c:261
hardirqs last disabled at (45072): [<ffff800012158694>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:405
softirqs last  enabled at (45038): [<ffff800008020d7c>] softirq_handle_end kernel/softirq.c:414 [inline]
softirqs last  enabled at (45038): [<ffff800008020d7c>] __do_softirq+0xc1c/0xe38 kernel/softirq.c:600
softirqs last disabled at (44825): [<ffff80000802a99c>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80
---[ end trace 0000000000000000 ]---
==================================================================
BUG: KASAN: invalid-free in kfree+0x10c/0x1b8 mm/slab_common.c:1001
Free of addr ffff80001f109000 by task syz-executor309/4221

CPU: 0 PID: 4221 Comm: syz-executor309 Tainted: G        W          6.1.87-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x174/0x4c0 mm/kasan/report.c:395
 kasan_report_invalid_free+0xc4/0x114 mm/kasan/report.c:460
 __kasan_kfree_large+0xa4/0xc0 mm/kasan/common.c:272
 kasan_kfree_large include/linux/kasan.h:185 [inline]
 free_large_kmalloc+0x70/0x15c mm/slab_common.c:927
 kfree+0x10c/0x1b8 mm/slab_common.c:1001
 put_ntfs+0x80/0x240 fs/ntfs3/super.c:444
 ntfs_put_super+0xbc/0x10c fs/ntfs3/super.c:486
 generic_shutdown_super+0x130/0x328 fs/super.c:501
 kill_block_super+0x70/0xdc fs/super.c:1459
 deactivate_locked_super+0xac/0x124 fs/super.c:332
 deactivate_super+0xf0/0x110 fs/super.c:363
 cleanup_mnt+0x394/0x41c fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0x240/0x2f0 kernel/task_work.c:179
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0x554/0x1a88 kernel/exit.c:869
 do_group_exit+0x194/0x22c kernel/exit.c:1019
 __do_sys_exit_group kernel/exit.c:1030 [inline]
 __se_sys_exit_group kernel/exit.c:1028 [inline]
 __wake_up_parent+0x0/0x60 kernel/exit.c:1028
 __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:585

The buggy address belongs to the virtual mapping at
 [ffff80001f109000, ffff80001f90a000) created by:
 kvmalloc include/linux/slab.h:709 [inline]
 ntfs_fill_super+0x2870/0x3458 fs/ntfs3/super.c:1144

The buggy address belongs to the physical page:
page:00000000039e5e54 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10c031
flags: 0x5ffe00000000000(node=0|zone=2|lastcpupid=0xfff)
raw: 05ffe00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff80001f108f00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffff80001f108f80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffff80001f109000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                   ^
 ffff80001f109080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff80001f109100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
page:000000008b38237d refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1bb709
flags: 0x5ffe00000000000(node=0|zone=2|lastcpupid=0xfff)
raw: 05ffe00000000000 fffffc0005edc248 fffffc0005edc248 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
------------[ cut here ]------------
kernel BUG at include/linux/mm.h:765!
Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 4221 Comm: syz-executor309 Tainted: G    B   W          6.1.87-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
pstate: 80401005 (Nzcv daif +PAN -UAO -TCO -DIT +SSBS BTYPE=--)
pc : put_page_testzero include/linux/mm.h:765 [inline]
pc : __free_pages+0x15c/0x1cc mm/page_alloc.c:5635
lr : put_page_testzero include/linux/mm.h:765 [inline]
lr : __free_pages+0x15c/0x1cc mm/page_alloc.c:5635
sp : ffff80001e307890
x29: ffff80001e307890 x28: 1ffff00002b09aa9 x27: dfff800000000000
x26: 0000000000000002 x25: 1fffe0001976a4cf x24: dfff800000000000
x23: dfff800000000000 x22: 05ffe00000000000 x21: fffffc0005edc274
x20: 0000000000000000 x19: fffffc0005edc240 x18: 1fffe0003686f176
x17: 0000000000000000 x16: ffff80001215c9dc x15: 0000000000000000
x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000000001
x11: 0000000000ff0100 x10: 0000000000000000 x9 : ffff8000088364e4
x8 : ffff0000d6e59bc0 x7 : 0000000000000000 x6 : ffff800012227564
x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff80000aa9158c
x2 : ffff0001b4378cd0 x1 : 0000000100000000 x0 : 000000000000003e
Call trace:
 put_page_testzero include/linux/mm.h:765 [inline]
 __free_pages+0x15c/0x1cc mm/page_alloc.c:5635
 free_large_kmalloc+0xd0/0x15c mm/slab_common.c:932
 kfree+0x10c/0x1b8 mm/slab_common.c:1001
 put_ntfs+0x80/0x240 fs/ntfs3/super.c:444
 ntfs_put_super+0xbc/0x10c fs/ntfs3/super.c:486
 generic_shutdown_super+0x130/0x328 fs/super.c:501
 kill_block_super+0x70/0xdc fs/super.c:1459
 deactivate_locked_super+0xac/0x124 fs/super.c:332
 deactivate_super+0xf0/0x110 fs/super.c:363
 cleanup_mnt+0x394/0x41c fs/namespace.c:1186
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193
 task_work_run+0x240/0x2f0 kernel/task_work.c:179
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0x554/0x1a88 kernel/exit.c:869
 do_group_exit+0x194/0x22c kernel/exit.c:1019
 __do_sys_exit_group kernel/exit.c:1030 [inline]
 __se_sys_exit_group kernel/exit.c:1028 [inline]
 __wake_up_parent+0x0/0x60 kernel/exit.c:1028
 __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:585
Code: 9004d481 913a0021 aa1303e0 97fdce19 (d4210000) 
---[ end trace 0000000000000000 ]---

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/27 00:31 linux-6.1.y 6741e066ec76 059e9963 .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
2024/04/27 21:33 linux-6.1.y f2295faba5e8 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING in __virt_to_phys
2024/04/27 00:06 linux-6.1.y 6741e066ec76 059e9963 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING in __virt_to_phys
* Struck through repros no longer work on HEAD.