================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6 net/xfrm/xfrm_policy.c:3394 [inline] BUG: KASAN: slab-out-of-bounds in __xfrm_decode_session+0x1cfb/0x2e90 net/xfrm/xfrm_policy.c:3486 Read of size 1 at addr ffff88805e4b9ca6 by task syz-executor.4/1565 CPU: 0 PID: 1565 Comm: syz-executor.4 Not tainted 5.7.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x188/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:382 __kasan_report.cold+0x35/0x4d mm/kasan/report.c:511 kasan_report+0x33/0x50 mm/kasan/common.c:625 decode_session6 net/xfrm/xfrm_policy.c:3394 [inline] __xfrm_decode_session+0x1cfb/0x2e90 net/xfrm/xfrm_policy.c:3486 xfrm_decode_session_reverse include/net/xfrm.h:1145 [inline] icmpv6_route_lookup+0x2fe/0x470 net/ipv6/icmp.c:388 icmp6_send+0x1263/0x23b0 net/ipv6/icmp.c:588 icmpv6_send+0xde/0x210 net/ipv6/ip6_icmp.c:43 ip6_link_failure+0x26/0x520 net/ipv6/route.c:2665 dst_link_failure include/net/dst.h:418 [inline] ip6_tnl_xmit+0x460/0x3470 net/ipv6/ip6_tunnel.c:1248 ip6ip6_tnl_xmit net/ipv6/ip6_tunnel.c:1402 [inline] ip6_tnl_start_xmit+0x89a/0x1dc0 net/ipv6/ip6_tunnel.c:1428 __netdev_start_xmit include/linux/netdevice.h:4587 [inline] netdev_start_xmit include/linux/netdevice.h:4601 [inline] xmit_one net/core/dev.c:3545 [inline] dev_hard_start_xmit+0x1a4/0x9b0 net/core/dev.c:3561 sch_direct_xmit+0x345/0xc20 net/sched/sch_generic.c:313 qdisc_restart net/sched/sch_generic.c:376 [inline] __qdisc_run+0x4d1/0x17b0 net/sched/sch_generic.c:384 __dev_xmit_skb net/core/dev.c:3784 [inline] __dev_queue_xmit+0x165b/0x30a0 net/core/dev.c:4089 neigh_output include/net/neighbour.h:510 [inline] ip6_finish_output2+0x1091/0x25b0 net/ipv6/ip6_output.c:117 __ip6_finish_output+0x442/0xab0 net/ipv6/ip6_output.c:143 ip6_finish_output+0x34/0x1f0 net/ipv6/ip6_output.c:153 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x239/0x810 net/ipv6/ip6_output.c:176 dst_output include/net/dst.h:435 [inline] ip6_local_out+0xaf/0x1a0 net/ipv6/output_core.c:179 ip6_send_skb+0xb4/0x340 net/ipv6/ip6_output.c:1865 ip6_push_pending_frames+0xbd/0xe0 net/ipv6/ip6_output.c:1885 rawv6_push_pending_frames net/ipv6/raw.c:613 [inline] rawv6_sendmsg+0x2b3d/0x3900 net/ipv6/raw.c:956 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:807 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 __sys_sendto+0x220/0x330 net/socket.c:2000 __do_sys_sendto net/socket.c:2012 [inline] __se_sys_sendto net/socket.c:2008 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2008 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x45c829 Code: 0d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9e0f8d9c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000500fa0 RCX: 000000000045c829 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000004 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000a0f R14: 00000000004ccc62 R15: 00007f9e0f8da6d4 Allocated by task 431: save_stack+0x1b/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc mm/kasan/common.c:495 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:468 __kmalloc_reserve.isra.0+0x39/0xe0 net/core/skbuff.c:142 __alloc_skb+0xef/0x5a0 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1083 [inline] __tcp_send_ack.part.0+0x67/0x5a0 net/ipv4/tcp_output.c:3764 __tcp_send_ack net/ipv4/tcp_output.c:3791 [inline] tcp_send_ack+0x7d/0xa0 net/ipv4/tcp_output.c:3791 tcp_rcv_synsent_state_process net/ipv4/tcp_input.c:6039 [inline] tcp_rcv_state_process+0x3b32/0x5247 net/ipv4/tcp_input.c:6208 tcp_v6_do_rcv+0x7d2/0x1290 net/ipv6/tcp_ipv6.c:1463 sk_backlog_rcv include/net/sock.h:996 [inline] __release_sock+0x134/0x3a0 net/core/sock.c:2467 release_sock+0x54/0x1b0 net/core/sock.c:2983 inet_stream_connect+0x76/0xa0 net/ipv4/af_inet.c:720 rds_tcp_conn_path_connect+0x620/0x880 net/rds/tcp_connect.c:172 rds_connect_worker+0x1a5/0x2c0 net/rds/threads.c:176 process_one_work+0x965/0x16a0 kernel/workqueue.c:2268 worker_thread+0x96/0xe20 kernel/workqueue.c:2414 kthread+0x388/0x470 kernel/kthread.c:268 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Freed by task 431: save_stack+0x1b/0x40 mm/kasan/common.c:49 set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:317 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:456 __cache_free mm/slab.c:3426 [inline] kfree+0x109/0x2b0 mm/slab.c:3757 skb_free_head+0x8b/0xa0 net/core/skbuff.c:590 skb_release_data+0x42e/0x8b0 net/core/skbuff.c:610 skb_release_all+0x46/0x60 net/core/skbuff.c:664 __kfree_skb+0x11/0x20 net/core/skbuff.c:678 tcp_data_queue+0x2061/0x4760 net/ipv4/tcp_input.c:4788 tcp_rcv_state_process+0xd64/0x5247 net/ipv4/tcp_input.c:6391 tcp_child_process+0x3d8/0xb30 net/ipv4/tcp_minisocks.c:838 tcp_v6_rcv+0x21f8/0x3640 net/ipv6/tcp_ipv6.c:1631 ip6_protocol_deliver_rcu+0x2e6/0x1660 net/ipv6/ip6_input.c:433 ip6_input_finish+0x7f/0x160 net/ipv6/ip6_input.c:474 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip6_input+0xcf/0x3d0 net/ipv6/ip6_input.c:483 dst_input include/net/dst.h:441 [inline] ip6_rcv_finish+0x1d9/0x310 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ipv6_rcv+0xf8/0x3f0 net/ipv6/ip6_input.c:307 __netif_receive_skb_one_core+0xf5/0x160 net/core/dev.c:5256 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5370 process_backlog+0x21e/0x7a0 net/core/dev.c:6202 napi_poll net/core/dev.c:6647 [inline] net_rx_action+0x4c2/0x1070 net/core/dev.c:6715 __do_softirq+0x26c/0x9f7 kernel/softirq.c:292 The buggy address belongs to the object at ffff88805e4b9800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 166 bytes to the right of 1024-byte region [ffff88805e4b9800, ffff88805e4b9c00) The buggy address belongs to the page: page:ffffea0001792e40 refcount:1 mapcount:0 mapping:0000000011099835 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00015bfe08 ffffea00019d8908 ffff8880aa000c40 raw: 0000000000000000 ffff88805e4b9000 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88805e4b9b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805e4b9c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805e4b9c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88805e4b9d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805e4b9d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================