==================================================================
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 ffff888028fc8a78 by task syz-executor.2/5200
CPU: 1 PID: 5200 Comm: syz-executor.2 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:__sanitizer_cov_trace_pc+0x3b/0x70 kernel/kcov.c:207
Code: 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 00 00 48 8b 01 48
RSP: 0018:ffffc90003cf6ec8 EFLAGS: 00000246
RAX: 0000000000000000 RBX: ffffc90003cf6f30 RCX: 0000000000000000
RDX: ffff88801d132400 RSI: ffffffff813a6f07 RDI: 0000000000000005
RBP: ffffc90003cf6fc0 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000001 R11: dffffc0000000000 R12: dffffc0000000000
R13: fffff5200079ede8 R14: fffff5200079ede7 R15: ffffc90003cf8000
on_stack arch/x86/include/asm/stacktrace.h:60 [inline]
__unwind_start+0x547/0x880 arch/x86/kernel/unwind_orc.c:758
unwind_start arch/x86/include/asm/unwind.h:64 [inline]
arch_stack_walk+0xaf/0x170 arch/x86/kernel/stacktrace.c:24
stack_trace_save+0x96/0xd0 kernel/stacktrace.c:122
save_stack+0x160/0x1f0 mm/page_owner.c:128
__set_page_owner+0x1f/0x60 mm/page_owner.c:192
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_bulk+0x77a/0x1110 mm/page_alloc.c:4374
alloc_pages_bulk_array_mempolicy+0x1ca/0x370 mm/mempolicy.c:2393
vm_area_alloc_pages mm/vmalloc.c:3028 [inline]
__vmalloc_area_node mm/vmalloc.c:3139 [inline]
__vmalloc_node_range+0xd08/0x1540 mm/vmalloc.c:3320
__vmalloc_node mm/vmalloc.c:3385 [inline]
vzalloc+0x6b/0x80 mm/vmalloc.c:3458
xt_counters_alloc+0x4c/0x70 net/netfilter/x_tables.c:1379
__do_replace+0x9a/0x9c0 net/ipv4/netfilter/arp_tables.c:894
compat_do_replace.constprop.0+0x2d8/0x4b0 net/ipv6/netfilter/ip6_tables.c:1530
do_ip6t_set_ctl+0x5e4/0xbc0 net/ipv6/netfilter/ip6_tables.c:1633
nf_setsockopt+0x87/0xe0 net/netfilter/nf_sockopt.c:101
ipv6_setsockopt+0x12b/0x190 net/ipv6/ipv6_sockglue.c:1017
tcp_setsockopt+0x9d/0x100 net/ipv4/tcp.c:3671
__sys_setsockopt+0x2cd/0x5b0 net/socket.c:2325
__do_compat_sys_socketcall+0x519/0x700 net/compat.c:491
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
RIP: 0023:0xf7f6b579
Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
RSP: 002b:00000000fff56f80 EFLAGS: 00000286 ORIG_RAX: 0000000000000066
RAX: ffffffffffffffda RBX: 000000000000000e RCX: 00000000fff56fa8
RDX: 00000000f7356f34 RSI: 00000000f7353ff4 RDI: 0000000000000066
RBP: 00000000fff56fa8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000282 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Allocated by task 3042:
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 5200:
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
Last potentially related work creation:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492
insert_work+0x38/0x230 kernel/workqueue.c:1647
__queue_work+0x5d0/0x1050 kernel/workqueue.c:1799
queue_work_on+0xed/0x110 kernel/workqueue.c:1834
kref_put include/linux/kref.h:65 [inline]
sg_release+0x244/0x320 drivers/scsi/sg.c:393
__fput+0x3f7/0xa70 fs/file_table.c:384
__fput_sync+0x47/0x50 fs/file_table.c:465
__do_sys_close fs/open.c:1572 [inline]
__se_sys_close fs/open.c:1557 [inline]
__ia32_sys_close+0x87/0xf0 fs/open.c:1557
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
The buggy address belongs to the object at ffff888028fc8000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 2680 bytes inside of
freed 8192-byte region [ffff888028fc8000, ffff888028fca000)
The buggy address belongs to the physical page:
page:ffffea0000a3f200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888028fcc000 pfn:0x28fc8
head:ffffea0000a3f200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888012c43180 ffffea000094b400 dead000000000004
raw: ffff888028fcc000 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 14562, tgid 14561 (syz-executor.2), ts 381554063042, free_ts 381421994061
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:2297
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: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
__block_write_begin_int+0x3c0/0x1560 fs/buffer.c:2120
reiserfs_write_begin+0x351/0xa40 fs/reiserfs/inode.c:2771
generic_cont_expand_simple+0x11f/0x200 fs/buffer.c:2476
reiserfs_setattr+0x36d/0x12a0 fs/reiserfs/inode.c:3302
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]
__kmem_cache_alloc_node+0x195/0x340 mm/slub.c:3517
__do_kmalloc_node mm/slab_common.c:1022 [inline]
__kmalloc_node+0x52/0x110 mm/slab_common.c:1030
kmalloc_node include/linux/slab.h:619 [inline]
kvmalloc_node+0x99/0x1a0 mm/util.c:607
xt_jumpstack_alloc net/netfilter/x_tables.c:1354 [inline]
xt_replace_table+0x1ea/0x920 net/netfilter/x_tables.c:1393
__do_replace+0x1d5/0x9c0 net/ipv4/netfilter/arp_tables.c:912
compat_do_replace.constprop.0+0x2d8/0x4b0 net/ipv6/netfilter/ip6_tables.c:1530
do_ip6t_set_ctl+0x5e4/0xbc0 net/ipv6/netfilter/ip6_tables.c:1633
nf_setsockopt+0x87/0xe0 net/netfilter/nf_sockopt.c:101
ipv6_setsockopt+0x12b/0x190 net/ipv6/ipv6_sockglue.c:1017
tcp_setsockopt+0x9d/0x100 net/ipv4/tcp.c:3671
Memory state around the buggy address:
ffff888028fc8900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888028fc8980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888028fc8a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888028fc8a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888028fc8b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 81 e1 00 01 00 00 and $0x100,%ecx
6: 65 48 8b 14 25 c0 bc mov %gs:0x3bcc0,%rdx
d: 03 00
f: a9 00 01 ff 00 test $0xff0100,%eax
14: 74 0e je 0x24
16: 85 c9 test %ecx,%ecx
18: 74 35 je 0x4f
1a: 8b 82 04 16 00 00 mov 0x1604(%rdx),%eax
20: 85 c0 test %eax,%eax
22: 74 2b je 0x4f
24: 8b 82 e0 15 00 00 mov 0x15e0(%rdx),%eax
* 2a: 83 f8 02 cmp $0x2,%eax <-- trapping instruction
2d: 75 20 jne 0x4f
2f: 48 8b 8a e8 15 00 00 mov 0x15e8(%rdx),%rcx
36: 8b 92 e4 15 00 00 mov 0x15e4(%rdx),%edx
3c: 48 8b 01 mov (%rcx),%rax
3f: 48 rex.W