================================================================== BUG: KASAN: use-after-free in free_netdev+0x443/0x4d0 net/core/dev.c:9887 Read of size 8 at addr ffff88809366a6b8 by task syz-executor.5/11905 CPU: 1 PID: 11905 Comm: syz-executor.5 Not tainted 5.6.0-rc6-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+0x188/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:374 __kasan_report.cold+0x1a/0x32 mm/kasan/report.c:506 kasan_report+0xe/0x20 mm/kasan/common.c:641 free_netdev+0x443/0x4d0 net/core/dev.c:9887 netdev_run_todo+0x5fc/0x760 net/core/dev.c:9637 rtnl_unlock net/core/rtnetlink.c:112 [inline] rtnetlink_rcv_msg+0x45b/0xad0 net/core/rtnetlink.c:5437 netlink_rcv_skb+0x15a/0x410 net/netlink/af_netlink.c:2478 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329 netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 ____sys_sendmsg+0x6b9/0x7d0 net/socket.c:2343 ___sys_sendmsg+0x100/0x170 net/socket.c:2397 __sys_sendmsg+0xec/0x1b0 net/socket.c:2430 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c849 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f8bc541ac78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f8bc541b6d4 RCX: 000000000045c849 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000005 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000009f8 R14: 00000000004ccb00 R15: 000000000076bf0c Allocated by task 11905: save_stack+0x1b/0x80 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:488 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x161/0x7a0 mm/slab.c:3665 kmalloc include/linux/slab.h:560 [inline] sk_prot_alloc+0x223/0x2f0 net/core/sock.c:1603 sk_alloc+0x36/0xfa0 net/core/sock.c:1657 tun_chr_open+0x7b/0x540 drivers/net/tun.c:3423 misc_open+0x372/0x4a0 drivers/char/misc.c:141 chrdev_open+0x219/0x5c0 fs/char_dev.c:414 do_dentry_open+0x4a2/0x1250 fs/open.c:797 do_last fs/namei.c:3490 [inline] path_openat+0x122a/0x32b0 fs/namei.c:3607 do_filp_open+0x192/0x260 fs/namei.c:3637 do_sys_openat2+0x54c/0x740 fs/open.c:1146 do_sys_open+0xc3/0x140 fs/open.c:1162 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 11904: save_stack+0x1b/0x80 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:476 __cache_free mm/slab.c:3426 [inline] kfree+0x109/0x2b0 mm/slab.c:3757 sk_prot_free net/core/sock.c:1640 [inline] __sk_destruct+0x5ad/0x7c0 net/core/sock.c:1724 sk_destruct+0xc6/0x100 net/core/sock.c:1739 __sk_free+0xef/0x3d0 net/core/sock.c:1750 sk_free+0x78/0xa0 net/core/sock.c:1761 sock_put include/net/sock.h:1744 [inline] __tun_detach+0xbce/0x1120 drivers/net/tun.c:728 tun_detach drivers/net/tun.c:740 [inline] tun_chr_close+0x10e/0x180 drivers/net/tun.c:3459 __fput+0x2da/0x850 fs/file_table.c:280 task_work_run+0x13f/0x1b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x2fa/0x360 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath arch/x86/entry/common.c:278 [inline] do_syscall_64+0x6b1/0x7d0 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809366a000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1720 bytes inside of 4096-byte region [ffff88809366a000, ffff88809366b000) The buggy address belongs to the page: page:ffffea00024d9a80 refcount:1 mapcount:0 mapping:ffff8880aa002000 index:0x0 compound_mapcount: 0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea0002539d88 ffffea0002360108 ffff8880aa002000 raw: 0000000000000000 ffff88809366a000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809366a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809366a600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809366a680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809366a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809366a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================