================================================================== BUG: KASAN: use-after-free in memcpy include/linux/fortify-string.h:191 [inline] BUG: KASAN: use-after-free in page_to_skb+0x5cf/0xb70 drivers/net/virtio_net.c:480 Read of size 12 at addr ffff88801445f800 by task (ate-utmp)/8353 CPU: 0 PID: 8353 Comm: (ate-utmp) Not tainted 5.12.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 check_region_inline mm/kasan/generic.c:180 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:186 memcpy+0x20/0x60 mm/kasan/shadow.c:65 memcpy include/linux/fortify-string.h:191 [inline] page_to_skb+0x5cf/0xb70 drivers/net/virtio_net.c:480 receive_mergeable drivers/net/virtio_net.c:1009 [inline] receive_buf+0x2b82/0x6220 drivers/net/virtio_net.c:1119 virtnet_receive drivers/net/virtio_net.c:1411 [inline] virtnet_poll+0x568/0x10b0 drivers/net/virtio_net.c:1516 __napi_poll+0xaf/0x440 net/core/dev.c:6962 napi_poll net/core/dev.c:7029 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:7116 __do_softirq+0x29b/0x9f6 kernel/softirq.c:345 invoke_softirq kernel/softirq.c:221 [inline] __irq_exit_rcu kernel/softirq.c:422 [inline] irq_exit_rcu+0x134/0x200 kernel/softirq.c:434 common_interrupt+0xa4/0xd0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:623 RIP: 0010:lock_is_held_type+0xfd/0x140 kernel/locking/lockdep.c:5555 Code: 00 00 b8 ff ff ff ff 65 0f c1 05 fe cc f8 76 83 f8 01 75 29 9c 58 f6 c4 02 75 3d 48 f7 04 24 00 02 00 00 74 01 fb 48 83 c4 08 <44> 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 45 31 ed eb b9 0f 0b 48 RSP: 0018:ffffc90000edf848 EFLAGS: 00000286 RAX: 0000000000000046 RBX: 0000000000000002 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffffff8bf744c0 R08: 0000000000000001 R09: ffffffff8fad393f R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880120454c0 R13: 0000000000000000 R14: 00000000ffffffff R15: ffff888012045ed8 lock_is_held include/linux/lockdep.h:278 [inline] ___might_sleep+0x202/0x2c0 kernel/sched/core.c:8294 down_write+0x6e/0x150 kernel/locking/rwsem.c:1405 i_mmap_lock_write include/linux/fs.h:495 [inline] unlink_file_vma+0x82/0x1c0 mm/mmap.c:165 free_pgtables+0x1b3/0x2f0 mm/memory.c:428 exit_mmap+0x2b7/0x590 mm/mmap.c:3219 __mmput+0x122/0x470 kernel/fork.c:1092 mmput+0x58/0x60 kernel/fork.c:1113 exec_mmap fs/exec.c:1031 [inline] begin_new_exec+0xea7/0x2c40 fs/exec.c:1287 load_elf_binary+0x159d/0x4b40 fs/binfmt_elf.c:1001 search_binary_handler fs/exec.c:1720 [inline] exec_binprm fs/exec.c:1761 [inline] bprm_execve fs/exec.c:1830 [inline] bprm_execve+0x821/0x19a0 fs/exec.c:1792 do_execveat_common+0x626/0x7c0 fs/exec.c:1919 do_execve fs/exec.c:1987 [inline] __do_sys_execve fs/exec.c:2063 [inline] __se_sys_execve fs/exec.c:2058 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:2058 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f05e3e3d647 Code: Unable to access opcode bytes at RIP 0x7f05e3e3d61d. RSP: 002b:00007ffc68cf27b8 EFLAGS: 00000246 ORIG_RAX: 000000000000003b RAX: ffffffffffffffda RBX: 0000561d33d86670 RCX: 00007f05e3e3d647 RDX: 0000561d33d81500 RSI: 0000561d33da6550 RDI: 0000561d33d8b4e0 RBP: 00007ffc68cf2920 R08: 0000000000000000 R09: 0000000000000020 R10: 0000561d33d8b340 R11: 0000000000000246 R12: 0000561d33d8ba98 R13: 0000000000000000 R14: 0000561d33da6550 R15: 00007ffc68cf2a00 Allocated by task 1: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] ____kasan_kmalloc mm/kasan/common.c:506 [inline] ____kasan_kmalloc mm/kasan/common.c:465 [inline] __kasan_kmalloc+0x99/0xc0 mm/kasan/common.c:515 kmalloc include/linux/slab.h:559 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xcf/0x140 security/security.c:1288 vfs_getattr fs/stat.c:131 [inline] vfs_fstat+0x43/0xb0 fs/stat.c:156 __do_sys_newfstat+0x81/0x100 fs/stat.c:396 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 1: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xf5/0x130 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:1562 [inline] slab_free_freelist_hook+0x92/0x210 mm/slub.c:1600 slab_free mm/slub.c:3161 [inline] kfree+0xe5/0x7f0 mm/slub.c:4213 tomoyo_realpath_from_path+0x191/0x620 security/tomoyo/realpath.c:291 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xcf/0x140 security/security.c:1288 vfs_getattr fs/stat.c:131 [inline] vfs_fstat+0x43/0xb0 fs/stat.c:156 __do_sys_newfstat+0x81/0x100 fs/stat.c:396 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88801445e000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2048 bytes to the right of 4096-byte region [ffff88801445e000, ffff88801445f000) The buggy address belongs to the page: page:ffffea0000511600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14458 head:ffffea0000511600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010842140 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801445f700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801445f780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801445f800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801445f880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801445f900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== CPU: 0 PID: 8353 Comm: (ate-utmp) Tainted: G B 5.12.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 panic+0x306/0x73d kernel/panic.c:231 end_report mm/kasan/report.c:102 [inline] end_report.cold+0x5a/0x5a mm/kasan/report.c:88 __kasan_report mm/kasan/report.c:406 [inline] kasan_report.cold+0x6a/0xd8 mm/kasan/report.c:416 check_region_inline mm/kasan/generic.c:180 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:186 memcpy+0x20/0x60 mm/kasan/shadow.c:65 memcpy include/linux/fortify-string.h:191 [inline] page_to_skb+0x5cf/0xb70 drivers/net/virtio_net.c:480 receive_mergeable drivers/net/virtio_net.c:1009 [inline] receive_buf+0x2b82/0x6220 drivers/net/virtio_net.c:1119 virtnet_receive drivers/net/virtio_net.c:1411 [inline] virtnet_poll+0x568/0x10b0 drivers/net/virtio_net.c:1516 __napi_poll+0xaf/0x440 net/core/dev.c:6962 napi_poll net/core/dev.c:7029 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:7116 __do_softirq+0x29b/0x9f6 kernel/softirq.c:345 invoke_softirq kernel/softirq.c:221 [inline] __irq_exit_rcu kernel/softirq.c:422 [inline] irq_exit_rcu+0x134/0x200 kernel/softirq.c:434 common_interrupt+0xa4/0xd0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:623 RIP: 0010:lock_is_held_type+0xfd/0x140 kernel/locking/lockdep.c:5555 Code: 00 00 b8 ff ff ff ff 65 0f c1 05 fe cc f8 76 83 f8 01 75 29 9c 58 f6 c4 02 75 3d 48 f7 04 24 00 02 00 00 74 01 fb 48 83 c4 08 <44> 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 45 31 ed eb b9 0f 0b 48 RSP: 0018:ffffc90000edf848 EFLAGS: 00000286 RAX: 0000000000000046 RBX: 0000000000000002 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffffff8bf744c0 R08: 0000000000000001 R09: ffffffff8fad393f R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880120454c0 R13: 0000000000000000 R14: 00000000ffffffff R15: ffff888012045ed8 lock_is_held include/linux/lockdep.h:278 [inline] ___might_sleep+0x202/0x2c0 kernel/sched/core.c:8294 down_write+0x6e/0x150 kernel/locking/rwsem.c:1405 i_mmap_lock_write include/linux/fs.h:495 [inline] unlink_file_vma+0x82/0x1c0 mm/mmap.c:165 free_pgtables+0x1b3/0x2f0 mm/memory.c:428 exit_mmap+0x2b7/0x590 mm/mmap.c:3219 __mmput+0x122/0x470 kernel/fork.c:1092 mmput+0x58/0x60 kernel/fork.c:1113 exec_mmap fs/exec.c:1031 [inline] begin_new_exec+0xea7/0x2c40 fs/exec.c:1287 load_elf_binary+0x159d/0x4b40 fs/binfmt_elf.c:1001 search_binary_handler fs/exec.c:1720 [inline] exec_binprm fs/exec.c:1761 [inline] bprm_execve fs/exec.c:1830 [inline] bprm_execve+0x821/0x19a0 fs/exec.c:1792 do_execveat_common+0x626/0x7c0 fs/exec.c:1919 do_execve fs/exec.c:1987 [inline] __do_sys_execve fs/exec.c:2063 [inline] __se_sys_execve fs/exec.c:2058 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:2058 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f05e3e3d647 Code: Unable to access opcode bytes at RIP 0x7f05e3e3d61d. RSP: 002b:00007ffc68cf27b8 EFLAGS: 00000246 ORIG_RAX: 000000000000003b RAX: ffffffffffffffda RBX: 0000561d33d86670 RCX: 00007f05e3e3d647 RDX: 0000561d33d81500 RSI: 0000561d33da6550 RDI: 0000561d33d8b4e0 RBP: 00007ffc68cf2920 R08: 0000000000000000 R09: 0000000000000020 R10: 0000561d33d8b340 R11: 0000000000000246 R12: 0000561d33d8ba98 R13: 0000000000000000 R14: 0000561d33da6550 R15: 00007ffc68cf2a00 Kernel Offset: disabled Rebooting in 86400 seconds..