================================================================== BUG: KASAN: use-after-free in nla_strlcpy+0x13d/0x150 lib/nlattr.c:314 Read of size 1 at addr ffff8801b3f65621 by task syz-executor7/13873 CPU: 1 PID: 13873 Comm: syz-executor7 Not tainted 4.17.0-rc7+ #102 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 ___sys_sendmsg+0x805/0x940 net/socket.c:2117 __sys_sendmsg+0x115/0x270 net/socket.c:2155 __compat_sys_sendmsg net/compat.c:756 [inline] __do_compat_sys_sendmsg net/compat.c:763 [inline] __se_compat_sys_sendmsg net/compat.c:760 [inline] __ia32_compat_sys_sendmsg+0x7a/0xb0 net/compat.c:760 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: 0000000000000172 RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 0000000020000080 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 13331: 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] kobject_uevent_net_broadcast lib/kobject_uevent.c:322 [inline] kobject_uevent_env+0x801/0xea0 lib/kobject_uevent.c:519 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:568 rx_queue_add_kobject net/core/net-sysfs.c:935 [inline] net_rx_queue_update_kobjects+0x493/0x610 net/core/net-sysfs.c:954 register_queue_kobjects net/core/net-sysfs.c:1397 [inline] netdev_register_kobject+0x276/0x380 net/core/net-sysfs.c:1608 register_netdevice+0x997/0x11c0 net/core/dev.c:7961 register_netdev+0x30/0x50 net/core/dev.c:8076 loopback_net_init+0x78/0x160 drivers/net/loopback.c:214 ops_init+0xff/0x550 net/core/net_namespace.c:128 setup_net+0x3c5/0x950 net/core/net_namespace.c:313 copy_net_ns+0x2bc/0x4c0 net/core/net_namespace.c:436 create_new_namespaces+0x69d/0x8f0 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xc3/0x1f0 kernel/nsproxy.c:206 ksys_unshare+0x708/0xf90 kernel/fork.c:2408 __do_sys_unshare kernel/fork.c:2476 [inline] __se_sys_unshare kernel/fork.c:2474 [inline] __ia32_sys_unshare+0x30/0x40 kernel/fork.c:2474 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 13331: 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] consume_skb+0x18b/0x550 net/core/skbuff.c:701 kobject_uevent_net_broadcast lib/kobject_uevent.c:343 [inline] kobject_uevent_env+0x8c6/0xea0 lib/kobject_uevent.c:519 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:568 rx_queue_add_kobject net/core/net-sysfs.c:935 [inline] net_rx_queue_update_kobjects+0x493/0x610 net/core/net-sysfs.c:954 register_queue_kobjects net/core/net-sysfs.c:1397 [inline] netdev_register_kobject+0x276/0x380 net/core/net-sysfs.c:1608 register_netdevice+0x997/0x11c0 net/core/dev.c:7961 register_netdev+0x30/0x50 net/core/dev.c:8076 loopback_net_init+0x78/0x160 drivers/net/loopback.c:214 ops_init+0xff/0x550 net/core/net_namespace.c:128 setup_net+0x3c5/0x950 net/core/net_namespace.c:313 copy_net_ns+0x2bc/0x4c0 net/core/net_namespace.c:436 create_new_namespaces+0x69d/0x8f0 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xc3/0x1f0 kernel/nsproxy.c:206 ksys_unshare+0x708/0xf90 kernel/fork.c:2408 __do_sys_unshare kernel/fork.c:2476 [inline] __se_sys_unshare kernel/fork.c:2474 [inline] __ia32_sys_unshare+0x30/0x40 kernel/fork.c:2474 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 ffff8801b3f65580 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 161 bytes inside of 512-byte region [ffff8801b3f65580, ffff8801b3f65780) The buggy address belongs to the page: page:ffffea0006cfd940 count:1 mapcount:0 mapping:ffff8801b3f65080 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801b3f65080 0000000000000000 0000000100000006 raw: ffffea0006d294a0 ffffea000729a7a0 ffff8801da800940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801b3f65500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801b3f65580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801b3f65600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801b3f65680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801b3f65700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================