==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0x2de0/0x3cb0 kernel/locking/lockdep.c:5007
Read of size 8 at addr ffff888026b6c418 by task kworker/u32:8/1106
CPU: 0 UID: 0 PID: 1106 Comm: kworker/u32:8 Not tainted 6.11.0-rc5-syzkaller-00015-g3e9bff3bbe13 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: bat_events batadv_nc_worker
Call Trace:
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
__lock_acquire+0x2de0/0x3cb0 kernel/locking/lockdep.c:5007
lock_acquire kernel/locking/lockdep.c:5759 [inline]
lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5724
__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+0x1e7/0x2f0 net/9p/trans_virtio.c:147
vring_interrupt drivers/virtio/virtio_ring.c:2595 [inline]
vring_interrupt+0x31b/0x400 drivers/virtio/virtio_ring.c:2570
__handle_irq_event_percpu+0x229/0x7c0 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0xab/0x1e0 kernel/irq/handle.c:210
handle_edge_irq+0x263/0xd10 kernel/irq/chip.c:831
generic_handle_irq_desc include/linux/irqdesc.h:173 [inline]
handle_irq arch/x86/kernel/irq.c:247 [inline]
call_irq_handler arch/x86/kernel/irq.c:259 [inline]
__common_interrupt+0xdf/0x250 arch/x86/kernel/irq.c:285
common_interrupt+0xab/0xd0 arch/x86/kernel/irq.c:278
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
RIP: 0010:lockdep_enabled kernel/locking/lockdep.c:121 [inline]
RIP: 0010:lock_release+0x129/0x6f0 kernel/locking/lockdep.c:5772
Code: 0f 85 d6 02 00 00 65 4c 8b 35 43 97 9a 7e 49 8d be dc 0a 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 14 02 <48> 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 59 05 00 00 41
RSP: 0018:ffffc90006bf7ad0 EFLAGS: 00000a03
RAX: dffffc0000000000 RBX: 1ffff92000d7ef5c RCX: ffffffff81694359
RDX: 0000000000000000 RSI: ffffffff8bb05960 RDI: ffff8880205caf1c
RBP: ffffffff901178b8 R08: 0000000000000000 R09: fffffbfff20228fb
R10: ffffffff901147df R11: 0000000000000000 R12: ffffffff8ddb94a0
R13: ffff8880158b0000 R14: ffff8880205ca440 R15: dffffc0000000000
rcu_lock_release include/linux/rcupdate.h:336 [inline]
rcu_read_unlock include/linux/rcupdate.h:869 [inline]
batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline]
batadv_nc_worker+0x88c/0x1060 net/batman-adv/network-coding.c:719
process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xed0 kernel/workqueue.c:3389
kthread+0x2c1/0x3a0 kernel/kthread.c:389
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Allocated by task 8071:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
kmalloc_noprof include/linux/slab.h:681 [inline]
p9_client_create+0xcf/0x11b0 net/9p/client.c:983
v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc6/0xa50 fs/9p/vfs_super.c:122
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8f/0x380 fs/super.c:1800
do_new_mount fs/namespace.c:3472 [inline]
path_mount+0x6e1/0x1f10 fs/namespace.c:3799
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount fs/namespace.c:3997 [inline]
__ia32_sys_mount+0x292/0x310 fs/namespace.c:3997
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
Freed by task 8071:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579
poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
__kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2252 [inline]
slab_free mm/slub.c:4473 [inline]
kfree+0x12a/0x3b0 mm/slub.c:4594
p9_client_create+0x9ca/0x11b0 net/9p/client.c:1054
v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
v9fs_mount+0xc6/0xa50 fs/9p/vfs_super.c:122
legacy_get_tree+0x109/0x220 fs/fs_context.c:662
vfs_get_tree+0x8f/0x380 fs/super.c:1800
do_new_mount fs/namespace.c:3472 [inline]
path_mount+0x6e1/0x1f10 fs/namespace.c:3799
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount fs/namespace.c:3997 [inline]
__ia32_sys_mount+0x292/0x310 fs/namespace.c:3997
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
The buggy address belongs to the object at ffff888026b6c400
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
freed 512-byte region [ffff888026b6c400, ffff888026b6c600)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888026b6dc00 pfn:0x26b6c
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: 0xfdffffff(slab)
raw: 00fff00000000040 ffff888015842c80 ffffea000048e200 dead000000000002
raw: ffff888026b6dc00 000000008010000e 00000001fdffffff 0000000000000000
head: 00fff00000000040 ffff888015842c80 ffffea000048e200 dead000000000002
head: ffff888026b6dc00 000000008010000e 00000001fdffffff 0000000000000000
head: 00fff00000000002 ffffea00009adb01 ffffffffffffffff 0000000000000000
head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x352800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 5840, tgid 5840 (syz-executor), ts 82588410229, free_ts 82564170314
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493
prep_new_page mm/page_alloc.c:1501 [inline]
get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3439
__alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4695
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x4e/0xf0 mm/slub.c:2321
allocate_slab mm/slub.c:2484 [inline]
new_slab+0x84/0x260 mm/slub.c:2537
___slab_alloc+0xdac/0x1870 mm/slub.c:3723
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3813
__slab_alloc_node mm/slub.c:3866 [inline]
slab_alloc_node mm/slub.c:4025 [inline]
__do_kmalloc_node mm/slub.c:4157 [inline]
__kmalloc_node_noprof+0x367/0x440 mm/slub.c:4164
kmalloc_array_node_noprof include/linux/slab.h:788 [inline]
alloc_slab_obj_exts+0x41/0xa0 mm/slub.c:1976
account_slab mm/slub.c:2447 [inline]
allocate_slab mm/slub.c:2502 [inline]
new_slab+0x20f/0x260 mm/slub.c:2537
___slab_alloc+0xdac/0x1870 mm/slub.c:3723
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3813
__slab_alloc_node mm/slub.c:3866 [inline]
slab_alloc_node mm/slub.c:4025 [inline]
kmem_cache_alloc_noprof+0x2ae/0x2f0 mm/slub.c:4044
leaf_new net/ipv4/fib_trie.c:359 [inline]
fib_insert_node net/ipv4/fib_trie.c:1115 [inline]
fib_insert_alias+0x43c/0xe30 net/ipv4/fib_trie.c:1165
fib_table_insert+0xaab/0x1d70 net/ipv4/fib_trie.c:1379
fib_magic+0x4d6/0x5c0 net/ipv4/fib_frontend.c:1104
page last free pid 5875 tgid 5875 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1094 [inline]
free_unref_page+0x64a/0xe40 mm/page_alloc.c:2612
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3988 [inline]
slab_alloc_node mm/slub.c:4037 [inline]
kmem_cache_alloc_node_noprof+0x153/0x310 mm/slub.c:4080
__alloc_skb+0x2b3/0x380 net/core/skbuff.c:664
alloc_skb include/linux/skbuff.h:1320 [inline]
alloc_skb_with_frags+0xe4/0x710 net/core/skbuff.c:6526
sock_alloc_send_pskb+0x7f1/0x980 net/core/sock.c:2815
sock_alloc_send_skb include/net/sock.h:1778 [inline]
mld_newpack.isra.0+0x1d4/0x7e0 net/ipv6/mcast.c:1746
add_grhead+0x299/0x340 net/ipv6/mcast.c:1849
add_grec+0x111e/0x1670 net/ipv6/mcast.c:1987
mld_send_cr net/ipv6/mcast.c:2113 [inline]
mld_ifc_work+0x41f/0xca0 net/ipv6/mcast.c:2650
process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231
process_scheduled_works kernel/workqueue.c:3312 [inline]
worker_thread+0x6c8/0xed0 kernel/workqueue.c:3389
kthread+0x2c1/0x3a0 kernel/kthread.c:389
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
Memory state around the buggy address:
ffff888026b6c300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888026b6c380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888026b6c400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888026b6c480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888026b6c500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 0f 85 d6 02 00 00 jne 0x2dc
6: 65 4c 8b 35 43 97 9a mov %gs:0x7e9a9743(%rip),%r14 # 0x7e9a9751
d: 7e
e: 49 8d be dc 0a 00 00 lea 0xadc(%r14),%rdi
15: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
1c: fc ff df
1f: 48 89 fa mov %rdi,%rdx
22: 48 c1 ea 03 shr $0x3,%rdx
26: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx
* 2a: 48 89 f8 mov %rdi,%rax <-- trapping instruction
2d: 83 e0 07 and $0x7,%eax
30: 83 c0 03 add $0x3,%eax
33: 38 d0 cmp %dl,%al
35: 7c 08 jl 0x3f
37: 84 d2 test %dl,%dl
39: 0f 85 59 05 00 00 jne 0x598
3f: 41 rex.B