==================================================================
BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:132 [inline]
BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
Read of size 1 at addr ffff88802a2e0018 by task swapper/3/0
CPU: 3 UID: 0 PID: 0 Comm: swapper/3 Tainted: G L syzkaller #0 PREEMPT(full)
Tainted: [L]=SOFTLOCKUP
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x156/0x4c9 mm/kasan/report.c:482
kasan_report+0xdf/0x1e0 mm/kasan/report.c:595
__kasan_check_byte+0x36/0x50 mm/kasan/common.c:574
kasan_check_byte include/linux/kasan.h:402 [inline]
lock_acquire kernel/locking/lockdep.c:5842 [inline]
lock_acquire+0x148/0x380 kernel/locking/lockdep.c:5825
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:132 [inline]
_raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
p9_tag_remove net/9p/client.c:274 [inline]
p9_req_put net/9p/client.c:282 [inline]
p9_req_put+0xaf/0x250 net/9p/client.c:279
req_done+0x1dc/0x2e0 net/9p/trans_virtio.c:147
vring_interrupt+0x2ef/0x650 drivers/virtio/virtio_ring.c:3255
__handle_irq_event_percpu+0x232/0x8e0 kernel/irq/handle.c:209
handle_irq_event_percpu kernel/irq/handle.c:246 [inline]
handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:263
handle_edge_irq+0x375/0x970 kernel/irq/chip.c:855
generic_handle_irq_desc include/linux/irqdesc.h:186 [inline]
handle_irq arch/x86/kernel/irq.c:262 [inline]
call_irq_handler arch/x86/kernel/irq.c:318 [inline]
__common_interrupt+0xd8/0x2f0 arch/x86/kernel/irq.c:333
common_interrupt+0x60/0xe0 arch/x86/kernel/irq.c:326
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688
RIP: 0010:handle_softirqs+0x1af/0x9e0 kernel/softirq.c:608
Code: 89 64 24 18 44 88 6c 24 1e 48 c7 c7 60 72 ad 8b e8 a6 6f c5 09 31 d2 65 66 89 15 c4 ea 43 12 e8 97 a0 47 00 fb bb ff ff ff ff <49> c7 c6 c0 c0 40 8e 41 0f bc df 83 c3 01 0f 85 a3 00 00 00 e9 48
RSP: 0018:ffffc900006f8f30 EFLAGS: 00000202
RAX: 000000000011e0c4 RBX: 00000000ffffffff RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8de6cf89 RDI: ffffffff8c1adf20
RBP: 00000000ffffe821 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: 000000000000000a
R13: 0000000000000000 R14: 0000000004200042 R15: 0000000000000282
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0xef/0x150 kernel/softirq.c:723
irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1056
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:pv_native_safe_halt+0xf/0x20 arch/x86/kernel/paravirt.c:63
Code: 98 83 02 c3 cc cc cc cc 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa eb 07 0f 00 2d 43 2c 1d 00 fb f4 bc 35 03 00 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
RSP: 0018:ffffc90000197df0 EFLAGS: 00000202
RAX: 000000000011e0bf RBX: ffff88801ee8a480 RCX: ffffffff8b8e5c75
RDX: 0000000000000000 RSI: ffffffff8de6cf89 RDI: ffffffff8c1adf20
RBP: 0000000000000003 R08: 0000000000000001 R09: ffffed100d4e6795
R10: ffff88806a733cab R11: 0000000000000000 R12: ffffed1003dd1490
R13: 0000000000000003 R14: ffffffff90d92f10 R15: 0000000000000000
arch_safe_halt arch/x86/include/asm/paravirt.h:73 [inline]
default_idle+0x9/0x10 arch/x86/kernel/process.c:767
default_idle_call+0x6c/0xb0 kernel/sched/idle.c:122
cpuidle_idle_call kernel/sched/idle.c:191 [inline]
do_idle+0x35b/0x4b0 kernel/sched/idle.c:332
cpu_startup_entry+0x4f/0x60 kernel/sched/idle.c:430
start_secondary+0x21d/0x2d0 arch/x86/kernel/smpboot.c:312
common_startup_64+0x13e/0x148
Allocated by task 12566:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
kmalloc_noprof include/linux/slab.h:962 [inline]
p9_client_create+0xaf/0xd40 net/9p/client.c:862
v9fs_session_init+0x40/0xce0 fs/9p/v9fs.c:442
v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97
vfs_get_tree+0x92/0x320 fs/super.c:1754
fc_mount fs/namespace.c:1193 [inline]
do_new_mount_fc fs/namespace.c:3760 [inline]
do_new_mount fs/namespace.c:3836 [inline]
path_mount+0x7d0/0x23d0 fs/namespace.c:4146
do_mount fs/namespace.c:4159 [inline]
__do_sys_mount fs/namespace.c:4348 [inline]
__se_sys_mount fs/namespace.c:4325 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:4325
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 12566:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584
poison_slab_object mm/kasan/common.c:253 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:2670 [inline]
slab_free mm/slub.c:6082 [inline]
kfree+0x1f6/0x6b0 mm/slub.c:6399
p9_client_create+0x72d/0xd40 net/9p/client.c:941
v9fs_session_init+0x40/0xce0 fs/9p/v9fs.c:442
v9fs_get_tree+0xb8/0xb50 fs/9p/vfs_super.c:97
vfs_get_tree+0x92/0x320 fs/super.c:1754
fc_mount fs/namespace.c:1193 [inline]
do_new_mount_fc fs/namespace.c:3760 [inline]
do_new_mount fs/namespace.c:3836 [inline]
path_mount+0x7d0/0x23d0 fs/namespace.c:4146
do_mount fs/namespace.c:4159 [inline]
__do_sys_mount fs/namespace.c:4348 [inline]
__se_sys_mount fs/namespace.c:4325 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:4325
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802a2e0000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
freed 512-byte region [ffff88802a2e0000, ffff88802a2e0200)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a2e0
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801b842c80 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b842c80 dead000000000100 dead000000000122
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0000a8b801 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 12462, tgid 12462 (syz-executor), ts 240079970863, free_ts 112748008082
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x153/0x170 mm/page_alloc.c:1888
prep_new_page mm/page_alloc.c:1896 [inline]
get_page_from_freelist+0x111d/0x3140 mm/page_alloc.c:3961
__alloc_frozen_pages_noprof+0x27c/0x2ba0 mm/page_alloc.c:5249
alloc_slab_page mm/slub.c:3238 [inline]
allocate_slab mm/slub.c:3411 [inline]
new_slab+0xa6/0x6e0 mm/slub.c:3469
refill_objects+0x26b/0x400 mm/slub.c:7091
refill_sheaf mm/slub.c:2787 [inline]
alloc_full_sheaf mm/slub.c:2808 [inline]
__pcs_replace_empty_main+0x19f/0x600 mm/slub.c:4546
alloc_from_pcs mm/slub.c:4639 [inline]
slab_alloc_node mm/slub.c:4773 [inline]
__do_kmalloc_node mm/slub.c:5176 [inline]
__kmalloc_node_track_caller_noprof+0x694/0x850 mm/slub.c:5285
kmemdup_noprof+0x29/0x60 mm/util.c:138
ip6t_register_table+0x1cd/0x430 net/ipv6/netfilter/ip6_tables.c:1776
ip6table_mangle_table_init+0x40/0x60 net/ipv6/netfilter/ip6table_mangle.c:85
xt_find_table_lock+0x2df/0x520 net/netfilter/x_tables.c:1260
xt_request_find_table_lock+0x28/0xf0 net/netfilter/x_tables.c:1285
get_info+0x1a7/0x770 net/ipv6/netfilter/ip6_tables.c:979
do_ip6t_get_ctl+0x168/0xac0 net/ipv6/netfilter/ip6_tables.c:1668
nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116
ipv6_getsockopt+0x207/0x2a0 net/ipv6/ipv6_sockglue.c:1473
page last free pid 1333 tgid 1333 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1432 [inline]
__free_frozen_pages+0x7ca/0x10a0 mm/page_alloc.c:2977
kasan_depopulate_vmalloc_pte+0x5d/0x80 mm/kasan/shadow.c:484
apply_to_pte_range mm/memory.c:3235 [inline]
apply_to_pmd_range mm/memory.c:3279 [inline]
apply_to_pud_range mm/memory.c:3315 [inline]
apply_to_p4d_range mm/memory.c:3351 [inline]
__apply_to_page_range+0xb1d/0x1520 mm/memory.c:3387
__kasan_release_vmalloc+0xd7/0xe0 mm/kasan/shadow.c:602
kasan_release_vmalloc include/linux/kasan.h:593 [inline]
kasan_release_vmalloc_node mm/vmalloc.c:2290 [inline]
purge_vmap_node+0x210/0xb40 mm/vmalloc.c:2312
process_one_work+0x9d7/0x1920 kernel/workqueue.c:3275
process_scheduled_works kernel/workqueue.c:3358 [inline]
worker_thread+0x5da/0xe40 kernel/workqueue.c:3439
kthread+0x370/0x450 kernel/kthread.c:467
ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Memory state around the buggy address:
ffff88802a2dff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802a2dff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802a2e0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88802a2e0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88802a2e0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 89 64 24 18 mov %esp,0x18(%rsp)
4: 44 88 6c 24 1e mov %r13b,0x1e(%rsp)
9: 48 c7 c7 60 72 ad 8b mov $0xffffffff8bad7260,%rdi
10: e8 a6 6f c5 09 call 0x9c56fbb
15: 31 d2 xor %edx,%edx
17: 65 66 89 15 c4 ea 43 mov %dx,%gs:0x1243eac4(%rip) # 0x1243eae3
1e: 12
1f: e8 97 a0 47 00 call 0x47a0bb
24: fb sti
25: bb ff ff ff ff mov $0xffffffff,%ebx
* 2a: 49 c7 c6 c0 c0 40 8e mov $0xffffffff8e40c0c0,%r14 <-- trapping instruction
31: 41 0f bc df bsf %r15d,%ebx
35: 83 c3 01 add $0x1,%ebx
38: 0f 85 a3 00 00 00 jne 0xe1
3e: e9 .byte 0xe9
3f: 48 rex.W