================================================================== BUG: KASAN: slab-out-of-bounds in xfrm_lookup_with_ifid+0x1e23/0x2150 net/xfrm/xfrm_policy.c:3083 Read of size 4 at addr ffff888067e71624 by task syz-executor.3/12676 CPU: 0 PID: 12676 Comm: syz-executor.3 Not tainted 5.7.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+0x188/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x413 mm/kasan/report.c:382 __kasan_report.cold+0x20/0x38 mm/kasan/report.c:511 kasan_report+0x33/0x50 mm/kasan/common.c:625 xfrm_lookup_with_ifid+0x1e23/0x2150 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:4605 [inline] netdev_start_xmit include/linux/netdevice.h:4619 [inline] xmit_one net/core/dev.c:3545 [inline] dev_hard_start_xmit+0x1a4/0x9b0 net/core/dev.c:3561 __dev_queue_xmit+0x25e1/0x3090 net/core/dev.c:4120 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:3848 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+0x623/0x1600 kernel/time/timer.c:1786 __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:get_current arch/x86/include/asm/current.h:15 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x50 kernel/kcov.c:186 Code: 00 00 00 00 e9 e8 e7 ff ff cc 65 48 8b 04 25 00 1f 02 00 48 8b 80 f0 13 00 00 c3 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 <65> 48 8b 04 25 00 1f 02 00 65 8b 15 08 ec 8e 7e 81 e2 00 01 1f 00 RSP: 0018:ffffc90015caf710 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: ffffed1012494a00 RBX: 0000000000000001 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffffea0002492940 RBP: 0000000000000001 R08: 0000000000001000 R09: ffffed1012494a00 R10: ffffea0002492977 R11: fffff9400049252e R12: ffffea0002492940 R13: 0000000000000000 R14: 0000000000002dc2 R15: ffff88812fffb700 page_poisoning_enabled mm/page_poison.c:34 [inline] kernel_poison_pages+0x1a/0x2a0 mm/page_poison.c:120 post_alloc_hook mm/page_alloc.c:2201 [inline] prep_new_page+0x110/0x1f0 mm/page_alloc.c:2208 get_page_from_freelist+0x115c/0x3590 mm/page_alloc.c:3762 __alloc_pages_nodemask+0x29f/0x810 mm/page_alloc.c:4812 alloc_pages_current+0xff/0x200 mm/mempolicy.c:2295 alloc_pages include/linux/gfp.h:540 [inline] __vmalloc_area_node mm/vmalloc.c:2491 [inline] __vmalloc_node_range+0x478/0x7a0 mm/vmalloc.c:2555 __vmalloc_node mm/vmalloc.c:2610 [inline] __vmalloc_node_flags mm/vmalloc.c:2624 [inline] vzalloc+0x67/0x80 mm/vmalloc.c:2669 alloc_counters.isra.0+0x50/0x680 net/ipv4/netfilter/ip_tables.c:800 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:822 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1024 [inline] do_ipt_get_ctl+0x4be/0x890 net/ipv4/netfilter/ip_tables.c:1700 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:122 ip_getsockopt net/ipv4/ip_sockglue.c:1702 [inline] ip_getsockopt+0x165/0x1c0 net/ipv4/ip_sockglue.c:1682 tcp_getsockopt net/ipv4/tcp.c:3737 [inline] tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:3731 __sys_getsockopt+0x14b/0x2e0 net/socket.c:2172 __do_sys_getsockopt net/socket.c:2187 [inline] __se_sys_getsockopt net/socket.c:2184 [inline] __x64_sys_getsockopt+0xba/0x150 net/socket.c:2184 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x45f53a Code: b8 34 01 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 ed 8b fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 ca 8b fb ff c3 66 0f 1f 84 00 00 00 00 00 RSP: 002b:00007ffe5237ce28 EFLAGS: 00000216 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 00007ffe5237ce50 RCX: 000000000045f53a RDX: 0000000000000041 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 0000000000741e60 R08: 00007ffe5237ce4c R09: 0000000000004000 R10: 00007ffe5237cf50 R11: 0000000000000216 R12: 0000000000000003 R13: 0000000000000000 R14: 0000000000000000 R15: 00000000007417a0 Allocated by task 12959: 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] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:492 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:549 [inline] nsim_dev_trap_report_work+0x2bb/0xbc0 drivers/net/netdevsim/dev.c:590 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:351 Freed by task 12959: 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 net/core/skbuff.c:678 [inline] consume_skb net/core/skbuff.c:837 [inline] consume_skb+0xf3/0x400 net/core/skbuff.c:831 nsim_dev_trap_report drivers/net/netdevsim/dev.c:565 [inline] nsim_dev_trap_report_work+0x86d/0xbc0 drivers/net/netdevsim/dev.c:590 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:351 The buggy address belongs to the object at ffff888067e70000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1572 bytes to the right of 4096-byte region [ffff888067e70000, ffff888067e71000) The buggy address belongs to the page: page:ffffea00019f9c00 refcount:1 mapcount:0 mapping:000000004cf121e2 index:0x0 head:ffffea00019f9c00 order:1 compound_mapcount:0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea000299cd88 ffffea0001ac4e08 ffff8880aa002000 raw: 0000000000000000 ffff888067e70000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888067e71500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888067e71580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888067e71600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888067e71680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888067e71700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================