================================================================== BUG: KASAN: use-after-free in free_netdev+0x186/0x380 net/core/dev.c:9911 Read of size 8 at addr ffff8880a28cc6f8 by task syz-executor933/7277 CPU: 0 PID: 7277 Comm: syz-executor933 Not tainted 5.7.0-rc5-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+0x1e9/0x30e lib/dump_stack.c:118 print_address_description+0x74/0x5c0 mm/kasan/report.c:382 __kasan_report+0x103/0x1a0 mm/kasan/report.c:511 kasan_report+0x4d/0x80 mm/kasan/common.c:625 Allocated by task 7274: save_stack mm/kasan/common.c:49 [inline] set_track mm/kasan/common.c:57 [inline] __kasan_kmalloc+0x114/0x160 mm/kasan/common.c:495 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x24b/0x330 mm/slab.c:3665 kmalloc include/linux/slab.h:560 [inline] sk_prot_alloc+0xa7/0x2b0 net/core/sock.c:1604 sk_alloc+0x35/0x990 net/core/sock.c:1658 tun_chr_open+0x77/0x470 drivers/net/tun.c:3377 misc_open+0x346/0x3c0 drivers/char/misc.c:141 chrdev_open+0x498/0x580 fs/char_dev.c:414 do_dentry_open+0x82e/0x10b0 fs/open.c:797 do_open fs/namei.c:3229 [inline] path_openat+0x2790/0x38b0 fs/namei.c:3346 do_filp_open+0x191/0x3a0 fs/namei.c:3373 do_sys_openat2+0x463/0x770 fs/open.c:1148 do_sys_open fs/open.c:1164 [inline] __do_sys_openat fs/open.c:1178 [inline] __se_sys_openat fs/open.c:1173 [inline] __x64_sys_openat+0x1c8/0x1f0 fs/open.c:1173 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 7275: save_stack mm/kasan/common.c:49 [inline] set_track mm/kasan/common.c:57 [inline] kasan_set_free_info mm/kasan/common.c:317 [inline] __kasan_slab_free+0x125/0x190 mm/kasan/common.c:456 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 sk_prot_free net/core/sock.c:1641 [inline] __sk_destruct+0x61d/0x740 net/core/sock.c:1725 tun_detach drivers/net/tun.c:707 [inline] tun_chr_close+0x113/0x130 drivers/net/tun.c:3413 __fput+0x2ed/0x750 fs/file_table.c:280 task_work_run+0x147/0x1d0 kernel/task_work.c:123 get_signal+0x1cae/0x1d60 kernel/signal.c:2533 do_signal+0x33/0x610 arch/x86/kernel/signal.c:784 exit_to_usermode_loop arch/x86/entry/common.c:161 [inline] prepare_exit_to_usermode+0x32a/0x600 arch/x86/entry/common.c:196 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff8880a28cc000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1784 bytes inside of 4096-byte region [ffff8880a28cc000, ffff8880a28cd000) The buggy address belongs to the page: page:ffffea00028a3300 refcount:1 mapcount:0 mapping:000000000d52f25f index:0x0 head:ffffea00028a3300 order:1 compound_mapcount:0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea00028cd208 ffffea00022fb188 ffff8880aa402000 raw: 0000000000000000 ffff8880a28cc000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a28cc580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a28cc600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a28cc680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a28cc700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a28cc780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================