================================================================== BUG: KASAN: slab-out-of-bounds in xfrm_lookup_with_ifid+0x2243/0x22f0 net/xfrm/xfrm_policy.c:3082 Read of size 4 at addr ffff888055fd57dc by task kworker/u4:11/15189 CPU: 1 PID: 15189 Comm: kworker/u4:11 Not tainted 5.5.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: bat_events batadv_nc_worker 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/0x32 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:641 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:134 xfrm_lookup_with_ifid+0x2243/0x22f0 net/xfrm/xfrm_policy.c:3082 xfrmi_xmit2 net/xfrm/xfrm_interface.c:272 [inline] xfrmi_xmit+0x43f/0x15e0 net/xfrm/xfrm_interface.c:387 __netdev_start_xmit include/linux/netdevice.h:4524 [inline] netdev_start_xmit include/linux/netdevice.h:4538 [inline] xmit_one net/core/dev.c:3470 [inline] dev_hard_start_xmit+0x1a3/0x9b0 net/core/dev.c:3486 __dev_queue_xmit+0x2b05/0x35c0 net/core/dev.c:4063 dev_queue_xmit+0x18/0x20 net/core/dev.c:4096 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:arch_local_irq_restore arch/x86/include/asm/paravirt.h:752 [inline] RIP: 0010:lock_release+0x4c0/0x960 kernel/locking/lockdep.c:4505 Code: 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 0f 85 8c 03 00 00 48 83 3d 47 9a 58 08 00 0f 84 7f 01 00 00 48 8b bd 48 ff ff ff 57 9d <0f> 1f 44 00 00 48 b8 00 00 00 00 00 fc ff df 48 01 c3 48 c7 03 00 RSP: 0018:ffffc9000569fbf0 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff136760f RBX: 1ffff92000ad3f83 RCX: 1ffff11013566979 RDX: dffffc0000000000 RSI: 1ffff11013566985 RDI: 0000000000000282 RBP: ffffc9000569fcc0 R08: 0000000000000003 R09: ffff88809ab34bd0 R10: fffffbfff154b110 R11: ffffffff8aa58887 R12: ffff88809ab34340 R13: ffffffff87d0436a R14: ffffc9000569fc98 R15: ffff88809ab34340 rcu_lock_release include/linux/rcupdate.h:213 [inline] rcu_read_unlock include/linux/rcupdate.h:655 [inline] batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:411 [inline] batadv_nc_worker+0x220/0x760 net/batman-adv/network-coding.c:718 process_one_work+0xa05/0x17a0 kernel/workqueue.c:2264 worker_thread+0x98/0xe40 kernel/workqueue.c:2410 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 30470: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:488 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x163/0x770 mm/slab.c:3665 kmalloc include/linux/slab.h:560 [inline] tomoyo_realpath_from_path+0xc5/0x660 security/tomoyo/realpath.c:252 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x1dd/0x520 security/tomoyo/file.c:723 tomoyo_file_ioctl+0x23/0x30 security/tomoyo/tomoyo.c:335 security_file_ioctl+0x77/0xc0 security/security.c:1441 ksys_ioctl+0x56/0x180 fs/ioctl.c:757 __do_sys_ioctl fs/ioctl.c:772 [inline] __se_sys_ioctl fs/ioctl.c:770 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:770 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 30470: 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:337 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:476 kasan_slab_free+0xe/0x10 mm/kasan/common.c:485 __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_path_number_perm+0x1dd/0x520 security/tomoyo/file.c:723 tomoyo_file_ioctl+0x23/0x30 security/tomoyo/tomoyo.c:335 security_file_ioctl+0x77/0xc0 security/security.c:1441 ksys_ioctl+0x56/0x180 fs/ioctl.c:757 __do_sys_ioctl fs/ioctl.c:772 [inline] __se_sys_ioctl fs/ioctl.c:770 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:770 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 ffff888055fd4000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2012 bytes to the right of 4096-byte region [ffff888055fd4000, ffff888055fd5000) The buggy address belongs to the page: page:ffffea000157f500 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea00017f1c88 ffffea0002787c88 ffff8880aa402000 raw: 0000000000000000 ffff888055fd4000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888055fd5680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888055fd5700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888055fd5780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888055fd5800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888055fd5880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================