netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'. ================================================================== BUG: KASAN: use-after-free in vlan_dev_get_iflink+0x5f/0x70 net/8021q/vlan_dev.c:769 Read of size 4 at addr ffff8880a3a64508 by task syz-executor.1/14547 CPU: 1 PID: 14547 Comm: syz-executor.1 Not tainted 4.14.202-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x14b/0x1f1 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429 vlan_dev_get_iflink+0x5f/0x70 net/8021q/vlan_dev.c:769 dev_get_iflink+0x65/0xb0 net/core/dev.c:691 rfc2863_policy+0x185/0x240 net/core/link_watch.c:43 linkwatch_do_dev+0x12/0xc0 net/core/link_watch.c:157 linkwatch_forget_dev+0x14f/0x1f0 net/core/link_watch.c:223 netdev_wait_allrefs net/core/dev.c:7838 [inline] netdev_run_todo+0x238/0x6d0 net/core/dev.c:7939 rtnl_unlock net/core/rtnetlink.c:106 [inline] rtnetlink_rcv_msg+0x357/0x9e0 net/core/rtnetlink.c:4318 netlink_rcv_skb+0x12f/0x3b0 net/netlink/af_netlink.c:2433 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4328 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x610 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x657/0xc60 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:656 ___sys_sendmsg+0x625/0x920 net/socket.c:2062 __sys_sendmsg+0xc1/0x140 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0xd/0x20 net/socket.c:2103 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45ccd9 RSP: 002b:00007f3d2244dc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000002c080 RCX: 000000000045ccd9 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 000000000078bf40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c R13: 00007fffa4d9ffff R14: 00007f3d2244e9c0 R15: 000000000078bf0c Allocated by task 14547: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:551 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:536 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node+0x50/0x70 mm/slab.c:3689 kmalloc_node include/linux/slab.h:530 [inline] kvmalloc_node+0x70/0x80 mm/util.c:397 kvmalloc include/linux/mm.h:531 [inline] kvzalloc include/linux/mm.h:539 [inline] alloc_netdev_mqs+0x60/0xb40 net/core/dev.c:8104 rtnl_create_link+0x1a8/0x950 net/core/rtnetlink.c:2460 rtnl_newlink+0xb56/0x13a0 net/core/rtnetlink.c:2718 rtnetlink_rcv_msg+0x34c/0x9e0 net/core/rtnetlink.c:4316 netlink_rcv_skb+0x12f/0x3b0 net/netlink/af_netlink.c:2433 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4328 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x610 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x657/0xc60 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:656 ___sys_sendmsg+0x625/0x920 net/socket.c:2062 __sys_sendmsg+0xc1/0x140 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0xd/0x20 net/socket.c:2103 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 14591: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xab/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 kvfree+0x2c/0x30 mm/util.c:416 netdev_freemem+0x47/0x60 net/core/dev.c:8056 netdev_release+0x6a/0x80 net/core/net-sysfs.c:1506 device_release+0x134/0x170 drivers/base/core.c:833 kobject_cleanup lib/kobject.c:646 [inline] kobject_release lib/kobject.c:675 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x10d/0x1b0 lib/kobject.c:692 netdev_run_todo+0x49e/0x6d0 net/core/dev.c:7961 rtnl_unlock net/core/rtnetlink.c:106 [inline] rtnetlink_rcv_msg+0x357/0x9e0 net/core/rtnetlink.c:4318 netlink_rcv_skb+0x12f/0x3b0 net/netlink/af_netlink.c:2433 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4328 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x610 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x657/0xc60 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:656 ___sys_sendmsg+0x625/0x920 net/socket.c:2062 __sys_sendmsg+0xc1/0x140 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0xd/0x20 net/socket.c:2103 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8880a3a64400 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 264 bytes inside of 4096-byte region [ffff8880a3a64400, ffff8880a3a65400) The buggy address belongs to the page: page:ffffea00028e9900 count:1 mapcount:0 mapping:ffff8880a3a64400 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff8880a3a64400 0000000000000000 0000000100000001 raw: ffffea0002b194a0 ffffea0002b214a0 ffff8880b6400dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a3a64400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a3a64480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a3a64500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a3a64580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a3a64600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================