syzbot


KASAN: use-after-free Read in gfs2_invalidatepage (2)

Status: upstream: reported on 2025/05/14 06:37
Reported-by: syzbot+4a7cb2f88e9048f129e2@syzkaller.appspotmail.com
First crash: 17d, last: 17d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in gfs2_invalidatepage 1 184d 184d 0/3 auto-obsoleted due to no activity on 2025/03/07 20:25

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in list_empty include/linux/list.h:290 [inline]
BUG: KASAN: use-after-free in gfs2_discard fs/gfs2/aops.c:656 [inline]
BUG: KASAN: use-after-free in gfs2_invalidatepage+0x424/0x854 fs/gfs2/aops.c:693
Read of size 8 at addr ffff0000edcbb168 by task syz-executor/4029

CPU: 0 PID: 4029 Comm: syz-executor Not tainted 5.15.182-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
Call trace:
 dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
 print_address_description+0x78/0x30c mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xec/0x15c mm/kasan/report.c:451
 __asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309
 list_empty include/linux/list.h:290 [inline]
 gfs2_discard fs/gfs2/aops.c:656 [inline]
 gfs2_invalidatepage+0x424/0x854 fs/gfs2/aops.c:693
 do_invalidatepage mm/truncate.c:157 [inline]
 truncate_cleanup_page+0x15c/0x414 mm/truncate.c:176
 truncate_inode_pages_range+0x1f8/0x9b8 mm/truncate.c:325
 truncate_inode_pages mm/truncate.c:425 [inline]
 truncate_inode_pages_final+0x90/0xcc mm/truncate.c:464
 gfs2_evict_inode+0x82c/0xe58 fs/gfs2/super.c:1415
 evict+0x3c8/0x810 fs/inode.c:647
 iput_final fs/inode.c:1769 [inline]
 iput+0x6c4/0x77c fs/inode.c:1795
 gfs2_put_super+0x26c/0x6bc fs/gfs2/super.c:603
 generic_shutdown_super+0x130/0x2f0 fs/super.c:475
 kill_block_super+0x70/0xdc fs/super.c:1427
 gfs2_kill_sb+0xc0/0xd4 fs/gfs2/ops_fstype.c:-1
 deactivate_locked_super+0xb8/0x13c fs/super.c:335
 deactivate_super+0xf8/0x118 fs/super.c:366
 cleanup_mnt+0x3a4/0x458 fs/namespace.c:1143
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1150
 task_work_run+0x12c/0x1e0 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 do_notify_resume+0x24b4/0x3128 arch/arm64/kernel/signal.c:949
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline]
 el0_svc+0xf0/0x1e0 arch/arm64/kernel/entry-common.c:609
 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Allocated by task 4212:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 __kasan_slab_alloc+0x8c/0xcc mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x74/0x408 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0x1e0/0x3e4 mm/slub.c:3233
 kmem_cache_zalloc include/linux/slab.h:725 [inline]
 gfs2_alloc_bufdata fs/gfs2/trans.c:168 [inline]
 gfs2_trans_add_data+0x1e8/0x6a0 fs/gfs2/trans.c:209
 gfs2_unstuffer_page fs/gfs2/bmap.c:83 [inline]
 __gfs2_unstuff_inode fs/gfs2/bmap.c:121 [inline]
 gfs2_unstuff_dinode+0xb68/0x1000 fs/gfs2/bmap.c:168
 gfs2_adjust_quota+0x1d8/0x818 fs/gfs2/quota.c:847
 gfs2_set_dqblk+0x784/0x9cc fs/gfs2/quota.c:1764
 quota_setquota+0x428/0x4b8 fs/quota/quota.c:309
 do_quotactl+0x65c/0x738 fs/quota/quota.c:801
 __do_sys_quotactl fs/quota/quota.c:959 [inline]
 __se_sys_quotactl fs/quota/quota.c:915 [inline]
 __arm64_sys_quotactl+0x2ac/0x734 fs/quota/quota.c:915
 __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+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Freed by task 4222:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4c/0x84 mm/kasan/common.c:46
 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360
 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366
 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0x128/0x1e8 mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kmem_cache_free+0xdc/0x3b4 mm/slub.c:3515
 trans_drain fs/gfs2/log.c:1015 [inline]
 gfs2_log_flush+0xbe8/0x2078 fs/gfs2/log.c:1155
 do_sync+0x844/0xa4c fs/gfs2/quota.c:986
 gfs2_quota_sync+0x2e8/0x548 fs/gfs2/quota.c:1329
 quotad_check_timeo fs/gfs2/quota.c:1519 [inline]
 gfs2_quotad+0x304/0x700 fs/gfs2/quota.c:1586
 kthread+0x374/0x454 kernel/kthread.c:334
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

