==================================================================
BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
BUG: KASAN: slab-use-after-free in atomic_dec_and_test include/linux/atomic/atomic-instrumented.h:1375 [inline]
BUG: KASAN: slab-use-after-free in gfs2_qd_dealloc+0x7a/0xf0 fs/gfs2/quota.c:115
Write of size 4 at addr ffff888065974a78 by task swapper/2/0
CPU: 2 PID: 0 Comm: swapper/2 Not tainted 6.6.0-rc7-syzkaller-00195-g2af9b20dbb39 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
check_region_inline mm/kasan/generic.c:181 [inline]
kasan_check_range+0xef/0x190 mm/kasan/generic.c:187
instrument_atomic_read_write include/linux/instrumented.h:96 [inline]
atomic_dec_and_test include/linux/atomic/atomic-instrumented.h:1375 [inline]
gfs2_qd_dealloc+0x7a/0xf0 fs/gfs2/quota.c:115
rcu_do_batch kernel/rcu/tree.c:2139 [inline]
rcu_core+0x805/0x1bb0 kernel/rcu/tree.c:2403
__do_softirq+0x218/0x965 kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1074
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:native_irq_disable arch/x86/include/asm/irqflags.h:37 [inline]
RIP: 0010:arch_local_irq_disable arch/x86/include/asm/irqflags.h:72 [inline]
RIP: 0010:default_idle+0xf/0x20 arch/x86/kernel/process.c:743
Code: 89 07 49 c7 c0 08 00 00 00 4d 29 c8 4c 01 c7 4c 29 c2 e9 76 ff ff ff cc cc cc cc f3 0f 1e fa 66 90 0f 00 2d 83 bb 49 00 fb f4 c3 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 f3 0f 1e fa 65
RSP: 0018:ffffc90000387e08 EFLAGS: 00000242
RAX: 000000000017ef9d RBX: 0000000000000002 RCX: ffffffff8a3cd8ee
RDX: 0000000000000000 RSI: ffffffff8a8c9da0 RDI: ffffffff8ae913a0
RBP: ffffed1002a57898 R08: 0000000000000001 R09: ffffed100d706dbd
R10: ffff88806b836deb R11: 0000000000000000 R12: 0000000000000002
R13: ffff8880152bc4c0 R14: ffffffff8ecb67d0 R15: 0000000000000000
default_idle_call+0x67/0xa0 kernel/sched/idle.c:97
cpuidle_idle_call kernel/sched/idle.c:170 [inline]
do_idle+0x32e/0x3f0 kernel/sched/idle.c:282
cpu_startup_entry+0x50/0x60 kernel/sched/idle.c:380
start_secondary+0x20e/0x2a0 arch/x86/kernel/smpboot.c:326
secondary_startup_64_no_verify+0x166/0x16b
Allocated by task 12005:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa3/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:599 [inline]
kzalloc include/linux/slab.h:720 [inline]
init_sbd fs/gfs2/ops_fstype.c:77 [inline]
gfs2_fill_super+0x149/0x2e50 fs/gfs2/ops_fstype.c:1164
get_tree_bdev+0x3b5/0x650 fs/super.c:1577
gfs2_get_tree+0x4e/0x280 fs/gfs2/ops_fstype.c:1348
vfs_get_tree+0x8c/0x370 fs/super.c:1750
do_new_mount fs/namespace.c:3335 [inline]
path_mount+0x1492/0x1ed0 fs/namespace.c:3662
do_mount fs/namespace.c:3675 [inline]
__do_sys_mount fs/namespace.c:3884 [inline]
__se_sys_mount fs/namespace.c:3861 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:3861
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Freed by task 5191:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x138/0x190 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
__cache_free mm/slab.c:3370 [inline]
__do_kmem_cache_free mm/slab.c:3557 [inline]
__kmem_cache_free+0xcc/0x2d0 mm/slab.c:3564
generic_shutdown_super+0x161/0x3c0 fs/super.c:693
kill_block_super+0x3b/0x70 fs/super.c:1646
gfs2_kill_sb+0x361/0x410 fs/gfs2/ops_fstype.c:1811
deactivate_locked_super+0x9a/0x170 fs/super.c:481
deactivate_super+0xde/0x100 fs/super.c:514
cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254
task_work_run+0x14d/0x240 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x215/0x240 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296
do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
The buggy address belongs to the object at ffff888065974000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 2680 bytes inside of
freed 8192-byte region [ffff888065974000, ffff888065976000)
The buggy address belongs to the physical page:
page:ffffea0001965d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x65974
head:ffffea0001965d00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0x1()
raw: 00fff00000000840 ffff888012c40a00 ffffea00008a1010 ffff888012c41b50
raw: 0000000000000000 ffff888065974000 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x242020(__GFP_HIGH|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 9159, tgid 9158 (syz-executor.0), ts 311302249007, free_ts 306478074039
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536
prep_new_page mm/page_alloc.c:1543 [inline]
get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170
__alloc_pages_slowpath.constprop.0+0x2dd/0x2360 mm/page_alloc.c:3960
__alloc_pages+0x411/0x4a0 mm/page_alloc.c:4439
__alloc_pages_node include/linux/gfp.h:237 [inline]
kmem_getpages mm/slab.c:1356 [inline]
cache_grow_begin+0x99/0x3a0 mm/slab.c:2550
cache_alloc_refill+0x294/0x3a0 mm/slab.c:2923
____cache_alloc mm/slab.c:2999 [inline]
____cache_alloc mm/slab.c:2982 [inline]
__do_cache_alloc mm/slab.c:3182 [inline]
slab_alloc_node mm/slab.c:3230 [inline]
__kmem_cache_alloc_node+0x3c5/0x470 mm/slab.c:3521
__do_kmalloc_node mm/slab_common.c:1025 [inline]
__kmalloc+0x4f/0x100 mm/slab_common.c:1039
kmalloc include/linux/slab.h:603 [inline]
get_mem_for_virtual_node fs/reiserfs/fix_node.c:2286 [inline]
fix_nodes+0x3dee/0x8ae0 fs/reiserfs/fix_node.c:2626
reiserfs_paste_into_item+0x443/0x7c0 fs/reiserfs/stree.c:2128
reiserfs_get_block+0x1180/0x47a0 fs/reiserfs/inode.c:1069
reiserfs_get_blocks_direct_io+0xdc/0x2f0 fs/reiserfs/inode.c:522
get_more_blocks fs/direct-io.c:647 [inline]
do_direct_IO fs/direct-io.c:935 [inline]
__blockdev_direct_IO+0x2445/0x3cb0 fs/direct-io.c:1248
blockdev_direct_IO include/linux/fs.h:2969 [inline]
reiserfs_direct_IO+0x10b/0x270 fs/reiserfs/inode.c:3242
generic_file_direct_write+0x132/0x360 mm/filemap.c:3894
__generic_file_write_iter+0x11d/0x240 mm/filemap.c:4050
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1136 [inline]
free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312
free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405
slab_destroy mm/slab.c:1608 [inline]
slabs_destroy+0x85/0xc0 mm/slab.c:1628
cache_flusharray mm/slab.c:3341 [inline]
___cache_free+0x2b7/0x420 mm/slab.c:3404
qlink_free mm/kasan/quarantine.c:166 [inline]
qlist_free_all+0x4c/0x1b0 mm/kasan/quarantine.c:185
kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:292
__kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook mm/slab.h:762 [inline]
slab_alloc_node mm/slab.c:3237 [inline]
slab_alloc mm/slab.c:3246 [inline]
__kmem_cache_alloc_lru mm/slab.c:3423 [inline]
kmem_cache_alloc+0x159/0x400 mm/slab.c:3432
kmem_cache_zalloc include/linux/slab.h:710 [inline]
alloc_buffer_head+0x21/0x140 fs/buffer.c:3023
folio_alloc_buffers+0x2e7/0x7f0 fs/buffer.c:935
grow_dev_page fs/buffer.c:1072 [inline]
grow_buffers fs/buffer.c:1118 [inline]
__getblk_slow+0x2ac/0x720 fs/buffer.c:1145
__getblk_gfp+0x70/0x80 fs/buffer.c:1439
__getblk include/linux/buffer_head.h:399 [inline]
do_journal_end+0x1361/0x4c50 fs/reiserfs/journal.c:4083
__commit_trans_jl fs/reiserfs/journal.c:3884 [inline]
reiserfs_commit_for_inode+0x91d/0xb10 fs/reiserfs/journal.c:3927
reiserfs_get_blocks_direct_io fs/reiserfs/inode.c:546 [inline]
reiserfs_get_blocks_direct_io+0x1fe/0x2f0 fs/reiserfs/inode.c:506
get_more_blocks fs/direct-io.c:647 [inline]
do_direct_IO fs/direct-io.c:935 [inline]
__blockdev_direct_IO+0x2445/0x3cb0 fs/direct-io.c:1248
Memory state around the buggy address:
ffff888065974900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888065974980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888065974a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888065974a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888065974b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 89 07 mov %eax,(%rdi)
2: 49 c7 c0 08 00 00 00 mov $0x8,%r8
9: 4d 29 c8 sub %r9,%r8
c: 4c 01 c7 add %r8,%rdi
f: 4c 29 c2 sub %r8,%rdx
12: e9 76 ff ff ff jmp 0xffffff8d
17: cc int3
18: cc int3
19: cc int3
1a: cc int3
1b: f3 0f 1e fa endbr64
1f: 66 90 xchg %ax,%ax
21: 0f 00 2d 83 bb 49 00 verw 0x49bb83(%rip) # 0x49bbab
28: fb sti
29: f4 hlt
* 2a: fa cli <-- trapping instruction
2b: c3 ret
2c: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1)
33: 00 00 00 00
37: 0f 1f 40 00 nopl 0x0(%rax)
3b: f3 0f 1e fa endbr64
3f: 65 gs