================================================================== BUG: KASAN: use-after-free in nla_strlcpy+0x13d/0x150 lib/nlattr.c:314 Read of size 1 at addr ffff8801af0b0d1c by task syz-executor2/29430 CPU: 1 PID: 29430 Comm: syz-executor2 Not tainted 4.17.0-rc6+ #89 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:0xf7f48cb9 RSP: 002b:00000000f5f440ac 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 6: 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] nlmsg_new include/net/netlink.h:511 [inline] mpls_netconf_notify_devconf+0x52/0x120 net/mpls/af_mpls.c:1189 mpls_dev_sysctl_unregister+0x9f/0xc0 net/mpls/af_mpls.c:1392 mpls_dev_notify+0x919/0xb40 net/mpls/af_mpls.c:1575 notifier_call_chain+0x178/0x380 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x2d/0x40 kernel/notifier.c:401 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1734 call_netdevice_notifiers net/core/dev.c:1752 [inline] rollback_registered_many+0x945/0xed0 net/core/dev.c:7436 unregister_netdevice_many+0xf3/0x4c0 net/core/dev.c:8539 ip_tunnel_delete_nets+0x4bd/0x6a0 net/ipv4/ip_tunnel.c:1073 ipgre_exit_batch_net+0x22/0x30 net/ipv4/ip_gre.c:1047 ops_exit_list.isra.7+0x105/0x160 net/core/net_namespace.c:155 cleanup_net+0x51d/0xb20 net/core/net_namespace.c:523 process_one_work+0xc1e/0x1b50 kernel/workqueue.c:2145 worker_thread+0x1cc/0x1440 kernel/workqueue.c:2279 kthread+0x345/0x410 kernel/kthread.c:240 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412 Freed by task 6: 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 netlink_broadcast_filtered+0x666/0x1580 net/netlink/af_netlink.c:1512 netlink_broadcast net/netlink/af_netlink.c:1534 [inline] nlmsg_multicast include/net/netlink.h:591 [inline] nlmsg_notify+0xa0/0x1a0 net/netlink/af_netlink.c:2491 rtnl_notify+0xce/0xf0 net/core/rtnetlink.c:724 mpls_netconf_notify_devconf+0xb1/0x120 net/mpls/af_mpls.c:1201 mpls_dev_sysctl_unregister+0x9f/0xc0 net/mpls/af_mpls.c:1392 mpls_dev_notify+0x919/0xb40 net/mpls/af_mpls.c:1575 notifier_call_chain+0x178/0x380 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x2d/0x40 kernel/notifier.c:401 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1734 call_netdevice_notifiers net/core/dev.c:1752 [inline] rollback_registered_many+0x945/0xed0 net/core/dev.c:7436 unregister_netdevice_many+0xf3/0x4c0 net/core/dev.c:8539 ip_tunnel_delete_nets+0x4bd/0x6a0 net/ipv4/ip_tunnel.c:1073 ipgre_exit_batch_net+0x22/0x30 net/ipv4/ip_gre.c:1047 ops_exit_list.isra.7+0x105/0x160 net/core/net_namespace.c:155 cleanup_net+0x51d/0xb20 net/core/net_namespace.c:523 process_one_work+0xc1e/0x1b50 kernel/workqueue.c:2145 worker_thread+0x1cc/0x1440 kernel/workqueue.c:2279 kthread+0x345/0x410 kernel/kthread.c:240 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412 The buggy address belongs to the object at ffff8801af0b0c80 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 156 bytes inside of 512-byte region [ffff8801af0b0c80, ffff8801af0b0e80) The buggy address belongs to the page: page:ffffea0006bc2c00 count:1 mapcount:0 mapping:ffff8801af0b0000 index:0xffff8801af0b0000 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801af0b0000 ffff8801af0b0000 0000000100000004 raw: ffffea00074cde20 ffffea00065299a0 ffff8801da800940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801af0b0c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801af0b0c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801af0b0d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801af0b0d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801af0b0e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================