================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6 net/xfrm/xfrm_policy.c:3410 [inline] BUG: KASAN: slab-out-of-bounds in __xfrm_decode_session+0x1520/0x1d20 net/xfrm/xfrm_policy.c:3517 Read of size 1 at addr ffff0000d0bdb557 by task syz.1.1299/7277 CPU: 0 PID: 7277 Comm: syz.1.1299 Not tainted 5.15.179-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x174/0x1e4 mm/kasan/report.c:451 __asan_report_load1_noabort+0x44/0x50 mm/kasan/report_generic.c:306 decode_session6 net/xfrm/xfrm_policy.c:3410 [inline] __xfrm_decode_session+0x1520/0x1d20 net/xfrm/xfrm_policy.c:3517 xfrm_decode_session_reverse include/net/xfrm.h:1177 [inline] icmpv6_route_lookup+0x398/0x558 net/ipv6/icmp.c:394 icmp6_send+0xe18/0x1b1c net/ipv6/icmp.c:601 __icmpv6_send include/linux/icmpv6.h:28 [inline] icmpv6_send include/linux/icmpv6.h:49 [inline] ip6_link_failure+0x44/0x4a8 net/ipv6/route.c:2788 dst_link_failure include/net/dst.h:422 [inline] ip6_tnl_xmit+0x1014/0x22a8 net/ipv6/ip6_tunnel.c:1275 ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1391 [inline] ip6_tnl_start_xmit+0xd60/0x13d8 net/ipv6/ip6_tunnel.c:1440 __netdev_start_xmit include/linux/netdevice.h:5027 [inline] netdev_start_xmit include/linux/netdevice.h:5041 [inline] xmit_one net/core/dev.c:3648 [inline] dev_hard_start_xmit+0x2bc/0x92c net/core/dev.c:3664 sch_direct_xmit+0x2e0/0x484 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x878/0x1fc0 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3941 [inline] __dev_queue_xmit+0x1038/0x2ac8 net/core/dev.c:4252 dev_queue_xmit+0x24/0x34 net/core/dev.c:4320 neigh_connected_output+0x334/0x378 net/core/neighbour.c:1533 neigh_output include/net/neighbour.h:509 [inline] ip6_finish_output2+0x1360/0x1cec net/ipv6/ip6_output.c:130 __ip6_finish_output+0x580/0x6ec net/ipv6/ip6_output.c:201 ip6_finish_output+0x40/0x218 net/ipv6/ip6_output.c:211 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x274/0x594 net/ipv6/ip6_output.c:234 dst_output include/net/dst.h:452 [inline] ip6_local_out+0x120/0x160 net/ipv6/output_core.c:161 ip6_send_skb+0x1a8/0x584 net/ipv6/ip6_output.c:1951 udp_v6_send_skb+0x8ac/0x1474 net/ipv6/udp.c:1285 udpv6_sendmsg+0x1a00/0x2850 net/ipv6/udp.c:1586 inet6_sendmsg+0xb4/0xd8 net/ipv6/af_inet6.c:667 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] ____sys_sendmsg+0x584/0x870 net/socket.c:2436 ___sys_sendmsg+0x214/0x294 net/socket.c:2490 __sys_sendmmsg+0x23c/0x648 net/socket.c:2576 __do_sys_sendmmsg net/socket.c:2605 [inline] __se_sys_sendmmsg net/socket.c:2602 [inline] __arm64_sys_sendmmsg+0xa0/0xbc net/socket.c:2602 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Allocated by task 1: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x27c/0x47c mm/slub.c:3247 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] cec_allocate_adapter+0xa8/0x4e4 drivers/media/cec/core/cec-core.c:254 vivid_cec_alloc_adap+0xec/0x150 drivers/media/test-drivers/vivid/vivid-cec.c:284 vivid_create_instance drivers/media/test-drivers/vivid/vivid-core.c:1950 [inline] vivid_probe+0x40fc/0x6b50 drivers/media/test-drivers/vivid/vivid-core.c:2031 platform_probe+0x148/0x1c0 drivers/base/platform.c:1391 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26c/0xaec drivers/base/dd.c:595 __driver_probe_device+0x194/0x3b4 drivers/base/dd.c:755 driver_probe_device+0x78/0x34c drivers/base/dd.c:785 __driver_attach+0x3ec/0x5ec drivers/base/dd.c:1164 bus_for_each_dev+0x14c/0x1cc drivers/base/bus.c:303 driver_attach+0x4c/0x5c drivers/base/dd.c:1181 bus_add_driver+0x2ec/0x570 drivers/base/bus.c:620 driver_register+0x200/0x374 drivers/base/driver.c:240 __platform_driver_register+0x74/0x8c drivers/base/platform.c:858 vivid_init+0x4c/0x8c drivers/media/test-drivers/vivid/vivid-core.c:2161 do_one_initcall+0x234/0x990 init/main.c:1302 do_initcall_level+0x154/0x214 init/main.c:1375 do_initcalls+0x58/0xac init/main.c:1391 do_basic_setup+0x8c/0xa0 init/main.c:1410 kernel_init_freeable+0x460/0x640 init/main.c:1615 kernel_init+0x24/0x294 init/main.c:1506 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 The buggy address belongs to the object at ffff0000d0bda000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1367 bytes to the right of 4096-byte region [ffff0000d0bda000, ffff0000d0bdb000) The buggy address belongs to the page: page:00000000afad9f46 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x110bd8 head:00000000afad9f46 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0002a80 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d0bdb400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d0bdb480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000d0bdb500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff0000d0bdb580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d0bdb600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================