==================================================================
BUG: KASAN: slab-out-of-bounds in decode_session6+0xfc3/0x17f0 net/xfrm/xfrm_policy.c:3376
Read of size 1 at addr ffff88801d3ee2e8 by task syz-executor.4/3647
CPU: 1 PID: 3647 Comm: syz-executor.4 Not tainted 6.0.0-rc7-syzkaller-00081-gc3e0e1e23c70 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:317 [inline]
print_report.cold+0x2ba/0x719 mm/kasan/report.c:433
kasan_report+0xb1/0x1e0 mm/kasan/report.c:495
decode_session6+0xfc3/0x17f0 net/xfrm/xfrm_policy.c:3376
__xfrm_decode_session+0x50/0xb0 net/xfrm/xfrm_policy.c:3482
xfrm_decode_session include/net/xfrm.h:1160 [inline]
vti6_tnl_xmit+0x419/0x1f90 net/ipv6/ip6_vti.c:577
__netdev_start_xmit include/linux/netdevice.h:4819 [inline]
netdev_start_xmit include/linux/netdevice.h:4833 [inline]
xmit_one net/core/dev.c:3590 [inline]
dev_hard_start_xmit+0x183/0x880 net/core/dev.c:3606
sch_direct_xmit+0x19f/0xbe0 net/sched/sch_generic.c:342
qdisc_restart net/sched/sch_generic.c:407 [inline]
__qdisc_run+0x4bb/0x1710 net/sched/sch_generic.c:415
__dev_xmit_skb net/core/dev.c:3880 [inline]
__dev_queue_xmit+0x2299/0x3ad0 net/core/dev.c:4222
dev_queue_xmit include/linux/netdevice.h:3008 [inline]
neigh_connected_output+0x3c0/0x520 net/core/neighbour.c:1581
neigh_output include/net/neighbour.h:551 [inline]
ip6_finish_output2+0x564/0x1520 net/ipv6/ip6_output.c:134
__ip6_finish_output net/ipv6/ip6_output.c:195 [inline]
ip6_finish_output+0x690/0x1160 net/ipv6/ip6_output.c:206
NF_HOOK_COND include/linux/netfilter.h:296 [inline]
ip6_output+0x1ed/0x540 net/ipv6/ip6_output.c:227
dst_output include/net/dst.h:451 [inline]
NF_HOOK include/linux/netfilter.h:307 [inline]
ndisc_send_skb+0xa5f/0x1730 net/ipv6/ndisc.c:508
ndisc_send_rs+0x12e/0x6f0 net/ipv6/ndisc.c:718
addrconf_rs_timer+0x3ed/0x820 net/ipv6/addrconf.c:3931
call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers.part.0+0x674/0xa80 kernel/time/timer.c:1790
__run_timers kernel/time/timer.c:1768 [inline]
run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803
__do_softirq+0x1d3/0x9c6 kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x123/0x180 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1106
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:lock_acquire+0x1ef/0x570 kernel/locking/lockdep.c:5634
Code: fb a2 7e 83 f8 01 0f 85 e8 02 00 00 9c 58 f6 c4 02 0f 85 fb 02 00 00 48 83 7c 24 08 00 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c3 48 c7 03 00 00 00 00 48 c7 43 08 00 00 00 00 48 8b 84 24
RSP: 0018:ffffc9000417fc08 EFLAGS: 00000206
RAX: dffffc0000000000 RBX: 1ffff9200082ff83 RCX: ffffffff815f289e
RDX: 1ffff11004d0d14e RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff908e5967
R10: fffffbfff211cb2c R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: ffff8880305f3d60 R15: 0000000000000000
__raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:349 [inline]
_atomic_dec_and_lock+0xa9/0x100 lib/dec_and_lock.c:28
iput.part.0+0x67/0x810 fs/inode.c:1766
iput+0x58/0x70 fs/inode.c:1764
dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:401
__dentry_kill+0x3c0/0x640 fs/dcache.c:607
dentry_kill fs/dcache.c:733 [inline]
dput+0x806/0xdb0 fs/dcache.c:913
__fput+0x39c/0x9d0 fs/file_table.c:333
task_work_run+0xdd/0x1a0 kernel/task_work.c:177
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop kernel/entry/common.c:169 [inline]
exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:201
__syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294
do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f399bc3c37b
Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44
RSP: 002b:00007ffca899ae00 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 00007ffca899aea0 RCX: 00007f399bc3c37b
RDX: 0000000000000000 RSI: 000000c30cc1b298 RDI: 0000000000000003
RBP: 0000000000000003 R08: 0000000000000000 R09: ffffffffffff0000
R10: 0000000000000010 R11: 0000000000000293 R12: 0000000000000032
R13: 00000000000296fd R14: 0000000000000006 R15: 00007ffca899aee0
Allocated by task 3185:
kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:45 [inline]
set_alloc_info mm/kasan/common.c:437 [inline]
____kasan_kmalloc mm/kasan/common.c:516 [inline]
____kasan_kmalloc mm/kasan/common.c:475 [inline]
__kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:733 [inline]
fib6_info_alloc+0xc1/0x210 net/ipv6/ip6_fib.c:156
ip6_route_info_create+0x33e/0x1aa0 net/ipv6/route.c:3749
ip6_route_add+0x24/0x150 net/ipv6/route.c:3843
addrconf_add_mroute+0x1e1/0x310 net/ipv6/addrconf.c:2489
addrconf_add_dev+0x156/0x1c0 net/ipv6/addrconf.c:2507
inet6_addr_add+0x19f/0xae0 net/ipv6/addrconf.c:2937
inet6_rtm_newaddr+0xfa4/0x1a60 net/ipv6/addrconf.c:4927
rtnetlink_rcv_msg+0x43a/0xca0 net/core/rtnetlink.c:6090
netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501
netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345
netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:734
____sys_sendmsg+0x6eb/0x810 net/socket.c:2482
___sys_sendmsg+0x110/0x1b0 net/socket.c:2536
__sys_sendmsg+0xf3/0x1c0 net/socket.c:2565
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
The buggy address belongs to the object at ffff88801d3ee000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 232 bytes to the right of
512-byte region [ffff88801d3ee000, ffff88801d3ee200)
The buggy address belongs to the physical page:
page:ffffea000074fb00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d3ec
head:ffffea000074fb00 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888011841c80
raw: 0000000000000000 0000000080100010 00000001ffffffff 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 5982320707, free_ts 0
prep_new_page mm/page_alloc.c:2532 [inline]
get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283
__alloc_pages+0x1c7/0x510 mm/page_alloc.c:5549
alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2103
alloc_pages+0x22f/0x270 mm/mempolicy.c:2265
alloc_slab_page mm/slub.c:1829 [inline]
allocate_slab+0x27e/0x3d0 mm/slub.c:1974
new_slab mm/slub.c:2034 [inline]
___slab_alloc+0x7f1/0xe10 mm/slub.c:3036
__slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3123
slab_alloc_node mm/slub.c:3214 [inline]
slab_alloc mm/slub.c:3256 [inline]
kmem_cache_alloc_trace+0x323/0x3e0 mm/slub.c:3287
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:733 [inline]
device_private_init drivers/base/core.c:3361 [inline]
device_add+0x1168/0x1e90 drivers/base/core.c:3411
drm_minor_register+0x100/0x250 drivers/gpu/drm/drm_drv.c:170
drm_dev_register+0xc4/0x530 drivers/gpu/drm/drm_drv.c:878
vgem_init+0x1ba/0x239 drivers/gpu/drm/vgem/vgem_drv.c:155
do_one_initcall+0xfe/0x650 init/main.c:1296
do_initcall_level init/main.c:1369 [inline]
do_initcalls init/main.c:1385 [inline]
do_basic_setup init/main.c:1404 [inline]
kernel_init_freeable+0x6b1/0x73a init/main.c:1623
kernel_init+0x1a/0x1d0 init/main.c:1512
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
page_owner free stack trace missing
Memory state around the buggy address:
ffff88801d3ee180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88801d3ee200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88801d3ee280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88801d3ee300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88801d3ee380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: fb sti
1: a2 7e 83 f8 01 0f 85 movabs %al,0x2e8850f01f8837e
8: e8 02
a: 00 00 add %al,(%rax)
c: 9c pushfq
d: 58 pop %rax
e: f6 c4 02 test $0x2,%ah
11: 0f 85 fb 02 00 00 jne 0x312
17: 48 83 7c 24 08 00 cmpq $0x0,0x8(%rsp)
1d: 74 01 je 0x20
1f: fb sti
20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
27: fc ff df
* 2a: 48 01 c3 add %rax,%rbx <-- trapping instruction
2d: 48 c7 03 00 00 00 00 movq $0x0,(%rbx)
34: 48 c7 43 08 00 00 00 movq $0x0,0x8(%rbx)
3b: 00
3c: 48 rex.W
3d: 8b .byte 0x8b
3e: 84 .byte 0x84
3f: 24 .byte 0x24