syzbot


KASAN: use-after-free Read in move_to_new_folio

Status: upstream: reported on 2026/01/02 00:15
Reported-by: syzbot+6a7fd5db88b6f52348c5@syzkaller.appspotmail.com
First crash: 11d, last: 11d
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in move_to_new_folio (3) mm 19 81 292d 439d 0/29 auto-obsoleted due to no activity on 2025/06/05 04:43
upstream KASAN: slab-use-after-free Read in move_to_new_folio (2) nilfs 19 8 566d 569d 0/29 closed as dup on 2024/07/21 08:13
upstream KASAN: slab-use-after-free Read in move_to_new_folio mm 19 1 923d 918d 0/29 auto-obsoleted due to no activity on 2023/10/13 09:28
upstream KASAN: slab-use-after-free Read in move_to_new_folio (4) gfs2 19 syz 21 81d 189d 0/29 upstream: reported syz repro on 2025/07/08 11:20

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in move_to_new_folio+0x1c0/0xb5c mm/migrate.c:950
Read of size 8 at addr ffff0000f71ed430 by task syz.1.125/5061

CPU: 0 PID: 5061 Comm: syz.1.125 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
 print_address_description+0x88/0x218 mm/kasan/report.c:316
 print_report+0x50/0x68 mm/kasan/report.c:420
 kasan_report+0xa8/0x100 mm/kasan/report.c:524
 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
 move_to_new_folio+0x1c0/0xb5c mm/migrate.c:950
 __migrate_folio_move mm/migrate.c:1199 [inline]
 migrate_folio_move mm/migrate.c:1297 [inline]
 migrate_pages_batch mm/migrate.c:1639 [inline]
 migrate_pages+0x259c/0x3bbc mm/migrate.c:1843
 compact_zone+0x2274/0x3c94 mm/compaction.c:2414
 compact_node+0x1d8/0x370 mm/compaction.c:2691
 compact_nodes mm/compaction.c:2707 [inline]
 sysctl_compaction_handler+0x88/0x108 mm/compaction.c:2749
 proc_sys_call_handler+0x3fc/0x69c fs/proc/proc_sysctl.c:602
 proc_sys_write+0x2c/0x3c fs/proc/proc_sysctl.c:628
 do_iter_readv_writev fs/read_write.c:-1 [inline]
 do_iter_write+0x530/0x91c fs/read_write.c:861
 vfs_writev fs/read_write.c:934 [inline]
 do_writev+0x1e0/0x380 fs/read_write.c:977
 __do_sys_writev fs/read_write.c:1050 [inline]
 __se_sys_writev fs/read_write.c:1047 [inline]
 __arm64_sys_writev+0x80/0x94 fs/read_write.c:1047
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x138 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

Allocated by task 4449:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
 kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505
 __kasan_slab_alloc+0x70/0x88 mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x74/0x43c mm/slab.h:737
 slab_alloc_node mm/slub.c:3359 [inline]
 slab_alloc mm/slub.c:3367 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3374 [inline]
 kmem_cache_alloc+0x234/0x318 mm/slub.c:3383
 gfs2_glock_get+0x208/0xc60 fs/gfs2/glock.c:1180
 gfs2_inode_lookup+0x1ec/0xab0 fs/gfs2/inode.c:135
 gfs2_dir_search+0x148/0x204 fs/gfs2/dir.c:1664
 gfs2_lookupi+0x3bc/0x58c fs/gfs2/inode.c:323
 gfs2_jindex_hold fs/gfs2/ops_fstype.c:609 [inline]
 init_journal+0x4a8/0x1e14 fs/gfs2/ops_fstype.c:753
 init_inodes+0xe0/0x2d4 fs/gfs2/ops_fstype.c:889
 gfs2_fill_super+0x122c/0x19ec fs/gfs2/ops_fstype.c:1246
 get_tree_bdev+0x358/0x544 fs/super.c:1366
 gfs2_get_tree+0x54/0x1b4 fs/gfs2/ops_fstype.c:1327
 vfs_get_tree+0x90/0x274 fs/super.c:1573
 do_new_mount+0x228/0x810 fs/namespace.c:3078
 path_mount+0x5b4/0xe78 fs/namespace.c:3408
 do_mount fs/namespace.c:3421 [inline]
 __do_sys_mount fs/namespace.c:3629 [inline]
 __se_sys_mount fs/namespace.c:3606 [inline]
 __arm64_sys_mount+0x49c/0x584 fs/namespace.c:3606
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x138 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

