[v6.1] KASAN: use-after-free Read in do_sync

1 view
Skip to first unread message

syzbot

unread,
Nov 5, 2025, 10:12:35 AM (21 hours ago) Nov 5
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: f6e38ae624cf Linux 6.1.158
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10d70532580000
kernel config: https://syzkaller.appspot.com/x/.config?x=68aa5a3af1cb953a
dashboard link: https://syzkaller.appspot.com/bug?extid=8d10a18a59ce45d015fe
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c1bd671a9def/disk-f6e38ae6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/fa0af998ea40/vmlinux-f6e38ae6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e5512d873524/Image-f6e38ae6.gz.xz

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

quotad_check_timeo fs/gfs2/quota.c:1519 [inline]
gfs2_quotad+0x2d8/0x4fc fs/gfs2/quota.c:1566
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850
==================================================================
BUG: KASAN: use-after-free in __up_write kernel/locking/rwsem.c:1366 [inline]
BUG: KASAN: use-after-free in up_write+0x80/0x5c0 kernel/locking/rwsem.c:1626
Read of size 8 at addr ffff0000fc1b3708 by task gfs2_quotad/12076

CPU: 0 PID: 12076 Comm: gfs2_quotad 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
__up_write kernel/locking/rwsem.c:1366 [inline]
up_write+0x80/0x5c0 kernel/locking/rwsem.c:1626
inode_unlock include/linux/fs.h:763 [inline]
do_sync+0x840/0xa94 fs/gfs2/quota.c:984
gfs2_quota_sync+0x2e0/0x528 fs/gfs2/quota.c:1329
quotad_check_timeo fs/gfs2/quota.c:1519 [inline]
gfs2_quotad+0x2d8/0x4fc fs/gfs2/quota.c:1566
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

Allocated by task 12059:
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_lru+0x1b0/0x298 mm/slub.c:3390
alloc_inode_sb include/linux/fs.h:3245 [inline]
gfs2_alloc_inode+0x58/0x110 fs/gfs2/super.c:1543
alloc_inode fs/inode.c:261 [inline]
iget5_locked+0xa4/0x228 fs/inode.c:1328
gfs2_inode_lookup+0xe0/0xab0 fs/gfs2/inode.c:124
gfs2_dir_search+0x148/0x204 fs/gfs2/dir.c:1664
gfs2_lookupi+0x3bc/0x58c fs/gfs2/inode.c:323
gfs2_lookup_simple+0xb0/0x100 fs/gfs2/inode.c:264
init_inodes+0x178/0x2d4 fs/gfs2/ops_fstype.c:904
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

Freed by task 4329:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_free_info+0x3c/0x60 mm/kasan/generic.c:516
____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:236
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1729 [inline]
slab_free_freelist_hook+0x16c/0x1ec mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
kmem_cache_free+0x11c/0x324 mm/slub.c:3709
gfs2_free_inode+0x50/0x60 fs/gfs2/super.c:1557
i_callback+0x50/0x78 fs/inode.c:250
rcu_do_batch kernel/rcu/tree.c:2297 [inline]
rcu_core+0x81c/0x18ac kernel/rcu/tree.c:2557
rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2574
handle_softirqs+0x318/0xc6c kernel/softirq.c:596
__do_softirq+0x14/0x20 kernel/softirq.c:630

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
destroy_inode fs/inode.c:316 [inline]
evict+0x748/0x810 fs/inode.c:720
iput_final fs/inode.c:1834 [inline]
iput+0x764/0x7f4 fs/inode.c:1860
gfs2_put_super+0x330/0x764 fs/gfs2/super.c:616
generic_shutdown_super+0x130/0x324 fs/super.c:501
kill_block_super+0x70/0xdc fs/super.c:1470
gfs2_kill_sb+0xc0/0xd4 fs/gfs2/ops_fstype.c:-1
deactivate_locked_super+0xac/0x124 fs/super.c:332
deactivate_super+0xe8/0x108 fs/super.c:363
cleanup_mnt+0x37c/0x404 fs/namespace.c:1191
__cleanup_mnt+0x20/0x30 fs/namespace.c:1198
task_work_run+0x1ec/0x270 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x2038/0x2b28 arch/arm64/kernel/signal.c:1137
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
el0_svc+0x98/0x138 arch/arm64/kernel/entry-common.c:638
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 object at ffff0000fc1b35c0
which belongs to the cache gfs2_inode of size 1592
The buggy address is located 328 bytes inside of
1592-byte region [ffff0000fc1b35c0, ffff0000fc1b3bf8)

