================================================================== BUG: KASAN: use-after-free in rtnl_fill_ifinfo+0x420e/0x4670 net/core/rtnetlink.c:1630 Read of size 8 at addr ffff8801d89f8158 by task syz-executor2/29543 CPU: 0 PID: 29543 Comm: syz-executor2 Not tainted 4.19.0-rc5-next-20180928+ #84 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+0x1d3/0x2c4 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 rtnl_fill_ifinfo+0x420e/0x4670 net/core/rtnetlink.c:1630 rtmsg_ifinfo_build_skb+0xc9/0x190 net/core/rtnetlink.c:3333 rtmsg_ifinfo_event.part.31+0x45/0xe0 net/core/rtnetlink.c:3365 rtmsg_ifinfo_event net/core/rtnetlink.c:3376 [inline] rtmsg_ifinfo+0x8c/0xa0 net/core/rtnetlink.c:3374 netdev_state_change+0x152/0x1a0 net/core/dev.c:1340 do_setlink+0x2680/0x3f20 net/core/rtnetlink.c:2653 rtnl_group_changelink net/core/rtnetlink.c:2902 [inline] rtnl_newlink+0x1573/0x1d40 net/core/rtnetlink.c:3060 rtnetlink_rcv_msg+0x46a/0xc20 net/core/rtnetlink.c:4730 netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2447 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4748 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x5a5/0x760 net/netlink/af_netlink.c:1336 netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2117 __sys_sendmsg+0x11d/0x280 net/socket.c:2155 __do_sys_sendmsg net/socket.c:2164 [inline] __se_sys_sendmsg net/socket.c:2162 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2162 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457579 Code: 1d b4 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 eb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9daf91dc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457579 RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000000000004 RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9daf91e6d4 R13: 00000000004c38b9 R14: 00000000004d5700 R15: 00000000ffffffff Allocated by task 6025: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/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.39+0x41/0xe0 net/core/skbuff.c:137 __alloc_skb+0x150/0x770 net/core/skbuff.c:205 alloc_skb_fclone include/linux/skbuff.h:1039 [inline] sk_stream_alloc_skb+0x13c/0x960 net/ipv4/tcp.c:874 tcp_sendmsg_locked+0xee4/0x3f90 net/ipv4/tcp.c:1286 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1443 inet_sendmsg+0x19c/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 sock_write_iter+0x35e/0x5c0 net/socket.c:901 call_write_iter include/linux/fs.h:1825 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x6b8/0x9f0 fs/read_write.c:487 vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 6025: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3813 skb_free_head+0x99/0xc0 net/core/skbuff.c:550 skb_release_data+0x6a4/0x880 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+0x1a9/0x560 net/core/skbuff.c:701 __dev_kfree_skb_any+0xa7/0xd0 net/core/dev.c:2761 dev_consume_skb_any include/linux/netdevice.h:3548 [inline] free_old_xmit_skbs+0xc1/0x200 drivers/net/virtio_net.c:1340 start_xmit+0x1ba/0x18c0 drivers/net/virtio_net.c:1511 __netdev_start_xmit include/linux/netdevice.h:4322 [inline] netdev_start_xmit include/linux/netdevice.h:4331 [inline] xmit_one net/core/dev.c:3219 [inline] dev_hard_start_xmit+0x290/0xc90 net/core/dev.c:3235 sch_direct_xmit+0x48b/0x1130 net/sched/sch_generic.c:327 qdisc_restart net/sched/sch_generic.c:390 [inline] __qdisc_run+0x631/0x1980 net/sched/sch_generic.c:398 qdisc_run include/net/pkt_sched.h:121 [inline] __dev_xmit_skb net/core/dev.c:3414 [inline] __dev_queue_xmit+0x190b/0x3950 net/core/dev.c:3773 dev_queue_xmit+0x17/0x20 net/core/dev.c:3838 neigh_hh_output include/net/neighbour.h:473 [inline] neigh_output include/net/neighbour.h:481 [inline] ip_finish_output2+0x105c/0x1860 net/ipv4/ip_output.c:229 ip_finish_output+0x7f8/0xf90 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:276 [inline] ip_output+0x21d/0x8d0 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_queue_xmit+0x9af/0x1f30 net/ipv4/ip_output.c:505 ip_queue_xmit+0x56/0x70 include/net/ip.h:197 __tcp_transmit_skb+0x1bc5/0x3b00 net/ipv4/tcp_output.c:1179 tcp_transmit_skb net/ipv4/tcp_output.c:1195 [inline] tcp_write_xmit+0x15bf/0x5630 net/ipv4/tcp_output.c:2381 __tcp_push_pending_frames+0xb2/0x290 net/ipv4/tcp_output.c:2554 tcp_push+0x662/0x900 net/ipv4/tcp.c:735 tcp_sendmsg_locked+0x3296/0x3f90 net/ipv4/tcp.c:1406 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1443 inet_sendmsg+0x19c/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 sock_write_iter+0x35e/0x5c0 net/socket.c:901 call_write_iter include/linux/fs.h:1825 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x6b8/0x9f0 fs/read_write.c:487 vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8801d89f8140 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 24 bytes inside of 2048-byte region [ffff8801d89f8140, ffff8801d89f8940) The buggy address belongs to the page: page:ffffea0007627e00 count:1 mapcount:0 mapping:ffff8801da800c40 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea000752c808 ffffea0006ffab88 ffff8801da800c40 raw: 0000000000000000 ffff8801d89f8140 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d89f8000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801d89f8080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801d89f8100: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8801d89f8180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d89f8200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================