================================================================== BUG: KASAN: use-after-free in nla_strlcpy+0x13d/0x150 lib/nlattr.c:314 Read of size 1 at addr ffff8801d954d86d by task syz-executor6/19552 CPU: 1 PID: 19552 Comm: syz-executor6 Not tainted 4.17.0-rc6+ #90 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+0x1b9/0x294 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430 nla_strlcpy+0x13d/0x150 lib/nlattr.c:314 nfnl_acct_new+0x574/0xc50 net/netfilter/nfnetlink_acct.c:118 nfnetlink_rcv_msg+0xdb5/0xff0 net/netfilter/nfnetlink.c:212 netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2448 nfnetlink_rcv+0x1fe/0x1ba0 net/netfilter/nfnetlink.c:513 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x58b/0x740 net/netlink/af_netlink.c:1336 netlink_sendmsg+0x9f0/0xfa0 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:639 sock_write_iter+0x35a/0x5a0 net/socket.c:908 call_write_iter include/linux/fs.h:1784 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x64d/0x960 fs/read_write.c:487 vfs_write+0x1f8/0x560 fs/read_write.c:549 ksys_write+0xf9/0x250 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __ia32_sys_write+0x71/0xb0 fs/read_write.c:607 do_syscall_32_irqs_on arch/x86/entry/common.c:323 [inline] do_fast_syscall_32+0x345/0xf9b arch/x86/entry/common.c:394 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7faecb9 RSP: 002b:00000000f5faa0ac EFLAGS: 00000282 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 0000000020000000 RDX: 000000000000001f RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 18049: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node_track_caller+0x47/0x70 mm/slab.c:3696 __kmalloc_reserve.isra.38+0x3a/0xe0 net/core/skbuff.c:137 __alloc_skb+0x14d/0x780 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:987 [inline] alloc_skb_with_frags+0x137/0x760 net/core/skbuff.c:5249 sock_alloc_send_pskb+0x87a/0xae0 net/core/sock.c:2088 sock_alloc_send_skb+0x32/0x40 net/core/sock.c:2105 __ip_append_data.isra.47+0x1443/0x2a30 net/ipv4/ip_output.c:970 ip_make_skb+0x2be/0x350 net/ipv4/ip_output.c:1492 udp_sendmsg+0x24ec/0x35e0 net/ipv4/udp.c:1035 udpv6_sendmsg+0x168e/0x30f0 net/ipv6/udp.c:1175 inet_sendmsg+0x19f/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:639 ___sys_sendmsg+0x525/0x940 net/socket.c:2117 __sys_sendmmsg+0x3bb/0x6f0 net/socket.c:2205 __compat_sys_sendmmsg net/compat.c:770 [inline] __do_compat_sys_sendmmsg net/compat.c:777 [inline] __se_compat_sys_sendmmsg net/compat.c:774 [inline] __ia32_compat_sys_sendmmsg+0x9f/0x100 net/compat.c:774 do_syscall_32_irqs_on arch/x86/entry/common.c:323 [inline] do_fast_syscall_32+0x345/0xf9b arch/x86/entry/common.c:394 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 18049: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xd9/0x260 mm/slab.c:3813 skb_free_head+0x99/0xc0 net/core/skbuff.c:550 skb_release_data+0x690/0x860 net/core/skbuff.c:570 skb_release_all+0x4a/0x60 net/core/skbuff.c:627 __kfree_skb net/core/skbuff.c:641 [inline] kfree_skb+0x195/0x560 net/core/skbuff.c:659 __neigh_event_send+0x888/0x1240 net/core/neighbour.c:1052 neigh_event_send include/net/neighbour.h:435 [inline] neigh_resolve_output+0x6dd/0xad0 net/core/neighbour.c:1342 neigh_output include/net/neighbour.h:482 [inline] ip_finish_output2+0xa5f/0x1840 net/ipv4/ip_output.c:229 ip_finish_output+0x828/0xf80 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:277 [inline] ip_output+0x21b/0x850 net/ipv4/ip_output.c:405 dst_output include/net/dst.h:444 [inline] ip_local_out+0xc5/0x1b0 net/ipv4/ip_output.c:124 iptunnel_xmit+0x567/0x850 net/ipv4/ip_tunnel_core.c:91 ip_tunnel_xmit+0x156b/0x3ac5 net/ipv4/ip_tunnel.c:778 ipip_tunnel_xmit+0x264/0x2c0 net/ipv4/ipip.c:308 __netdev_start_xmit include/linux/netdevice.h:4087 [inline] netdev_start_xmit include/linux/netdevice.h:4096 [inline] xmit_one net/core/dev.c:3053 [inline] dev_hard_start_xmit+0x264/0xc10 net/core/dev.c:3069 __dev_queue_xmit+0x2724/0x34c0 net/core/dev.c:3584 dev_queue_xmit+0x17/0x20 net/core/dev.c:3617 neigh_direct_output+0x15/0x20 net/core/neighbour.c:1398 neigh_output include/net/neighbour.h:482 [inline] ip_finish_output2+0xa5f/0x1840 net/ipv4/ip_output.c:229 ip_finish_output+0x828/0xf80 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:277 [inline] ip_output+0x21b/0x850 net/ipv4/ip_output.c:405 dst_output include/net/dst.h:444 [inline] ip_local_out+0xc5/0x1b0 net/ipv4/ip_output.c:124 ip_send_skb+0x40/0xe0 net/ipv4/ip_output.c:1425 udp_send_skb+0x69f/0xcc0 net/ipv4/udp.c:803 udp_sendmsg+0x254f/0x35e0 net/ipv4/udp.c:1040 udpv6_sendmsg+0x168e/0x30f0 net/ipv6/udp.c:1175 inet_sendmsg+0x19f/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:639 ___sys_sendmsg+0x525/0x940 net/socket.c:2117 __sys_sendmmsg+0x3bb/0x6f0 net/socket.c:2205 __compat_sys_sendmmsg net/compat.c:770 [inline] __do_compat_sys_sendmmsg net/compat.c:777 [inline] __se_compat_sys_sendmmsg net/compat.c:774 [inline] __ia32_compat_sys_sendmmsg+0x9f/0x100 net/compat.c:774 do_syscall_32_irqs_on arch/x86/entry/common.c:323 [inline] do_fast_syscall_32+0x345/0xf9b arch/x86/entry/common.c:394 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff8801d954d7c0 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 173 bytes inside of 512-byte region [ffff8801d954d7c0, ffff8801d954d9c0) The buggy address belongs to the page: page:ffffea0007655340 count:1 mapcount:0 mapping:ffff8801d954d040 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801d954d040 0000000000000000 0000000100000006 raw: ffffea0007611de0 ffffea000702b520 ffff8801da800940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d954d700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8801d954d780: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8801d954d800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d954d880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d954d900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================