The buggy address belongs to the physical page:
page:000000001372ac75 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13c1b0
head:000000001372ac75 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff0000cd9da401
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c4c71b00
raw: 0000000000000000 0000000080130013 00000001ffffffff ffff0000cd9da401
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000fc1b3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000fc1b3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff0000fc1b3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff0000fc1b3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff0000fc1b3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Unable to handle kernel paging request at virtual address dfff800000000002
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
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
[dfff800000000002] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 12076 Comm: gfs2_quotad Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
pstate: 02400005 (nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : do_sync+0x86c/0xa94 fs/gfs2/quota.c:986
lr : do_sync+0x860/0xa94 fs/gfs2/quota.c:986
sp : ffff800021a47ac0
x29: ffff800021a47c10 x28: ffff0000fc1b35c0 x27: ffff80000a1debc4
x26: 00000000fffffffb x25: ffff700004348f64 x24: dfff800000000000
x23: 0000000000000000 x22: ffff0000c3c0a900 x21: ffff0000c3c0a900
x20: 0000000000000000 x19: 0000000000000000 x18: ffff800011abbcc0
x17: ffff80000a1dcf80 x16: ffff800008042d90 x15: ffff8000088c98b4
x14: ffff8000088d0688 x13: ffff80000802a690 x12: 0000000000ff0100
x11: ff0080000804801c x10: 0000000000000000 x9 : ffff80001c326a90
x8 : 0000000000000002 x7 : ffff8000088d6f68 x6 : ffff8000088d48e4
x5 : ffff0000cc4edbc8 x4 : ffff800021a47760 x3 : ffff80000a1dcf98
x2 : 0000000000000000 x1 : 0000000000000008 x0 : 0000000000000010
Call trace:
do_sync+0x86c/0xa94 fs/gfs2/quota.c:986
gfs2_quota_sync+0x2e0/0x528 fs/gfs2/quota.c:1329
quotad_check_timeo fs/gfs2/quota.c:1519 [inline]
gfs2_quotad+0x2d8/0x4fc fs/gfs2/quota.c:1566
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850
Code: 979be98a f9400294 91004280 d343fc08 (38786908)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: 979be98a bl 0xfffffffffe6fa628
4: f9400294 ldr x20, [x20]
8: 91004280 add x0, x20, #0x10
c: d343fc08 lsr x8, x0, #3
* 10: 38786908 ldrb w8, [x8, x24] <-- 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 report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
6:38 AM (1 hour ago) 6:38 AM
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: f6e38ae624cf Linux 6.1.158
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17d58532580000
kernel config: https://syzkaller.appspot.com/x/.config?x=68aa5a3af1cb953a
dashboard link: https://syzkaller.appspot.com/bug?extid=8d10a18a59ce45d015fe
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14d26532580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10358532580000
mounted in repro: https://storage.googleapis.com/syzbot-assets/6ab083ad129a/mount_2.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=126d617c580000)

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

Unable to handle kernel paging request at virtual address dfff800000000002
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
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
[dfff800000000002] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 4703 Comm: gfs2_quotad Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
pstate: 62400005 (nZCv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : do_sync+0x86c/0xa94 fs/gfs2/quota.c:986
lr : do_sync+0x848/0xa94 fs/gfs2/quota.c:985
sp : ffff8000229d7ac0
x29: ffff8000229d7c10 x28: ffff0000f3981ae0 x27: ffff80000a1debc4
x26: 00000000fffffffb x25: ffff70000453af64 x24: dfff800000000000
x23: 0000000000000000 x22: ffff0000d8d76100 x21: ffff0000d8d76100
x20: 0000000000000000 x19: 0000000000000000 x18: ffff800011abbcc0
x17: ffff8000181f9000 x16: ffff8000082d25ac x15: ffff800017cda000
x14: 00000000ffff8000 x13: 00000000f21d0cde x12: 0000000000ff0100
x11: ff0080000a894400 x10: 0000000000000000 x9 : 25f4d471881e0f00
x8 : 0000000000000002 x7 : 0000000000000000 x6 : 000000000000003f
x5 : 0000000000000040 x4 : 0000000000000001 x3 : 0000000000000000
x2 : 0000000000000006 x1 : ffff800011abd7c0 x0 : 0000000000000010
Call trace:
do_sync+0x86c/0xa94 fs/gfs2/quota.c:986
gfs2_quota_sync+0x2e0/0x528 fs/gfs2/quota.c:1329
quotad_check_timeo fs/gfs2/quota.c:1519 [inline]
gfs2_quotad+0x2d8/0x4fc fs/gfs2/quota.c:1566
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850
Code: 979be98a f9400294 91004280 d343fc08 (38786908)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: 979be98a bl 0xfffffffffe6fa628
4: f9400294 ldr x20, [x20]
8: 91004280 add x0, x20, #0x10
c: d343fc08 lsr x8, x0, #3
* 10: 38786908 ldrb w8, [x8, x24] <-- trapping instruction


---
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.
Reply all
Reply to author
Forward
0 new messages