================================================================== BUG: KASAN: slab-out-of-bounds in xfrm_lookup_with_ifid+0x214d/0x2390 net/xfrm/xfrm_policy.c:3079 Read of size 4 at addr ffff88808b8c94dc by task swapper/1/0 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.5.0-rc5-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+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:639 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:134 xfrm_lookup_with_ifid+0x214d/0x2390 net/xfrm/xfrm_policy.c:3079 xfrmi_xmit2 net/xfrm/xfrm_interface.c:275 [inline] xfrmi_xmit+0x3ef/0x11a0 net/xfrm/xfrm_interface.c:366 __netdev_start_xmit include/linux/netdevice.h:4459 [inline] netdev_start_xmit include/linux/netdevice.h:4473 [inline] xmit_one net/core/dev.c:3420 [inline] dev_hard_start_xmit+0x1a3/0x9b0 net/core/dev.c:3436 __dev_queue_xmit+0x2b05/0x35c0 net/core/dev.c:4013 dev_queue_xmit+0x18/0x20 net/core/dev.c:4046 neigh_direct_output+0x16/0x20 net/core/neighbour.c:1527 neigh_output include/net/neighbour.h:510 [inline] ip6_finish_output2+0x109a/0x25c0 net/ipv6/ip6_output.c:116 __ip6_finish_output+0x444/0xaa0 net/ipv6/ip6_output.c:142 ip6_finish_output+0x38/0x1f0 net/ipv6/ip6_output.c:152 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x25e/0x880 net/ipv6/ip6_output.c:175 dst_output include/net/dst.h:436 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] ndisc_send_skb+0xf1f/0x1490 net/ipv6/ndisc.c:505 ndisc_send_rs+0x134/0x720 net/ipv6/ndisc.c:699 addrconf_rs_timer+0x30f/0x6e0 net/ipv6/addrconf.c:3879 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x6c3/0x1790 kernel/time/timer.c:1786 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:61 Code: e8 65 d7 f9 eb 8a cc cc cc cc cc cc e9 07 00 00 00 0f 00 2d 54 ef 4c 00 f4 c3 66 90 e9 07 00 00 00 0f 00 2d 44 ef 4c 00 fb f4 cc 55 48 89 e5 41 57 41 56 41 55 41 54 53 e8 9e 37 87 f9 e8 b9 RSP: 0018:ffffc90000d3fd68 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff132669e RBX: ffff8880a99fc340 RCX: 0000000000000000 RDX: dffffc0000000000 RSI: 0000000000000006 RDI: ffff8880a99fcbd4 RBP: ffffc90000d3fd98 R08: ffff8880a99fc340 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000 R13: ffffffff8a7be180 R14: 0000000000000000 R15: 0000000000000001 arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:690 default_idle_call+0x84/0xb0 kernel/sched/idle.c:94 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x3c8/0x6e0 kernel/sched/idle.c:269 cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:361 start_secondary+0x2f4/0x410 arch/x86/kernel/smpboot.c:264 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242 Allocated by task 4119: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:486 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:527 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x163/0x770 mm/slab.c:3665 kmalloc include/linux/slab.h:561 [inline] tomoyo_realpath_from_path+0xc5/0x660 security/tomoyo/realpath.c:252 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x2a3/0x3e0 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:319 [inline] tomoyo_file_open+0xa9/0xd0 security/tomoyo/tomoyo.c:314 security_file_open+0x71/0x300 security/security.c:1497 do_dentry_open+0x37a/0x1380 fs/open.c:784 vfs_open+0xa0/0xd0 fs/open.c:914 do_last fs/namei.c:3420 [inline] path_openat+0x10df/0x4500 fs/namei.c:3537 do_filp_open+0x1a1/0x280 fs/namei.c:3567 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_open fs/open.c:1115 [inline] __se_sys_open fs/open.c:1110 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1110 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 4119: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:335 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:474 kasan_slab_free+0xe/0x10 mm/kasan/common.c:483 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 tomoyo_realpath_from_path+0x1a7/0x660 security/tomoyo/realpath.c:289 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x2a3/0x3e0 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:319 [inline] tomoyo_file_open+0xa9/0xd0 security/tomoyo/tomoyo.c:314 security_file_open+0x71/0x300 security/security.c:1497 do_dentry_open+0x37a/0x1380 fs/open.c:784 vfs_open+0xa0/0xd0 fs/open.c:914 do_last fs/namei.c:3420 [inline] path_openat+0x10df/0x4500 fs/namei.c:3537 do_filp_open+0x1a1/0x280 fs/namei.c:3567 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_open fs/open.c:1115 [inline] __se_sys_open fs/open.c:1110 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1110 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808b8c8000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1244 bytes to the right of 4096-byte region [ffff88808b8c8000, ffff88808b8c9000) The buggy address belongs to the page: page:ffffea00022e3200 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 raw: 00fffe0000010200 ffffea0002283008 ffffea00022b2f88 ffff8880aa402000 raw: 0000000000000000 ffff88808b8c8000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808b8c9380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808b8c9400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808b8c9480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88808b8c9500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808b8c9580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================