netlink: 24 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'. ================================================================== BUG: KASAN: use-after-free in rtnl_newlink+0x13b0/0x1440 net/core/rtnetlink.c:3149 Read of size 1 at addr ffff888086618ae8 by task syz-executor.5/22456 CPU: 0 PID: 22456 Comm: syz-executor.5 Not tainted 4.19.128-syzkaller #0 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+0x1fc/0x2fe lib/dump_stack.c:118 print_address_description.cold+0x54/0x222 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x88/0x2b9 mm/kasan/report.c:396 rtnl_newlink+0x13b0/0x1440 net/core/rtnetlink.c:3149 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4777 netlink_rcv_skb+0x160/0x410 net/netlink/af_netlink.c:2455 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x4d7/0x6a0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x6e3/0xcc0 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:632 ___sys_sendmsg+0x803/0x920 net/socket.c:2115 __sys_sendmsg+0xec/0x1b0 net/socket.c:2153 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45ca59 Code: 0d b7 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 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fe7a8b26c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000501c60 RCX: 000000000045ca59 RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000003 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000a27 R14: 00000000004cd0a8 R15: 00007fe7a8b276d4 Allocated by task 22456: __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node+0x4c/0x70 mm/slab.c:3696 kmalloc_node include/linux/slab.h:557 [inline] kvmalloc_node+0xb4/0xf0 mm/util.c:423 kvmalloc include/linux/mm.h:577 [inline] kvzalloc include/linux/mm.h:585 [inline] alloc_netdev_mqs+0x97/0xd50 net/core/dev.c:9137 rtnl_create_link+0x1d4/0xa30 net/core/rtnetlink.c:2869 rtnl_newlink+0xe1a/0x1440 net/core/rtnetlink.c:3131 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4777 netlink_rcv_skb+0x160/0x410 net/netlink/af_netlink.c:2455 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x4d7/0x6a0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x6e3/0xcc0 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:632 ___sys_sendmsg+0x803/0x920 net/socket.c:2115 __sys_sendmsg+0xec/0x1b0 net/socket.c:2153 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 22456: __cache_free mm/slab.c:3503 [inline] kfree+0xce/0x220 mm/slab.c:3822 kvfree+0x59/0x60 mm/util.c:452 netdev_freemem net/core/dev.c:9091 [inline] free_netdev+0x36d/0x420 net/core/dev.c:9242 device_release+0x76/0x210 drivers/base/core.c:1061 kobject_cleanup lib/kobject.c:662 [inline] kobject_release lib/kobject.c:691 [inline] kref_put include/linux/kref.h:70 [inline] kobject_put+0x17c/0x270 lib/kobject.c:708 put_device drivers/base/core.c:2251 [inline] device_unregister+0x24/0x30 drivers/base/core.c:2363 register_netdevice+0xbb0/0xf70 net/core/dev.c:8776 nsim_newlink+0x162/0x1c0 drivers/net/netdevsim/netdev.c:555 rtnl_newlink+0xf03/0x1440 net/core/rtnetlink.c:3141 rtnetlink_rcv_msg+0x453/0xb80 net/core/rtnetlink.c:4777 netlink_rcv_skb+0x160/0x410 net/netlink/af_netlink.c:2455 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x4d7/0x6a0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x6e3/0xcc0 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:632 ___sys_sendmsg+0x803/0x920 net/socket.c:2115 __sys_sendmsg+0xec/0x1b0 net/socket.c:2153 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888086618580 which belongs to the cache kmalloc-8192 of size 8192 The buggy address is located 1384 bytes inside of 8192-byte region [ffff888086618580, ffff88808661a580) The buggy address belongs to the page: page:ffffea0002198600 count:1 mapcount:0 mapping:ffff88812c3d5080 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea0000335108 ffffea00024a6308 ffff88812c3d5080 raw: 0000000000000000 ffff888086618580 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888086618980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888086618a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888086618a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888086618b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888086618b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================