Hello,
syzbot found the following issue on:
HEAD commit: 91786f140358 Linux 5.15.175
git tree: linux-5.15.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=16d27cf8580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=1fc30776feb70ea7
dashboard link:
https://syzkaller.appspot.com/bug?extid=a6015d2577b15c580ff4
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/210b1e4b59b1/disk-91786f14.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/1cf8391059a0/vmlinux-91786f14.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/1d9077a44b1c/bzImage-91786f14.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+a6015d...@syzkaller.appspotmail.com
RBP: 00007faef8e93aa8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007faef9008080 R15: 00007ffdd79ced78
</TASK>
==================================================================
BUG: KASAN: use-after-free in bh_put fs/gfs2/quota.c:414 [inline]
BUG: KASAN: use-after-free in qdsb_put fs/gfs2/quota.c:533 [inline]
BUG: KASAN: use-after-free in gfs2_quota_unhold+0x17a/0x5d0 fs/gfs2/quota.c:652
Read of size 8 at addr ffff88805efc30c8 by task syz.0.70/4675
CPU: 0 PID: 4675 Comm: syz.0.70 Not tainted 5.15.175-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
print_address_description+0x63/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
bh_put fs/gfs2/quota.c:414 [inline]
qdsb_put fs/gfs2/quota.c:533 [inline]
gfs2_quota_unhold+0x17a/0x5d0 fs/gfs2/quota.c:652
gfs2_quota_lock+0x3ea/0x450 fs/gfs2/quota.c:1095
gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline]
alloc_dinode+0x1c9/0x580 fs/gfs2/inode.c:402
gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720
gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295
atomic_open fs/namei.c:3325 [inline]
lookup_open fs/namei.c:3433 [inline]
open_last_lookups fs/namei.c:3532 [inline]
path_openat+0xf75/0x2f20 fs/namei.c:3739
do_filp_open+0x21c/0x460 fs/namei.c:3769
do_sys_openat2+0x13b/0x4f0 fs/open.c:1253
do_sys_open fs/open.c:1269 [inline]
__do_sys_openat fs/open.c:1285 [inline]
__se_sys_openat fs/open.c:1280 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1280
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7faef8e17d29
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007faef6c67038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007faef9008080 RCX: 00007faef8e17d29
RDX: 000000000000275a RSI: 0000000020000000 RDI: ffffffffffffff9c
RBP: 00007faef8e93aa8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007faef9008080 R15: 00007ffdd79ced78
</TASK>
Allocated by task 4675:
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+0x8e/0xc0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3220 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
kmem_cache_zalloc include/linux/slab.h:711 [inline]
qd_alloc+0x51/0x250 fs/gfs2/quota.c:216
qd_get+0x23f/0x5c0 fs/gfs2/quota.c:275
qdsb_get+0x2a/0x3b0 fs/gfs2/quota.c:510
gfs2_quota_hold+0x19d/0x5c0 fs/gfs2/quota.c:604
gfs2_quota_lock+0x9f/0x450 fs/gfs2/quota.c:1076
gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline]
alloc_dinode+0x1c9/0x580 fs/gfs2/inode.c:402
gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720
gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295
atomic_open fs/namei.c:3325 [inline]
lookup_open fs/namei.c:3433 [inline]
open_last_lookups fs/namei.c:3532 [inline]
path_openat+0xf75/0x2f20 fs/namei.c:3739
do_filp_open+0x21c/0x460 fs/namei.c:3769
do_sys_openat2+0x13b/0x4f0 fs/open.c:1253
do_sys_open fs/open.c:1269 [inline]
__do_sys_openat fs/open.c:1285 [inline]
__se_sys_openat fs/open.c:1280 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1280
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
Freed by task 14:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kmem_cache_free+0x91/0x1f0 mm/slub.c:3515
rcu_do_batch kernel/rcu/tree.c:2523 [inline]
rcu_core+0xa15/0x1650 kernel/rcu/tree.c:2763
handle_softirqs+0x3a7/0x930 kernel/softirq.c:558
run_ksoftirqd+0xc6/0x120 kernel/softirq.c:925
smpboot_thread_fn+0x51b/0x9d0 kernel/smpboot.c:164
kthread+0x3f6/0x4f0 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Last potentially related work creation:
kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:3007 [inline]
call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3087
gfs2_quota_cleanup+0x43e/0x6a0 fs/gfs2/quota.c:1490
gfs2_make_fs_ro+0x4ad/0x5f0 fs/gfs2/super.c:557
signal_our_withdraw fs/gfs2/util.c:166 [inline]
gfs2_withdraw+0x5fb/0x14e0 fs/gfs2/util.c:343
gfs2_meta_check_ii+0x6e/0x80 fs/gfs2/util.c:498
gfs2_metatype_check_i fs/gfs2/util.h:126 [inline]
gfs2_meta_buffer+0x324/0x410 fs/gfs2/meta_io.c:493
gfs2_meta_inode_buffer fs/gfs2/meta_io.h:70 [inline]
gfs2_inode_refresh+0xdd/0x1070 fs/gfs2/glops.c:481
inode_go_lock+0x12c/0x470 fs/gfs2/glops.c:510
do_promote+0x74b/0xb10 fs/gfs2/glock.c:507
finish_xmote+0x50d/0xb60 fs/gfs2/glock.c:678
do_xmote+0x775/0x10b0 fs/gfs2/glock.c:824
gfs2_glock_nq+0xc32/0x15e0 fs/gfs2/glock.c:1534
gfs2_glock_nq_init fs/gfs2/glock.h:246 [inline]
do_glock+0x392/0x730 fs/gfs2/quota.c:1043
gfs2_quota_lock+0x1fc/0x450 fs/gfs2/quota.c:1085
gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline]
alloc_dinode+0x1c9/0x580 fs/gfs2/inode.c:402
gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720
gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295
atomic_open fs/namei.c:3325 [inline]
lookup_open fs/namei.c:3433 [inline]
open_last_lookups fs/namei.c:3532 [inline]
path_openat+0xf75/0x2f20 fs/namei.c:3739
do_filp_open+0x21c/0x460 fs/namei.c:3769
do_sys_openat2+0x13b/0x4f0 fs/open.c:1253
do_sys_open fs/open.c:1269 [inline]
__do_sys_openat fs/open.c:1285 [inline]
__se_sys_openat fs/open.c:1280 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1280
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
The buggy address belongs to the object at ffff88805efc3000
which belongs to the cache gfs2_quotad of size 272
The buggy address is located 200 bytes inside of
272-byte region [ffff88805efc3000, ffff88805efc3110)
The buggy address belongs to the page:
page:ffffea00017bf0c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5efc3
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 dead000000000122 ffff88814709e140
raw: 0000000000000000 00000000800c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x112c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 4675, ts 70787565736, free_ts 11736292718
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192
__alloc_pages+0x272/0x700 mm/page_alloc.c:5465
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xbb/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc+0x18e/0x280 mm/slub.c:3233
kmem_cache_zalloc include/linux/slab.h:711 [inline]
qd_alloc+0x51/0x250 fs/gfs2/quota.c:216
qd_get+0x23f/0x5c0 fs/gfs2/quota.c:275
qdsb_get+0x2a/0x3b0 fs/gfs2/quota.c:510
gfs2_quota_hold+0x19d/0x5c0 fs/gfs2/quota.c:604
gfs2_quota_lock+0x9f/0x450 fs/gfs2/quota.c:1076
gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline]
alloc_dinode+0x1c9/0x580 fs/gfs2/inode.c:402
gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720
gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295
atomic_open fs/namei.c:3325 [inline]
lookup_open fs/namei.c:3433 [inline]
open_last_lookups fs/namei.c:3532 [inline]
path_openat+0xf75/0x2f20 fs/namei.c:3739
do_filp_open+0x21c/0x460 fs/namei.c:3769
do_sys_openat2+0x13b/0x4f0 fs/open.c:1253
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+0xc34/0xcf0 mm/page_alloc.c:3317
free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
free_contig_range+0x95/0xf0 mm/page_alloc.c:9384
destroy_args+0xfe/0x980 mm/debug_vm_pgtable.c:1018
debug_vm_pgtable+0x40d/0x470 mm/debug_vm_pgtable.c:1331
do_one_initcall+0x22b/0x7a0 init/main.c:1302
do_initcall_level+0x157/0x210 init/main.c:1375
do_initcalls+0x49/0x90 init/main.c:1391
kernel_init_freeable+0x425/0x5c0 init/main.c:1615
kernel_init+0x19/0x290 init/main.c:1506
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Memory state around the buggy address:
ffff88805efc2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88805efc3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88805efc3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88805efc3100: fb fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb
ffff88805efc3180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
---
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