================================================================== 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 ffff8880a41172f8 by task syz-executor.0/27136 CPU: 0 PID: 27136 Comm: syz-executor.0 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:4599 [inline] netdev_start_xmit include/linux/netdevice.h:4613 [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/0x3090 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_sendmsg+0x308/0x7e0 net/socket.c:2362 ___sys_sendmsg+0x100/0x170 net/socket.c:2416 __sys_sendmmsg+0x195/0x480 net/socket.c:2506 __do_sys_sendmmsg net/socket.c:2535 [inline] __se_sys_sendmmsg net/socket.c:2532 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2532 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:00007f04847d7c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00000000004fc4a0 RCX: 000000000045c829 RDX: 0000000000000001 RSI: 0000000020004740 RDI: 0000000000000003 RBP: 000000000078c220 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000008e3 R14: 00000000004cb877 R15: 00007f04847d86d4 Allocated by task 10365: 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 kmem_cache_alloc_trace+0x153/0x7d0 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] ima_add_digest_entry+0x4e/0x470 security/integrity/ima/ima_queue.c:98 ima_add_template_entry+0x2f1/0x720 security/integrity/ima/ima_queue.c:182 ima_store_template+0x1b0/0x270 security/integrity/ima/ima_api.c:121 ima_store_measurement+0x1e3/0x400 security/integrity/ima/ima_api.c:330 process_measurement+0x118f/0x1750 security/integrity/ima/ima_main.c:332 ima_file_check+0xb9/0x100 security/integrity/ima/ima_main.c:440 do_open fs/namei.c:3231 [inline] path_openat+0x1997/0x27d0 fs/namei.c:3346 do_filp_open+0x192/0x260 fs/namei.c:3373 do_sys_openat2+0x585/0x7d0 fs/open.c:1148 do_sys_open+0xc3/0x140 fs/open.c:1164 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 7400: 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 free_rb_tree_fname+0x7f/0xe0 fs/ext4/dir.c:410 ext4_htree_free_dir_info fs/ext4/dir.c:432 [inline] ext4_release_dir+0x41/0x60 fs/ext4/dir.c:629 __fput+0x33e/0x880 fs/file_table.c:280 task_work_run+0xf4/0x1b0 kernel/task_work.c:123 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x2fa/0x360 arch/x86/entry/common.c:165 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath arch/x86/entry/common.c:279 [inline] do_syscall_64+0x6b1/0x7d0 arch/x86/entry/common.c:305 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff8880a4117280 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 56 bytes to the right of 64-byte region [ffff8880a4117280, ffff8880a41172c0) The buggy address belongs to the page: page:ffffea00029045c0 refcount:1 mapcount:0 mapping:00000000ef7f13b1 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00029ca548 ffffea0001856288 ffff8880aa000380 raw: 0000000000000000 ffff8880a4117000 0000000100000020 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a4117180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880a4117200: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880a4117280: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880a4117300: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff8880a4117380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================