==================================================================
BUG: KASAN: slab-use-after-free in __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [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 ffff888053e87818 by task kworker/3:5/6095
CPU: 3 UID: 0 PID: 6095 Comm: kworker/3:5 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: rcu_gp process_srcu
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xcd/0x630 mm/kasan/report.c:482
kasan_report+0xe0/0x110 mm/kasan/report.c:595
__kasan_check_byte+0x36/0x50 mm/kasan/common.c:580
kasan_check_byte include/linux/kasan.h:401 [inline]
lock_acquire kernel/locking/lockdep.c:5842 [inline]
lock_acquire+0xfc/0x350 kernel/locking/lockdep.c:5825
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
p9_tag_remove net/9p/client.c:397 [inline]
p9_req_put net/9p/client.c:405 [inline]
p9_req_put+0xaf/0x250 net/9p/client.c:402
req_done+0x1dc/0x2e0 net/9p/trans_virtio.c:147
vring_interrupt drivers/virtio/virtio_ring.c:2718 [inline]
vring_interrupt+0x31e/0x400 drivers/virtio/virtio_ring.c:2693
__handle_irq_event_percpu+0x236/0x920 kernel/irq/handle.c:203
handle_irq_event_percpu kernel/irq/handle.c:240 [inline]
handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:257
handle_edge_irq+0x3ca/0x9e0 kernel/irq/chip.c:855
generic_handle_irq_desc include/linux/irqdesc.h:173 [inline]
handle_irq arch/x86/kernel/irq.c:254 [inline]
call_irq_handler arch/x86/kernel/irq.c:310 [inline]
__common_interrupt+0xd0/0x2f0 arch/x86/kernel/irq.c:325
common_interrupt+0xba/0xe0 arch/x86/kernel/irq.c:318
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:688
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:202
Code: 90 f3 0f 1e fa 53 48 8b 74 24 08 48 89 fb 48 83 c7 18 e8 9a 8a 35 f6 48 89 df e8 82 de 35 f6 e8 3d b5 61 f6 fb bf 01 00 00 00 b2 e6 25 f6 65 8b 05 eb 25 3e 08 85 c0 74 06 5b e9 51 4d 00 00
RSP: 0018:ffffc90004e87c40 EFLAGS: 00000206
RAX: 0000000000039f05 RBX: ffff88806a7392c0 RCX: ffffffff81c50e6f
RDX: 0000000000000000 RSI: ffffffff8da2b6dd RDI: 0000000000000001
RBP: ffff888100ac6ad0 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff90820cd7 R11: 0000000000000001 R12: ffff88802999a480
R13: 0000000000000000 R14: ffffffff90823d54 R15: 0000000000000001
process_one_work+0x82d/0x1b70 kernel/workqueue.c:3232
process_scheduled_works kernel/workqueue.c:3346 [inline]
worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427
kthread+0x3c5/0x780 kernel/kthread.c:463
ret_from_fork+0x675/0x7d0 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Allocated by task 16276:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:56
kasan_save_track+0x14/0x30 mm/kasan/common.c:77
poison_kmalloc_redzone mm/kasan/common.c:400 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417
kmalloc_noprof include/linux/slab.h:957 [inline]
p9_client_create+0xc7/0x11d0 net/9p/client.c:985
v9fs_session_init+0x1f7/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc5/0xa90 fs/9p/vfs_super.c:122
legacy_get_tree+0x10c/0x220 fs/fs_context.c:663
vfs_get_tree+0x8e/0x340 fs/super.c:1751
fc_mount fs/namespace.c:1208 [inline]
do_new_mount_fc fs/namespace.c:3651 [inline]
do_new_mount fs/namespace.c:3727 [inline]
path_mount+0x7b9/0x23a0 fs/namespace.c:4037
do_mount fs/namespace.c:4050 [inline]
__do_sys_mount fs/namespace.c:4238 [inline]
__se_sys_mount fs/namespace.c:4215 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:4215
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Freed by task 16276:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:56
kasan_save_track+0x14/0x30 mm/kasan/common.c:77
__kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:587
kasan_save_free_info mm/kasan/kasan.h:406 [inline]
poison_slab_object mm/kasan/common.c:252 [inline]
__kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284
kasan_slab_free include/linux/kasan.h:234 [inline]
slab_free_hook mm/slub.c:2539 [inline]
slab_free mm/slub.c:6634 [inline]
kfree+0x2b8/0x6d0 mm/slub.c:6841
p9_client_create+0xa28/0x11d0 net/9p/client.c:1064
v9fs_session_init+0x1f7/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc5/0xa90 fs/9p/vfs_super.c:122
legacy_get_tree+0x10c/0x220 fs/fs_context.c:663
vfs_get_tree+0x8e/0x340 fs/super.c:1751
fc_mount fs/namespace.c:1208 [inline]
do_new_mount_fc fs/namespace.c:3651 [inline]
do_new_mount fs/namespace.c:3727 [inline]
path_mount+0x7b9/0x23a0 fs/namespace.c:4037
do_mount fs/namespace.c:4050 [inline]
__do_sys_mount fs/namespace.c:4238 [inline]
__se_sys_mount fs/namespace.c:4215 [inline]
__x64_sys_mount+0x293/0x310 fs/namespace.c:4215
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888053e87800
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
freed 512-byte region [ffff888053e87800, ffff888053e87a00)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x53e84
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 ffff88801b442c80 ffffea0000cb9b00 dead000000000002
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801b442c80 ffffea0000cb9b00 dead000000000002
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea00014fa101 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 5940, tgid 5940 (syz-executor), ts 55563896016, free_ts 55560131009
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850
prep_new_page mm/page_alloc.c:1858 [inline]
get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3884
__alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5183
alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416
alloc_slab_page mm/slub.c:3055 [inline]
allocate_slab mm/slub.c:3228 [inline]
new_slab+0x24a/0x360 mm/slub.c:3282
___slab_alloc+0xd79/0x1a50 mm/slub.c:4651
__slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4774
__slab_alloc_node mm/slub.c:4850 [inline]
slab_alloc_node mm/slub.c:5272 [inline]
__do_kmalloc_node mm/slub.c:5645 [inline]
__kmalloc_noprof+0x501/0x880 mm/slub.c:5658
kmalloc_noprof include/linux/slab.h:961 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155
ip6_route_info_create+0x14c/0x870 net/ipv6/route.c:3809
ip6_route_add.part.0+0x22/0x1d0 net/ipv6/route.c:3938
ip6_route_add+0x45/0x60 net/ipv6/route.c:3935
addrconf_add_mroute+0x1dd/0x350 net/ipv6/addrconf.c:2552
addrconf_add_dev+0x14e/0x1c0 net/ipv6/addrconf.c:2570
inet6_addr_add+0xfe/0x960 net/ipv6/addrconf.c:3032
inet6_rtm_newaddr+0x1619/0x1c70 net/ipv6/addrconf.c:5059
page last free pid 5933 tgid 5933 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1394 [inline]
__free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2906
stack_depot_save_flags+0x352/0x9c0 lib/stackdepot.c:727
kasan_save_stack+0x42/0x60 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:77
poison_kmalloc_redzone mm/kasan/common.c:400 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417
kasan_kmalloc include/linux/kasan.h:262 [inline]
__do_kmalloc_node mm/slub.c:5646 [inline]
__kmalloc_node_track_caller_noprof+0x345/0x8a0 mm/slub.c:5755
kmemdup_noprof+0x29/0x60 mm/util.c:138
ip6t_register_table+0x224/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+0x2e4/0x520 net/netfilter/x_tables.c:1260
xt_request_find_table_lock+0x28/0xf0 net/netfilter/x_tables.c:1285
get_info+0x19c/0x7d0 net/ipv4/netfilter/arp_tables.c:808
do_ip6t_get_ctl+0x169/0xae0 net/ipv6/netfilter/ip6_tables.c:1668
nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116
ipv6_getsockopt+0x1f7/0x280 net/ipv6/ipv6_sockglue.c:1473
tcp_getsockopt+0xa1/0x100 net/ipv4/tcp.c:4810
Memory state around the buggy address:
ffff888053e87700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888053e87780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888053e87800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888053e87880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888053e87900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 90 nop
1: f3 0f 1e fa endbr64
5: 53 push %rbx
6: 48 8b 74 24 08 mov 0x8(%rsp),%rsi
b: 48 89 fb mov %rdi,%rbx
e: 48 83 c7 18 add $0x18,%rdi
12: e8 9a 8a 35 f6 call 0xf6358ab1
17: 48 89 df mov %rbx,%rdi
1a: e8 82 de 35 f6 call 0xf635dea1
1f: e8 3d b5 61 f6 call 0xf661b561
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 b2 e6 25 f6 call 0xf625e6e1 <-- trapping instruction
2f: 65 8b 05 eb 25 3e 08 mov %gs:0x83e25eb(%rip),%eax # 0x83e2621
36: 85 c0 test %eax,%eax
38: 74 06 je 0x40
3a: 5b pop %rbx
3b: e9 51 4d 00 00 jmp 0x4d91