==================================================================
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:166
Read of size 1 at addr ffff8880564b9418 by task syz.0.1075/9984
CPU: 3 UID: 0 PID: 9984 Comm: syz.0.1075 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+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1d0 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+0x12a/0x370 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:166
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:3254
__handle_irq_event_percpu+0x235/0x8c0 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+0x35e/0x960 kernel/irq/chip.c:856
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+0x1ad/0xa00 kernel/softirq.c:608
Code: 30 44 88 74 24 23 45 89 ee 48 c7 c7 80 76 ad 8b e8 c8 ed d1 09 31 d2 65 66 89 15 16 45 4b 12 e8 c9 a1 48 00 fb bb ff ff ff ff <49> c7 c4 c0 a0 40 8e 41 0f bc de 83 c3 01 0f 85 a4 00 00 00 e9 47
RSP: 0018:ffffc900006f8f20 EFLAGS: 00000206
RAX: 000000000000045a RBX: 00000000ffffffff RCX: 0000000000000004
RDX: 0000000000000000 RSI: ffffffff8df5a6ec RDI: ffffffff8c1c1d80
RBP: 00000000fffff902 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: 000000000000000a
R13: 0000000000000282 R14: 0000000000000282 R15: 1ffff920000df1ec
__do_softirq kernel/softirq.c:656 [inline]
invoke_softirq kernel/softirq.c:496 [inline]
__irq_exit_rcu+0x162/0x210 kernel/softirq.c:735
irq_exit_rcu+0x9/0x30 kernel/softirq.c:752
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1061 [inline]
sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1061
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x70 kernel/kcov.c:210
Code: 56 5b 5c 00 48 89 df 5b e9 7d e6 61 00 be 03 00 00 00 5b e9 a2 50 f0 02 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1e fa 65 8b 05 45 e5 0a 12 48 8b 34 24 65 48 8b 15 21 e5 0a
RSP: 0018:ffffc90005f0f498 EFLAGS: 00000282
RAX: 0000000000000000 RBX: 000000000004c7e2 RCX: ffffffff82833e14
RDX: 0000000080000001 RSI: 0000000000000000 RDI: ffff88803074a500
RBP: 0000000080000001 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000001 R11: 0000000000000000 R12: 0000000000000008
R13: 0000000000000001 R14: 0000000000000001 R15: 800000004c7e2007
page_table_check_clear+0x1a1/0x8f0 mm/page_table_check.c:70
__page_table_check_pte_clear+0xf1/0x100 mm/page_table_check.c:155
page_table_check_pte_clear include/linux/page_table_check.h:55 [inline]
ptep_get_and_clear_full arch/x86/include/asm/pgtable.h:1263 [inline]
get_and_clear_full_ptes include/linux/pgtable.h:845 [inline]
zap_present_folio_ptes mm/memory.c:1632 [inline]
zap_present_ptes mm/memory.c:1714 [inline]
do_zap_pte_range mm/memory.c:1816 [inline]
zap_pte_range mm/memory.c:1918 [inline]
zap_pmd_range mm/memory.c:2004 [inline]
zap_pud_range mm/memory.c:2032 [inline]
zap_p4d_range mm/memory.c:2053 [inline]
__zap_vma_range+0x2da3/0x4bf0 mm/memory.c:2093
unmap_vmas+0x299/0x5f0 mm/memory.c:2162
exit_mmap+0x1ef/0xa10 mm/mmap.c:1300
__mmput+0x12a/0x410 kernel/fork.c:1178
mmput+0x67/0x80 kernel/fork.c:1201
exit_mm kernel/exit.c:581 [inline]
do_exit+0x833/0x2a60 kernel/exit.c:963
do_group_exit+0xd5/0x2a0 kernel/exit.c:1117
get_signal+0x1ec7/0x21e0 kernel/signal.c:3037
arch_do_signal_or_restart+0x91/0x7a0 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:64 [inline]
exit_to_user_mode_loop+0x86/0x4a0 kernel/entry/common.c:98
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:238 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
do_syscall_64+0x706/0xf80 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5e5bb9c819
Code: Unable to access opcode bytes at 0x7f5e5bb9c7ef.
RSP: 002b:00007f5e5c9ce0e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 00007f5e5be15fa8 RCX: 00007f5e5bb9c819
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f5e5be15fac
RBP: 00007f5e5be15fa0 R08: 0000000000000001 R09: 0000000000000000
R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5e5be16038 R14: 00007ffeb7f46b80 R15: 00007ffeb7f46c68
Allocated by task 9982:
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:950 [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:3758 [inline]
do_new_mount fs/namespace.c:3834 [inline]
path_mount+0x7d0/0x23d0 fs/namespace.c:4154
do_mount fs/namespace.c:4167 [inline]
__do_sys_mount fs/namespace.c:4383 [inline]
__se_sys_mount fs/namespace.c:4360 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:4360
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 9982:
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:2689 [inline]
slab_free mm/slub.c:6246 [inline]
kfree+0x223/0x6c0 mm/slub.c:6561
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:3758 [inline]
do_new_mount fs/namespace.c:3834 [inline]
path_mount+0x7d0/0x23d0 fs/namespace.c:4154
do_mount fs/namespace.c:4167 [inline]
__do_sys_mount fs/namespace.c:4383 [inline]
__se_sys_mount fs/namespace.c:4360 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:4360
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff8880564b9400
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
freed 512-byte region [ffff8880564b9400, ffff8880564b9600)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x564b8
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 0000000800100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b842c80 dead000000000100 dead000000000122
head: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffffffffffff01 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 6071, tgid 6069 (syz.0.1), ts 138416554925, free_ts 138359284328
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x153/0x170 mm/page_alloc.c:1858
prep_new_page mm/page_alloc.c:1866 [inline]
get_page_from_freelist+0x11a6/0x33b0 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x27c/0x2bc0 mm/page_alloc.c:5226
alloc_slab_page mm/slub.c:3278 [inline]
allocate_slab mm/slub.c:3467 [inline]
new_slab+0xa6/0x6c0 mm/slub.c:3525
refill_objects+0x277/0x420 mm/slub.c:7251
refill_sheaf mm/slub.c:2816 [inline]
__pcs_replace_empty_main+0x375/0x650 mm/slub.c:4651
alloc_from_pcs mm/slub.c:4749 [inline]
slab_alloc_node mm/slub.c:4883 [inline]
__kmalloc_cache_noprof+0x493/0x6f0 mm/slub.c:5410
kmalloc_noprof include/linux/slab.h:950 [inline]
kzalloc_noprof include/linux/slab.h:1188 [inline]
mca_alloc net/ipv6/mcast.c:871 [inline]
__ipv6_dev_mc_inc+0x2f1/0xbc0 net/ipv6/mcast.c:961
ipv6_add_dev+0xb78/0x1520 net/ipv6/addrconf.c:472
addrconf_notify+0x5db/0x1ba0 net/ipv6/addrconf.c:3662
notifier_call_chain+0x99/0x400 kernel/notifier.c:85
call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2249
call_netdevice_notifiers_extack net/core/dev.c:2287 [inline]
call_netdevice_notifiers net/core/dev.c:2301 [inline]
register_netdevice+0x18fe/0x24b0 net/core/dev.c:11465
tun_set_iff drivers/net/tun.c:2809 [inline]
__tun_chr_ioctl+0x1ded/0x47c0 drivers/net/tun.c:3090
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94
page last free pid 6071 tgid 6069 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1402 [inline]
__free_frozen_pages+0x747/0x1040 mm/page_alloc.c:2943
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350
kasan_slab_alloc include/linux/kasan.h:253 [inline]
slab_post_alloc_hook mm/slub.c:4569 [inline]
slab_alloc_node mm/slub.c:4898 [inline]
kmem_cache_alloc_noprof+0x241/0x6e0 mm/slub.c:4905
__kernfs_new_node+0xd2/0x9f0 fs/kernfs/dir.c:664
kernfs_new_node+0x11b/0x1a0 fs/kernfs/dir.c:748
__kernfs_create_file+0x53/0x350 fs/kernfs/file.c:1057
sysfs_add_file_mode_ns+0x207/0x3c0 fs/sysfs/file.c:313
create_files fs/sysfs/group.c:82 [inline]
internal_create_group+0x593/0xf40 fs/sysfs/group.c:189
internal_create_groups+0x9d/0x150 fs/sysfs/group.c:229
device_add_groups drivers/base/core.c:2837 [inline]
device_add_attrs drivers/base/core.c:2901 [inline]
device_add+0x71a/0x1950 drivers/base/core.c:3645
netdev_register_kobject+0x1a9/0x3d0 net/core/net-sysfs.c:2343
register_netdevice+0x151c/0x24b0 net/core/dev.c:11427
tun_set_iff drivers/net/tun.c:2809 [inline]
__tun_chr_ioctl+0x1ded/0x47c0 drivers/net/tun.c:3090
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
Memory state around the buggy address:
ffff8880564b9300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880564b9380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880564b9400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880564b9480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880564b9500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 30 44 88 74 xor %al,0x74(%rax,%rcx,4)
4: 24 23 and $0x23,%al
6: 45 89 ee mov %r13d,%r14d
9: 48 c7 c7 80 76 ad 8b mov $0xffffffff8bad7680,%rdi
10: e8 c8 ed d1 09 call 0x9d1eddd
15: 31 d2 xor %edx,%edx
17: 65 66 89 15 16 45 4b mov %dx,%gs:0x124b4516(%rip) # 0x124b4535
1e: 12
1f: e8 c9 a1 48 00 call 0x48a1ed
24: fb sti
25: bb ff ff ff ff mov $0xffffffff,%ebx
* 2a: 49 c7 c4 c0 a0 40 8e mov $0xffffffff8e40a0c0,%r12 <-- trapping instruction
31: 41 0f bc de bsf %r14d,%ebx
35: 83 c3 01 add $0x1,%ebx
38: 0f 85 a4 00 00 00 jne 0xe2
3e: e9 .byte 0xe9
3f: 47 rex.RXB