syzbot


KASAN: use-after-free Read in gfs2_quotad

Status: upstream: reported on 2025/06/06 12:35
Reported-by: syzbot+1c60687a1f6580099289@syzkaller.appspotmail.com
First crash: 144d, last: 12h39m
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in gfs2_quotad origin:lts-only 19 C inconclusive 10 1d12h 197d 0/3 upstream: reported C repro on 2025/04/13 18:37

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
Read of size 8 at addr ffff88807dab0bb0 by task gfs2_quotad/4634

CPU: 0 PID: 4634 Comm: gfs2_quotad Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 __lock_acquire+0xf7/0x7c60 kernel/locking/lockdep.c:4882
 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
 finish_wait+0xb5/0x1d0 kernel/sched/wait.c:407
 gfs2_quotad+0x703/0x880 fs/gfs2/quota.c:1605
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
 </TASK>

Allocated by task 4617:
 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_kmalloc mm/kasan/common.c:513 [inline]
 __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522
 kmalloc include/linux/slab.h:607 [inline]
 kzalloc include/linux/slab.h:738 [inline]
 init_sbd fs/gfs2/ops_fstype.c:77 [inline]
 gfs2_fill_super+0x13f/0x1f50 fs/gfs2/ops_fstype.c:1151
 get_tree_bdev+0x3f1/0x610 fs/super.c:1325
 gfs2_get_tree+0x4d/0x1e0 fs/gfs2/ops_fstype.c:1332
 vfs_get_tree+0x88/0x270 fs/super.c:1530
 do_new_mount+0x24a/0xa40 fs/namespace.c:3034
 do_mount fs/namespace.c:3377 [inline]
 __do_sys_mount fs/namespace.c:3585 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3562
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff88807dab0000
 which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 2992 bytes inside of
 8192-byte region [ffff88807dab0000, ffff88807dab2000)
The buggy address belongs to the page:
page:ffffea0001f6ac00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807dab0000 pfn:0x7dab0
head:ffffea0001f6ac00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001e8ac00 0000000200000002 ffff888016842280
raw: ffff88807dab0000 0000000080020001 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4344, ts 75551447174, free_ts 75533216042
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
 alloc_slab_page mm/slub.c:1780 [inline]
 allocate_slab mm/slub.c:1917 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1980
 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3013
 __slab_alloc mm/slub.c:3100 [inline]
 slab_alloc_node mm/slub.c:3191 [inline]
 __kmalloc_node+0x200/0x3b0 mm/slub.c:4456
 kmalloc_node include/linux/slab.h:630 [inline]
 kvmalloc_node+0x84/0x130 mm/util.c:619
 kvmalloc include/linux/mm.h:816 [inline]
 kvzalloc include/linux/mm.h:824 [inline]
 bpf_check+0x147/0xf090 kernel/bpf/verifier.c:14040
 bpf_prog_load+0x1043/0x1550 kernel/bpf/syscall.c:2354
 __sys_bpf+0x4c2/0x670 kernel/bpf/syscall.c:4657
 __do_sys_bpf kernel/bpf/syscall.c:4761 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4759 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4759
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
 free_unref_page+0x94/0x280 mm/page_alloc.c:3396
 free_slab mm/slub.c:2020 [inline]
 discard_slab mm/slub.c:2026 [inline]
 __unfreeze_partials+0x1a5/0x200 mm/slub.c:2512
 put_cpu_partial+0x12d/0x190 mm/slub.c:2592
 qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3225 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 kmem_cache_alloc_trace+0x103/0x2a0 mm/slub.c:3250
 kmalloc include/linux/slab.h:607 [inline]
 tcp_md5_do_add+0x1c3/0x5a0 net/ipv4/tcp_ipv4.c:1193
 tcp_v6_parse_md5_keys+0x4b7/0x610 net/ipv6/tcp_ipv6.c:-1
 do_tcp_setsockopt net/ipv4/tcp.c:3635 [inline]
 tcp_setsockopt+0xa35/0x1d70 net/ipv4/tcp.c:3721
 __sys_setsockopt+0x2bf/0x3d0 net/socket.c:2203
 __do_sys_setsockopt net/socket.c:2214 [inline]
 __se_sys_setsockopt net/socket.c:2211 [inline]
 __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2211
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff88807dab0a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88807dab0b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807dab0b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff88807dab0c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88807dab0c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/28 00:17 linux-5.15.y ac56c046adf4 fd2207e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in gfs2_quotad
2025/06/06 12:35 linux-5.15.y 1c700860e8bc 9fa58bba .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in gfs2_quotad
2025/07/21 09:32 linux-5.15.y c79648372d02 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in gfs2_quotad
* Struck through repros no longer work on HEAD.