==================================================================
BUG: KASAN: use-after-free in dev_map_generic_redirect+0xa0/0x6f0 kernel/bpf/devmap.c:667
Read of size 8 at addr ffff88810c4ed880 by task rcub/0/15
CPU: 0 PID: 15 Comm: rcub/0 Not tainted 5.15.178-syzkaller-00193-g058abb720bd1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106
print_address_description+0x87/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0x179/0x1c0 mm/kasan/report.c:444
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
dev_map_generic_redirect+0xa0/0x6f0 kernel/bpf/devmap.c:667
xdp_do_generic_redirect_map net/core/filter.c:4177 [inline]
xdp_do_generic_redirect+0x42e/0xb40 net/core/filter.c:4236
do_xdp_generic+0x50b/0x7c0 net/core/dev.c:4919
__netif_receive_skb_core+0x1706/0x3640 net/core/dev.c:5324
__netif_receive_skb_one_core net/core/dev.c:5499 [inline]
__netif_receive_skb+0x11c/0x530 net/core/dev.c:5615
process_backlog+0x31c/0x650 net/core/dev.c:6492
__napi_poll+0xc4/0x5a0 net/core/dev.c:7051
napi_poll net/core/dev.c:7118 [inline]
net_rx_action+0x47d/0xc50 net/core/dev.c:7208
handle_softirqs+0x25e/0x5c0 kernel/softirq.c:565
__do_softirq kernel/softirq.c:603 [inline]
invoke_softirq kernel/softirq.c:425 [inline]
__irq_exit_rcu+0x52/0xf0 kernel/softirq.c:652
irq_exit_rcu+0x9/0x10 kernel/softirq.c:664
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
sysvec_apic_timer_interrupt+0xa9/0xc0 arch/x86/kernel/apic/apic.c:1108
asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:676
RIP: 0010:constant_test_bit arch/x86/include/asm/bitops.h:207 [inline]
RIP: 0010:test_bit include/asm-generic/bitops/instrumented-non-atomic.h:135 [inline]
RIP: 0010:test_ti_thread_flag include/linux/thread_info.h:118 [inline]
RIP: 0010:need_resched include/linux/sched.h:2155 [inline]
RIP: 0010:rtmutex_spin_on_owner kernel/locking/rtmutex.c:1426 [inline]
RIP: 0010:rt_mutex_slowlock_block+0x2f7/0x5a0 kernel/locking/rtmutex.c:1560
Code: 84 c0 0f 85 e5 00 00 00 83 3b 00 0f 84 16 01 00 00 4c 89 ef be 08 00 00 00 e8 25 59 cb fc 4c 89 e8 48 c1 e8 03 42 80 3c 20 00 <74> 08 4c 89 ef e8 2f 57 cb fc 49 f7 45 00 08 00 00 00 0f 85 e5 00
RSP: 0018:ffffc900000f7bf0 EFLAGS: 00000246
RAX: 1ffff1102004d4f0 RBX: ffff88810d8262f4 RCX: ffffffff84e77aab
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88810026a780
RBP: ffffc900000f7c90 R08: dffffc0000000000 R09: ffffed102004d4f1
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88810026a780 R14: ffffffff86bab538 R15: ffffc900000f7ce0
__rt_mutex_slowlock kernel/locking/rtmutex.c:1629 [inline]
__rt_mutex_slowlock_locked kernel/locking/rtmutex.c:1662 [inline]
rt_mutex_slowlock+0x184/0x300 kernel/locking/rtmutex.c:1691
__rt_mutex_lock kernel/locking/rtmutex.c:1703 [inline]
__rt_mutex_lock_common kernel/locking/rtmutex_api.c:30 [inline]
rt_mutex_lock+0x14a/0x210 kernel/locking/rtmutex_api.c:66
rcu_boost kernel/rcu/tree_plugin.h:1060 [inline]
rcu_boost_kthread+0x231/0x6e0 kernel/rcu/tree_plugin.h:1085
kthread+0x421/0x510 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Allocated by task 6:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:433 [inline]
____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512
__kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521
kasan_kmalloc include/linux/kasan.h:227 [inline]
kmem_cache_alloc_trace+0x11a/0x270 mm/slub.c:3269
kmalloc include/linux/slab.h:603 [inline]
dst_cow_metrics_generic+0x55/0x1c0 net/core/dst.c:206
dst_metrics_write_ptr include/net/dst.h:118 [inline]
dst_metric_set include/net/dst.h:179 [inline]
icmp6_dst_alloc+0x385/0x560 net/ipv6/route.c:3288
ndisc_send_skb+0x27f/0xc90 net/ipv6/ndisc.c:491
ndisc_send_rs+0x532/0x6a0 net/ipv6/ndisc.c:705
addrconf_dad_completed+0x8bf/0xd80 net/ipv6/addrconf.c:4298
addrconf_dad_work+0xdc1/0x1710
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472
kthread+0x421/0x510 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Freed by task 312:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:45
kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365
__kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
kasan_slab_free include/linux/kasan.h:193 [inline]
slab_free_hook mm/slub.c:1723 [inline]
slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749
slab_free mm/slub.c:3521 [inline]
kfree+0xcc/0x270 mm/slub.c:4583
ip_dst_metrics_put include/net/ip.h:528 [inline]
ip6_dst_destroy+0x8d/0x450 net/ipv6/route.c:360
dst_destroy+0xbe/0x280 net/core/dst.c:116
dst_destroy_rcu+0x19/0x20 net/core/dst.c:137
rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2523
rcu_core+0x517/0x1020 kernel/rcu/tree.c:2763
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776
handle_softirqs+0x25e/0x5c0 kernel/softirq.c:565
__do_softirq kernel/softirq.c:603 [inline]
invoke_softirq kernel/softirq.c:425 [inline]
__irq_exit_rcu+0x52/0xf0 kernel/softirq.c:652
irq_exit_rcu+0x9/0x10 kernel/softirq.c:664
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
sysvec_apic_timer_interrupt+0xa9/0xc0 arch/x86/kernel/apic/apic.c:1108
asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:676
The buggy address belongs to the object at ffff88810c4ed880
which belongs to the cache kmalloc-96 of size 96
The buggy address is located 0 bytes inside of
96-byte region [ffff88810c4ed880, ffff88810c4ed8e0)
The buggy address belongs to the page:
page:ffffea0004313b40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10c4ed
flags: 0x4000000000000200(slab|zone=1)
raw: 4000000000000200 ffffea0004402140 0000000400000004 ffff888100042900
raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 5644165951, free_ts 0
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605
prep_new_page+0x1b/0x110 mm/page_alloc.c:2611
get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485
__alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5780
allocate_slab mm/slub.c:1932 [inline]
new_slab+0x9a/0x4e0 mm/slub.c:1995
___slab_alloc+0x39e/0x830 mm/slub.c:3028
__slab_alloc+0x4a/0x90 mm/slub.c:3115
slab_alloc_node mm/slub.c:3206 [inline]
slab_alloc mm/slub.c:3250 [inline]
kmem_cache_alloc_trace+0x147/0x270 mm/slub.c:3267
kmalloc include/linux/slab.h:603 [inline]
kzalloc include/linux/slab.h:733 [inline]
class_read+0x5c/0xf20 security/selinux/ss/policydb.c:1303
policydb_read+0xb7f/0x2cc0 security/selinux/ss/policydb.c:2550
security_load_policy+0x1b3/0x13e0 security/selinux/ss/services.c:2312
sel_write_load+0x2dd/0x5a0 security/selinux/selinuxfs.c:647
vfs_write+0x406/0x1110 fs/read_write.c:592
ksys_write+0x199/0x2c0 fs/read_write.c:647
__do_sys_write fs/read_write.c:659 [inline]
__se_sys_write fs/read_write.c:656 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:656
x64_sys_call+0x2f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
page_owner free stack trace missing
Memory state around the buggy address:
ffff88810c4ed780: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff88810c4ed800: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
>ffff88810c4ed880: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
^
ffff88810c4ed900: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff88810c4ed980: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: 84 c0 test %al,%al
2: 0f 85 e5 00 00 00 jne 0xed
8: 83 3b 00 cmpl $0x0,(%rbx)
b: 0f 84 16 01 00 00 je 0x127
11: 4c 89 ef mov %r13,%rdi
14: be 08 00 00 00 mov $0x8,%esi
19: e8 25 59 cb fc call 0xfccb5943
1e: 4c 89 e8 mov %r13,%rax
21: 48 c1 e8 03 shr $0x3,%rax
25: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1)
* 2a: 74 08 je 0x34 <-- trapping instruction
2c: 4c 89 ef mov %r13,%rdi
2f: e8 2f 57 cb fc call 0xfccb5763
34: 49 f7 45 00 08 00 00 testq $0x8,0x0(%r13)
3b: 00
3c: 0f .byte 0xf
3d: 85 e5 test %esp,%ebp