================================================================== BUG: KASAN: slab-out-of-bounds in xfrm_lookup_with_ifid+0x1eae/0x20f0 net/xfrm/xfrm_policy.c:3083 Read of size 4 at addr ffff888057a85564 by task syz-executor.5/21837 CPU: 0 PID: 21837 Comm: syz-executor.5 Not tainted 5.6.0-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:374 __kasan_report.cold+0x1a/0x32 mm/kasan/report.c:506 kasan_report+0xe/0x20 mm/kasan/common.c:641 xfrm_lookup_with_ifid+0x1eae/0x20f0 net/xfrm/xfrm_policy.c:3083 xfrmi_xmit2 net/xfrm/xfrm_interface.c:272 [inline] xfrmi_xmit+0x3c1/0x1430 net/xfrm/xfrm_interface.c:387 __netdev_start_xmit include/linux/netdevice.h:4533 [inline] netdev_start_xmit include/linux/netdevice.h:4547 [inline] xmit_one net/core/dev.c:3477 [inline] dev_hard_start_xmit+0x1a4/0x9b0 net/core/dev.c:3493 __dev_queue_xmit+0x25e1/0x30a0 net/core/dev.c:4052 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] NF_HOOK include/linux/netfilter.h:307 [inline] ndisc_send_skb+0xf40/0x14b0 net/ipv6/ndisc.c:506 ndisc_send_rs+0x12e/0x6f0 net/ipv6/ndisc.c:700 addrconf_rs_timer+0x30f/0x6e0 net/ipv6/addrconf.c:3885 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1405 expire_timers kernel/time/timer.c:1450 [inline] __run_timers kernel/time/timer.c:1774 [inline] __run_timers kernel/time/timer.c:1741 [inline] run_timer_softirq+0x623/0x1600 kernel/time/timer.c:1787 __do_softirq+0x26c/0x9f7 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x192/0x1d0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:546 [inline] smp_apic_timer_interrupt+0x19e/0x600 arch/x86/kernel/apic/apic.c:1140 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:759 [inline] RIP: 0010:lock_release+0x45f/0x800 kernel/locking/lockdep.c:4944 Code: 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 0b 03 00 00 48 83 3d dd 47 3b 08 00 0f 84 71 01 00 00 48 8b 3c 24 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:ffffc90001d47aa8 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff132918c RBX: 1ffff920003a8f58 RCX: 1ffff11013b01d5e RDX: dffffc0000000000 RSI: 1ffff11013b01d65 RDI: 0000000000000282 RBP: ffff88809d80e240 R08: ffff88809d80e240 R09: fffffbfff150f9f1 R10: fffffbfff150f9f0 R11: ffffffff8a87cf87 R12: 41d74dc563097682 R13: ffffffff8685d135 R14: ffff88809d80eaf8 R15: 0000000000000002 rcu_lock_release include/linux/rcupdate.h:213 [inline] rcu_read_unlock include/linux/rcupdate.h:655 [inline] inet_twsk_purge+0x517/0x760 net/ipv4/inet_timewait_sock.c:299 ops_exit_list.isra.0+0x103/0x150 net/core/net_namespace.c:189 setup_net+0x50c/0x860 net/core/net_namespace.c:364 copy_net_ns+0x293/0x590 net/core/net_namespace.c:482 create_new_namespaces+0x3fb/0xb30 kernel/nsproxy.c:108 unshare_nsproxy_namespaces+0xbd/0x1f0 kernel/nsproxy.c:229 ksys_unshare+0x43d/0x8e0 kernel/fork.c:2955 __do_sys_unshare kernel/fork.c:3023 [inline] __se_sys_unshare kernel/fork.c:3021 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3021 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x45c849 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fdc72163c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 00007fdc721646d4 RCX: 000000000045c849 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000c40 R14: 00000000004ce650 R15: 000000000076bf0c Allocated by task 4106: save_stack+0x1b/0x80 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+0xbf/0xd0 mm/kasan/common.c:488 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x161/0x7a0 mm/slab.c:3665 kmalloc include/linux/slab.h:560 [inline] tomoyo_realpath_from_path+0xc2/0x620 security/tomoyo/realpath.c:252 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x214/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xeb/0x150 security/security.c:1273 vfs_getattr+0x22/0x60 fs/stat.c:117 vfs_statx+0x142/0x1e0 fs/stat.c:201 vfs_lstat include/linux/fs.h:3279 [inline] __do_sys_newlstat+0x96/0x120 fs/stat.c:364 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 4106: save_stack+0x1b/0x80 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+0xf7/0x140 mm/kasan/common.c:476 __cache_free mm/slab.c:3426 [inline] kfree+0x109/0x2b0 mm/slab.c:3757 tomoyo_realpath_from_path+0x18f/0x620 security/tomoyo/realpath.c:289 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x214/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xeb/0x150 security/security.c:1273 vfs_getattr+0x22/0x60 fs/stat.c:117 vfs_statx+0x142/0x1e0 fs/stat.c:201 vfs_lstat include/linux/fs.h:3279 [inline] __do_sys_newlstat+0x96/0x120 fs/stat.c:364 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff888057a84000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1380 bytes to the right of 4096-byte region [ffff888057a84000, ffff888057a85000) The buggy address belongs to the page: page:ffffea00015ea100 refcount:1 mapcount:0 mapping:ffff8880aa002000 index:0x0 compound_mapcount: 0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea00017c0188 ffffea0001826888 ffff8880aa002000 raw: 0000000000000000 ffff888057a84000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888057a85400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888057a85480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888057a85500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888057a85580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888057a85600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================