Last potentially related work creation:
 kasan_save_stack+0x40/0x70 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xc0/0xdc mm/kasan/generic.c:486
 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
 call_rcu+0x100/0x954 kernel/rcu/tree.c:2849
 gfs2_glock_free+0x910/0xc20 fs/gfs2/glock.c:178
 __gfs2_glock_put+0x254/0x51c fs/gfs2/glock.c:292
 gfs2_glock_put+0x48/0x58 fs/gfs2/glock.c:314
 gfs2_glock_put_eventually fs/gfs2/super.c:1257 [inline]
 gfs2_evict_inode+0xb78/0xe20 fs/gfs2/super.c:1534
 evict+0x3c8/0x810 fs/inode.c:705
 iput_final fs/inode.c:1834 [inline]
 iput+0x764/0x7f4 fs/inode.c:1860
 gfs2_jindex_free+0x2d0/0x380 fs/gfs2/super.c:75
 init_journal+0x7a0/0x1e14 fs/gfs2/ops_fstype.c:871
 init_inodes+0xe0/0x2d4 fs/gfs2/ops_fstype.c:889
 gfs2_fill_super+0x122c/0x19ec fs/gfs2/ops_fstype.c:1246
 get_tree_bdev+0x358/0x544 fs/super.c:1366
 gfs2_get_tree+0x54/0x1b4 fs/gfs2/ops_fstype.c:1327
 vfs_get_tree+0x90/0x274 fs/super.c:1573
 do_new_mount+0x228/0x810 fs/namespace.c:3078
 path_mount+0x5b4/0xe78 fs/namespace.c:3408
 do_mount fs/namespace.c:3421 [inline]
 __do_sys_mount fs/namespace.c:3629 [inline]
 __se_sys_mount fs/namespace.c:3606 [inline]
 __arm64_sys_mount+0x49c/0x584 fs/namespace.c:3606
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x138 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

Second to last potentially related work creation:
 kasan_save_stack+0x40/0x70 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xc0/0xdc mm/kasan/generic.c:486
 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
 insert_work+0x64/0x37c kernel/workqueue.c:1361
 __queue_work+0xcbc/0x123c kernel/workqueue.c:1520
 __queue_delayed_work kernel/workqueue.c:1668 [inline]
 queue_delayed_work_on+0x204/0x314 kernel/workqueue.c:1704
 queue_delayed_work include/linux/workqueue.h:527 [inline]
 __gfs2_glock_queue_work fs/gfs2/glock.c:258 [inline]
 gfs2_glock_queue_work fs/gfs2/glock.c:272 [inline]
 do_xmote+0x688/0x1198 fs/gfs2/glock.c:871
 run_queue+0x3b4/0x690 fs/gfs2/glock.c:905
 glock_work_func+0x1fc/0x428 fs/gfs2/glock.c:1089
 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292
 worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439
 kthread+0x250/0x2d8 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

The buggy address belongs to the object at ffff0000f71ecfd8
 which belongs to the cache gfs2_glock(aspace) of size 1224
The buggy address is located 1112 bytes inside of
 1224-byte region [ffff0000f71ecfd8, ffff0000f71ed4a0)

The buggy address belongs to the physical page:
page:00000000844c2f7f refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000f71ec548 pfn:0x1371ec
head:00000000844c2f7f order:2 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c6ccfb00
raw: ffff0000f71ec548 00000000800c0008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000f71ed300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff0000f71ed380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff0000f71ed400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff0000f71ed480: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000f71ed500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/02 00:14 linux-6.1.y 50cbba13faa2 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in move_to_new_folio
* Struck through repros no longer work on HEAD.