==================================================================
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 ffff88801c10ca78 by task udevd/4646
CPU: 0 PID: 4646 Comm: udevd Not tainted 6.6.0-rc5-syzkaller #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:__kmem_cache_free+0x189/0x2d0 mm/slab.c:3565
Code: e7 e8 2b 8d 4f 02 e9 d8 fe ff ff e8 b1 f3 b1 ff e9 b8 fe ff ff e8 37 f3 b1 ff 9c 58 f6 c4 02 0f 85 22 01 00 00 fb 48 83 c4 10 <5b> 5d 41 5c 41 5d 41 5e 41 5f c3 48 8d 58 ff e9 d6 fe ff ff 48 83
RSP: 0018:ffffc900034a7a70 EFLAGS: 00000282
RAX: 0000000000000006 RBX: ffffea000195d000 RCX: 1ffffffff233fc46
RDX: 0000000000000000 RSI: ffffffff8a8c9b80 RDI: ffffffff8ae90ae0
RBP: ffff888012c40900 R08: 0000000000000001 R09: fffffbfff233c7d7
R10: ffffffff919e3ebf R11: 0000000000000000 R12: ffff888065740000
R13: 0000000000000200 R14: ffffffff83e8fa46 R15: ffff88810a6ca6a0
tomoyo_realpath_from_path+0x1a6/0x710 security/tomoyo/realpath.c:286
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x26f/0x450 security/tomoyo/file.c:822
security_inode_getattr+0xf1/0x150 security/security.c:2153
vfs_getattr fs/stat.c:169 [inline]
vfs_fstat+0x4f/0xc0 fs/stat.c:194
vfs_fstatat+0x130/0x140 fs/stat.c:291
__do_sys_newfstatat+0x98/0x110 fs/stat.c:459
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
RIP: 0033:0x7ff4a1b165f4
Code: 64 c7 00 09 00 00 00 83 c8 ff c3 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 00 00 00 00 41 89 ca b8 06 01 00 00 0f 05 <45> 31 c0 3d 00 f0 ff ff 76 10 48 8b 15 03 a8 0d 00 f7 d8 41 83 c8
RSP: 002b:00007fff6594f0c8 EFLAGS: 00000206 ORIG_RAX: 0000000000000106
RAX: ffffffffffffffda RBX: 00007ff4a1bee460 RCX: 00007ff4a1b165f4
RDX: 00007fff6594f0d0 RSI: 00007ff4a1bb3130 RDI: 000000000000000c
RBP: 00005582394d0b60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000001000 R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000003fff R14: 00007fff6594f668 R15: 000000000000000a
Allocated by task 14422:
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 5187:
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 ffff88801c10c000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 2680 bytes inside of
freed 8192-byte region [ffff88801c10c000, ffff88801c10e000)
The buggy address belongs to the physical page:
page:ffffea0000704300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c10c
head:ffffea0000704300 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 ffffea0000a2ae10 ffffea00009fd410
raw: 0000000000000000 ffff88801c10c000 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 13493, tgid 13492 (syz-executor.0), ts 323923093815, free_ts 319602610379
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:1022 [inline]
__kmalloc+0x4f/0x100 mm/slab_common.c:1036
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
getname_flags.part.0+0x50/0x4d0 fs/namei.c:140
getname_flags+0x9c/0xf0 include/linux/audit.h:321
user_path_at_empty+0x2c/0x60 fs/namei.c:2909
do_readlinkat+0xdd/0x2f0 fs/stat.c:490
__do_sys_readlink fs/stat.c:523 [inline]
__se_sys_readlink fs/stat.c:520 [inline]
__x64_sys_readlink+0x78/0xb0 fs/stat.c:520
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
Memory state around the buggy address:
ffff88801c10c900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801c10c980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88801c10ca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88801c10ca80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88801c10cb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess), 1 bytes skipped:
0: e8 2b 8d 4f 02 call 0x24f8d30
5: e9 d8 fe ff ff jmp 0xfffffee2
a: e8 b1 f3 b1 ff call 0xffb1f3c0
f: e9 b8 fe ff ff jmp 0xfffffecc
14: e8 37 f3 b1 ff call 0xffb1f350
19: 9c pushf
1a: 58 pop %rax
1b: f6 c4 02 test $0x2,%ah
1e: 0f 85 22 01 00 00 jne 0x146
24: fb sti
25: 48 83 c4 10 add $0x10,%rsp
* 29: 5b pop %rbx <-- trapping instruction
2a: 5d pop %rbp
2b: 41 5c pop %r12
2d: 41 5d pop %r13
2f: 41 5e pop %r14
31: 41 5f pop %r15
33: c3 ret
34: 48 8d 58 ff lea -0x1(%rax),%rbx
38: e9 d6 fe ff ff jmp 0xffffff13
3d: 48 rex.W
3e: 83 .byte 0x83