==================================================================
BUG: KASAN: slab-use-after-free in rht_key_hashfn include/linux/rhashtable.h:159 [inline]
BUG: KASAN: slab-use-after-free in __rhashtable_lookup include/linux/rhashtable.h:604 [inline]
BUG: KASAN: slab-use-after-free in rhashtable_lookup include/linux/rhashtable.h:646 [inline]
BUG: KASAN: slab-use-after-free in rhashtable_lookup_fast+0x77a/0x9b0 include/linux/rhashtable.h:672
Read of size 4 at addr ffff8880641a8008 by task syz.2.804/9712
CPU: 1 PID: 9712 Comm: syz.2.804 Not tainted 6.10.0-syzkaller-09737-g36e3b949e359 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0x169/0x550 mm/kasan/report.c:488
kasan_report+0x143/0x180 mm/kasan/report.c:601
rht_key_hashfn include/linux/rhashtable.h:159 [inline]
__rhashtable_lookup include/linux/rhashtable.h:604 [inline]
rhashtable_lookup include/linux/rhashtable.h:646 [inline]
rhashtable_lookup_fast+0x77a/0x9b0 include/linux/rhashtable.h:672
ila_lookup_wildcards net/ipv6/ila/ila_xlat.c:132 [inline]
ila_xlat_addr net/ipv6/ila/ila_xlat.c:652 [inline]
ila_nf_input+0x1fe/0x3c0 net/ipv6/ila/ila_xlat.c:190
nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline]
nf_hook_slow+0xc3/0x220 net/netfilter/core.c:626
nf_hook include/linux/netfilter.h:269 [inline]
NF_HOOK+0x29e/0x450 include/linux/netfilter.h:312
__netif_receive_skb_one_core net/core/dev.c:5660 [inline]
__netif_receive_skb+0x1ea/0x650 net/core/dev.c:5774
process_backlog+0x662/0x15b0 net/core/dev.c:6107
__napi_poll+0xcb/0x490 net/core/dev.c:6771
napi_poll net/core/dev.c:6840 [inline]
net_rx_action+0x89b/0x1240 net/core/dev.c:6962
handle_softirqs+0x2c4/0x970 kernel/softirq.c:554
__do_softirq kernel/softirq.c:588 [inline]
invoke_softirq kernel/softirq.c:428 [inline]
__irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637
irq_exit_rcu+0x9/0x30 kernel/softirq.c:649
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:preempt_schedule_irq+0xf6/0x1c0 kernel/sched/core.c:6851
Code: 89 f5 49 c1 ed 03 eb 0d 48 f7 03 08 00 00 00 0f 84 8b 00 00 00 bf 01 00 00 00 e8 25 ac a6 f5 e8 f0 aa de f5 fb bf 01 00 00 00 55 ad ff ff 43 80 7c 3d 00 00 74 08 4c 89 f7 e8 a5 83 3d f6 48
RSP: 0018:ffffc900045873e0 EFLAGS: 00000282
RAX: e09a0b032e3ec700 RBX: 1ffff920008b0e84 RCX: ffffffff816fef2a
RDX: dffffc0000000000 RSI: ffffffff8beac920 RDI: 0000000000000001
RBP: ffffc90004587490 R08: ffffffff935106af R09: 1ffffffff26a20d5
R10: dffffc0000000000 R11: fffffbfff26a20d6 R12: 1ffff920008b0e7c
R13: 1ffff920008b0e80 R14: ffffc90004587400 R15: dffffc0000000000
irqentry_exit+0x5e/0x90 kernel/entry/common.c:354
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:zone_to_nid include/linux/mmzone.h:1509 [inline]
RIP: 0010:zonelist_node_idx include/linux/mmzone.h:1617 [inline]
RIP: 0010:zref_in_nodemask mm/mmzone.c:49 [inline]
RIP: 0010:__next_zones_zonelist+0x85/0x130 mm/mmzone.c:69
Code: 3c 28 00 74 08 48 89 df e8 78 34 21 00 49 8b 2c 24 48 85 ed 0f 84 a3 00 00 00 48 83 c5 58 48 89 e8 48 c1 e8 03 42 0f b6 04 28 <84> c0 75 34 48 63 6d 00 48 89 e8 48 c1 e8 06 49 8d 3c c7 be 08 00
RSP: 0018:ffffc90004587550 EFLAGS: 00000a06
RAX: 0000000000000000 RBX: ffff88813fffc440 RCX: ffffc9000458767c
RDX: ffff88805cc8cf00 RSI: 0000000000000003 RDI: ffff88813fffc448
RBP: ffff88813fffaed8 R08: ffffffff81fa0ed9 R09: 1ffffffff1fee6e5
R10: dffffc0000000000 R11: fffffbfff1fee6e6 R12: ffff88813fffc440
R13: dffffc0000000000 R14: 0000000000000003 R15: ffff88805cc8cf00
next_zones_zonelist include/linux/mmzone.h:1645 [inline]
first_zones_zonelist include/linux/mmzone.h:1669 [inline]
prepare_alloc_pages+0x369/0x5d0 mm/page_alloc.c:4469
__alloc_pages_noprof+0x166/0x6c0 mm/page_alloc.c:4672
alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
shmem_alloc_folio mm/shmem.c:1639 [inline]
shmem_alloc_and_add_folio+0x24d/0xdb0 mm/shmem.c:1679
shmem_get_folio_gfp+0x82d/0x1f50 mm/shmem.c:2066
shmem_get_folio mm/shmem.c:2171 [inline]
shmem_write_begin+0x170/0x4d0 mm/shmem.c:2754
generic_perform_write+0x399/0x840 mm/filemap.c:4019
shmem_file_write_iter+0xfc/0x120 mm/shmem.c:2930
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0xa72/0xc90 fs/read_write.c:590
ksys_write+0x1a0/0x2c0 fs/read_write.c:643
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8627177299
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f8627f54048 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f8627305f80 RCX: 00007f8627177299
RDX: 0000000000000012 RSI: 0000000020000000 RDI: 0000000000000006
RBP: 00007f86271e48e6 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f8627305f80 R15: 00007ffd29e6e4d8
Allocated by task 5288:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slub.c:4149 [inline]
__kmalloc_node_track_caller_noprof+0x225/0x440 mm/slub.c:4168
kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:605
__alloc_skb+0x1f3/0x440 net/core/skbuff.c:674
alloc_skb include/linux/skbuff.h:1320 [inline]
nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline]
nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline]
nsim_dev_trap_report_work+0x254/0xaa0 drivers/net/netdevsim/dev.c:850
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
worker_thread+0x86d/0xd40 kernel/workqueue.c:3390
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Freed by task 5288:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579
poison_slab_object+0xe0/0x150 mm/kasan/common.c:240
__kasan_slab_free+0x37/0x60 mm/kasan/common.c:256
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2235 [inline]
slab_free mm/slub.c:4464 [inline]
kfree+0x149/0x360 mm/slub.c:4585
skb_kfree_head net/core/skbuff.c:1084 [inline]
skb_free_head net/core/skbuff.c:1096 [inline]
skb_release_data+0x676/0x880 net/core/skbuff.c:1123
skb_release_all net/core/skbuff.c:1188 [inline]
__kfree_skb net/core/skbuff.c:1202 [inline]
consume_skb+0xb1/0x160 net/core/skbuff.c:1426
nsim_dev_trap_report drivers/net/netdevsim/dev.c:821 [inline]
nsim_dev_trap_report_work+0x765/0xaa0 drivers/net/netdevsim/dev.c:850
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
worker_thread+0x86d/0xd40 kernel/workqueue.c:3390
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
The buggy address belongs to the object at ffff8880641a8000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 8 bytes inside of
freed 4096-byte region [ffff8880641a8000, ffff8880641a9000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x641a8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffefff(slab)
raw: 00fff00000000040 ffff888015442140 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000040004 00000001ffffefff 0000000000000000
head: 00fff00000000040 ffff888015442140 dead000000000122 0000000000000000
head: 0000000000000000 0000000000040004 00000001ffffefff 0000000000000000
head: 00fff00000000003 ffffea0001906a01 ffffffffffffffff 0000000000000000
head: 0000000000000008 0000000000000000 00000000ffffffff 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 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5288, tgid 5288 (kworker/0:6), ts 312076111309, free_ts 312004772674
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1473
prep_new_page mm/page_alloc.c:1481 [inline]
get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3425
__alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4683
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
alloc_slab_page+0x5f/0x120 mm/slub.c:2304
allocate_slab+0x5a/0x2f0 mm/slub.c:2467
new_slab mm/slub.c:2520 [inline]
___slab_alloc+0xcd1/0x14b0 mm/slub.c:3706
__slab_alloc+0x58/0xa0 mm/slub.c:3796
__slab_alloc_node mm/slub.c:3849 [inline]
slab_alloc_node mm/slub.c:4016 [inline]
__do_kmalloc_node mm/slub.c:4148 [inline]
__kmalloc_node_track_caller_noprof+0x281/0x440 mm/slub.c:4168
kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:605
__alloc_skb+0x1f3/0x440 net/core/skbuff.c:674
alloc_skb include/linux/skbuff.h:1320 [inline]
nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline]
nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline]
nsim_dev_trap_report_work+0x254/0xaa0 drivers/net/netdevsim/dev.c:850
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
worker_thread+0x86d/0xd40 kernel/workqueue.c:3390
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
page last free pid 9006 tgid 9006 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1093 [inline]
free_unref_page+0xd22/0xea0 mm/page_alloc.c:2588
__folio_put+0x3b9/0x620 mm/swap.c:129
folio_put include/linux/mm.h:1513 [inline]
free_large_kmalloc+0x105/0x1c0 mm/slub.c:4556
kfree+0x1c4/0x360 mm/slub.c:4579
rhashtable_free_and_destroy+0x7c6/0x920 lib/rhashtable.c:1169
ila_xlat_exit_net+0x55/0x110 net/ipv6/ila/ila_xlat.c:626
ops_exit_list net/core/net_namespace.c:173 [inline]
cleanup_net+0x802/0xcc0 net/core/net_namespace.c:640
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312
worker_thread+0x86d/0xd40 kernel/workqueue.c:3390
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Memory state around the buggy address:
ffff8880641a7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880641a7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880641a8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880641a8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880641a8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 89 f5 mov %esi,%ebp
2: 49 c1 ed 03 shr $0x3,%r13
6: eb 0d jmp 0x15
8: 48 f7 03 08 00 00 00 testq $0x8,(%rbx)
f: 0f 84 8b 00 00 00 je 0xa0
15: bf 01 00 00 00 mov $0x1,%edi
1a: e8 25 ac a6 f5 call 0xf5a6ac44
1f: e8 f0 aa de f5 call 0xf5deab14
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 55 ad ff ff call 0xffffad84 <-- trapping instruction
2f: 43 80 7c 3d 00 00 cmpb $0x0,0x0(%r13,%r15,1)
35: 74 08 je 0x3f
37: 4c 89 f7 mov %r14,%rdi
3a: e8 a5 83 3d f6 call 0xf63d83e4
3f: 48 rex.W