The buggy address belongs to the object at ffff0000edcbb150
 which belongs to the cache gfs2_bufdata of size 80
The buggy address is located 24 bytes inside of
 80-byte region [ffff0000edcbb150, ffff0000edcbb1a0)
The buggy address belongs to the page:
page:00000000d234b54d refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12dcbb
flags: 0x5ffc00000000200(slab|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000200 0000000000000000 dead000000000122 ffff0000c613b200
raw: 0000000000000000 0000000080240024 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000edcbb000: fa fb fb fb fb fb fb fb fb fb fc fc fc fc fa fb
 ffff0000edcbb080: fb fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb
>ffff0000edcbb100: fb fb fb fb fb fb fc fc fc fc fa fb fb fb fb fb
                                                          ^
 ffff0000edcbb180: fb fb fb fb fc fc fc fc fa fb fb fb fb fb fb fb
 ffff0000edcbb200: fb fb fc fc fc fc fa fb fb fb fb fb fb fb fb fb
==================================================================
Unable to handle kernel paging request at virtual address dfff800000000005
Mem abort info:
  ESR = 0x0000000096000006
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
  FSC = 0x06: level 2 translation fault
Data abort info:
  ISV = 0, ISS = 0x00000006
  CM = 0, WnR = 0
[dfff800000000005] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 4029 Comm: syz-executor Tainted: G    B             5.15.182-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : gfs2_remove_from_journal+0x3a8/0x7f8 fs/gfs2/meta_io.c:351
lr : gfs2_remove_from_journal+0x398/0x7f8 fs/gfs2/meta_io.c:351
sp : ffff80001f127250
x29: ffff80001f127270 x28: dfff800000000000 x27: ffff0000edcbb170
x26: ffff0000edcbb170 x25: 1fffe0001b948899 x24: 0000000000010000
x23: 000000000000002c x22: 0000000000000000 x21: ffff0000dca444c8
x20: ffff0000edcbb150 x19: ffff0000dca44488 x18: 0000000000000003
x17: 0000000000000000 x16: ffff8000111a53fc x15: 00000000ffffffff
x14: 0000000000ff0100 x13: 0000000000000001 x12: 0000000000ff0100
x11: 0000000000000002 x10: 0000000000000000 x9 : ffff80000a0c4478
x8 : 0000000000000005 x7 : 0000000000000000 x6 : ffff80000a0c8270
x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff80000a0c4420
x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000001
Call trace:
 gfs2_remove_from_journal+0x3a8/0x7f8 fs/gfs2/meta_io.c:351
 gfs2_discard fs/gfs2/aops.c:660 [inline]
 gfs2_invalidatepage+0x510/0x854 fs/gfs2/aops.c:693
 do_invalidatepage mm/truncate.c:157 [inline]
 truncate_cleanup_page+0x15c/0x414 mm/truncate.c:176
 truncate_inode_pages_range+0x1f8/0x9b8 mm/truncate.c:325
 truncate_inode_pages mm/truncate.c:425 [inline]
 truncate_inode_pages_final+0x90/0xcc mm/truncate.c:464
 gfs2_evict_inode+0x82c/0xe58 fs/gfs2/super.c:1415
 evict+0x3c8/0x810 fs/inode.c:647
 iput_final fs/inode.c:1769 [inline]
 iput+0x6c4/0x77c fs/inode.c:1795
 gfs2_put_super+0x26c/0x6bc fs/gfs2/super.c:603
 generic_shutdown_super+0x130/0x2f0 fs/super.c:475
 kill_block_super+0x70/0xdc fs/super.c:1427
 gfs2_kill_sb+0xc0/0xd4 fs/gfs2/ops_fstype.c:-1
 deactivate_locked_super+0xb8/0x13c fs/super.c:335
 deactivate_super+0xf8/0x118 fs/super.c:366
 cleanup_mnt+0x3a4/0x458 fs/namespace.c:1143
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1150
 task_work_run+0x12c/0x1e0 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 do_notify_resume+0x24b4/0x3128 arch/arm64/kernel/signal.c:949
 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline]
 el0_svc+0xf0/0x1e0 arch/arm64/kernel/entry-common.c:609
 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
Code: f94003f6 f9400bf9 9100b2d7 d343fee8 (38fc6908) 
---[ end trace 40a52536690513fe ]---
----------------
Code disassembly (best guess):
   0:	f94003f6 	ldr	x22, [sp]
   4:	f9400bf9 	ldr	x25, [sp, #16]
   8:	9100b2d7 	add	x23, x22, #0x2c
   c:	d343fee8 	lsr	x8, x23, #3
* 10:	38fc6908 	ldrsb	w8, [x8, x28] <-- trapping instruction

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/14 06:37 linux-5.15.y 3b8db0e4f263 7344edeb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in gfs2_invalidatepage
* Struck through repros no longer work on HEAD.