==================================================================
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 ffff88804ec0ca78 by task kswapd0/108
CPU: 3 PID: 108 Comm: kswapd0 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:check_kcov_mode kernel/kcov.c:175 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x35/0x70 kernel/kcov.c:207
Code: 89 c1 48 8b 34 24 81 e1 00 01 00 00 65 48 8b 14 25 c0 bc 03 00 a9 00 01 ff 00 74 0e 85 c9 74 35 8b 82 04 16 00 00 85 c0 74 2b <8b> 82 e0 15 00 00 83 f8 02 75 20 48 8b 8a e8 15 00 00 8b 92 e4 15
RSP: 0018:ffffc90000e3ee38 EFLAGS: 00000246
RAX: 0000000080000001 RBX: ffffc900032c7201 RCX: 0000000000000000
RDX: ffff888016ed4800 RSI: ffffffff842f871c RDI: ffffc900032c7202
RBP: ffffc900032c7202 R08: 0000000000000004 R09: 0000000059365054
R10: 00000000702f4f39 R11: 0000000000000000 R12: dffffc0000000000
R13: 00000000702f4f39 R14: 0000000059365054 R15: 466a702f4f396638
lzo1x_1_do_compress+0xbc/0x1900 lib/lzo/lzo1x_compress.c:45
lzogeneric1x_1_compress+0x224/0x980 lib/lzo/lzo1x_compress.c:333
__lzo_compress crypto/lzo.c:58 [inline]
lzo_scompress+0xb3/0x160 crypto/lzo.c:79
crypto_scomp_compress include/crypto/internal/scompress.h:90 [inline]
scomp_acomp_comp_decomp+0x4a7/0x780 crypto/scompress.c:136
crypto_acomp_compress include/crypto/acompress.h:302 [inline]
zswap_store+0xde8/0x22d0 mm/zswap.c:1309
swap_writepage+0x8b/0x1e0 mm/page_io.c:198
pageout+0x399/0x9d0 mm/vmscan.c:1355
shrink_folio_list+0x2f36/0x3e30 mm/vmscan.c:2015
evict_folios+0x6bf/0x1940 mm/vmscan.c:5195
try_to_shrink_lruvec+0x769/0xb00 mm/vmscan.c:5371
shrink_one+0x45f/0x700 mm/vmscan.c:5415
shrink_many mm/vmscan.c:5469 [inline]
lru_gen_shrink_node mm/vmscan.c:5586 [inline]
shrink_node+0x20d4/0x37a0 mm/vmscan.c:6526
kswapd_shrink_node mm/vmscan.c:7331 [inline]
balance_pgdat+0xa32/0x1b80 mm/vmscan.c:7521
kswapd+0x5be/0xbf0 mm/vmscan.c:7781
kthread+0x33c/0x440 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
Allocated by task 28842:
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+0xa2/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]
__ia32_sys_mount+0x291/0x310 fs/namespace.c:3861
do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline]
__do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178
do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203
entry_SYSENTER_compat_after_hwframe+0x70/0x82
Freed by task 5183:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826
slab_free mm/slub.c:3809 [inline]
__kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822
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_fast_syscall_32+0x6d/0xe0 arch/x86/entry/common.c:181
do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203
entry_SYSENTER_compat_after_hwframe+0x70/0x82
The buggy address belongs to the object at ffff88804ec0c000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 2680 bytes inside of
freed 8192-byte region [ffff88804ec0c000, ffff88804ec0e000)
The buggy address belongs to the physical page:
page:ffffea00013b0200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4ec08
head:ffffea00013b0200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x4fff00000000840(slab|head|node=1|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 04fff00000000840 ffff888012c43180 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000020002 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 28847, tgid 28826 (syz-executor.3), ts 874041385958, free_ts 873977507229
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+0x1d0/0x4a0 mm/page_alloc.c:4426
alloc_pages+0x1a9/0x270 mm/mempolicy.c:2299
alloc_slab_page mm/slub.c:1870 [inline]
allocate_slab+0x251/0x380 mm/slub.c:2017
new_slab mm/slub.c:2070 [inline]
___slab_alloc+0x8c7/0x1580 mm/slub.c:3223
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
__slab_alloc_node mm/slub.c:3375 [inline]
slab_alloc_node mm/slub.c:3468 [inline]
__kmem_cache_alloc_node+0x131/0x340 mm/slub.c:3517
__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_delete_solid_item+0x4f5/0xbc0 fs/reiserfs/stree.c:1453
remove_save_link+0x2bb/0x3f0 fs/reiserfs/super.c:540
reiserfs_truncate_file+0x876/0x1070 fs/reiserfs/inode.c:2318
reiserfs_setattr+0x9c3/0x12a0 fs/reiserfs/inode.c:3392
notify_change+0x742/0x11c0 fs/attr.c:499
do_truncate+0x15c/0x220 fs/open.c:66
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
__unfreeze_partials+0x21d/0x240 mm/slub.c:2655
qlink_free mm/kasan/quarantine.c:166 [inline]
qlist_free_all+0x6a/0x170 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/slub.c:3478 [inline]
slab_alloc mm/slub.c:3486 [inline]
__kmem_cache_alloc_lru mm/slub.c:3493 [inline]
kmem_cache_alloc+0x16c/0x3b0 mm/slub.c:3502
getname_flags.part.0+0x50/0x4e0 fs/namei.c:140
getname_flags include/linux/audit.h:321 [inline]
getname+0x90/0xe0 fs/namei.c:219
do_sys_openat2+0x100/0x1e0 fs/open.c:1416
do_sys_open fs/open.c:1437 [inline]
__do_sys_openat fs/open.c:1453 [inline]
__se_sys_openat fs/open.c:1448 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1448
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:
ffff88804ec0c900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88804ec0c980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88804ec0ca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88804ec0ca80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88804ec0cb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 89 c1 mov %eax,%ecx
2: 48 8b 34 24 mov (%rsp),%rsi
6: 81 e1 00 01 00 00 and $0x100,%ecx
c: 65 48 8b 14 25 c0 bc mov %gs:0x3bcc0,%rdx
13: 03 00
15: a9 00 01 ff 00 test $0xff0100,%eax
1a: 74 0e je 0x2a
1c: 85 c9 test %ecx,%ecx
1e: 74 35 je 0x55
20: 8b 82 04 16 00 00 mov 0x1604(%rdx),%eax
26: 85 c0 test %eax,%eax
28: 74 2b je 0x55
* 2a: 8b 82 e0 15 00 00 mov 0x15e0(%rdx),%eax <-- trapping instruction
30: 83 f8 02 cmp $0x2,%eax
33: 75 20 jne 0x55
35: 48 8b 8a e8 15 00 00 mov 0x15e8(%rdx),%rcx
3c: 8b .byte 0x8b
3d: 92 xchg %eax,%edx
3e: e4 15 in $0x15,%al