================================================================== 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 ffff88802ad2f800 by task ifupdown-hotplu/8238 CPU: 1 PID: 8238 Comm: ifupdown-hotplu 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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:191 Code: 74 24 10 e8 aa dd 4d f8 48 89 ef e8 e2 93 4e f8 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 c3 61 42 f8 65 8b 05 8c 27 f6 76 85 c0 74 0a 5b 5d c3 e8 30 1d RSP: 0018:ffffc9000c27fa48 EFLAGS: 00000206 RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff1f5c2c2 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001 RBP: ffff88801a664190 R08: 0000000000000001 R09: ffffffff8fad48c7 R10: 0000000000000001 R11: 0000000000000001 R12: ffff8880b9d35280 R13: 0000000000000206 R14: ffff88801a664190 R15: ffff8880b9d35298 try_to_wake_up+0x62d/0x14a0 kernel/sched/core.c:3466 wake_up_process kernel/sched/core.c:3533 [inline] wake_up_q+0x96/0x100 kernel/sched/core.c:587 rwsem_wake kernel/locking/rwsem.c:1179 [inline] __up_write kernel/locking/rwsem.c:1322 [inline] up_write+0x241/0x560 kernel/locking/rwsem.c:1459 i_mmap_unlock_write include/linux/fs.h:505 [inline] __vma_adjust+0xf24/0x25f0 mm/mmap.c:942 vma_adjust include/linux/mm.h:2505 [inline] __split_vma+0x467/0x550 mm/mmap.c:2764 split_vma+0x9f/0xe0 mm/mmap.c:2796 mprotect_fixup+0x678/0x940 mm/mprotect.c:467 do_mprotect_pkey+0x5c7/0xa50 mm/mprotect.c:626 __do_sys_mprotect mm/mprotect.c:652 [inline] __se_sys_mprotect mm/mprotect.c:649 [inline] __x64_sys_mprotect+0x74/0xb0 mm/mprotect.c:649 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fe1563943a7 Code: ff 66 90 b8 0b 00 00 00 0f 05 48 3d 01 f0 ff ff 73 01 c3 48 8d 0d 89 bd 20 00 f7 d8 89 01 48 83 c8 ff c3 b8 0a 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8d 0d 69 bd 20 00 f7 d8 89 01 48 83 RSP: 002b:00007ffc1f5d3f88 EFLAGS: 00000206 ORIG_RAX: 000000000000000a RAX: ffffffffffffffda RBX: 00007fe156599000 RCX: 00007fe1563943a7 RDX: 0000000000000000 RSI: 0000000000200000 RDI: 00007fe156171000 RBP: 00007ffc1f5d42c0 R08: 0000000000000003 R09: 0000000000000000 R10: 00007ffc1f5d3f90 R11: 0000000000000206 R12: 00007ffc1f5d43a8 R13: 0000000000000002 R14: 0000000000000801 R15: 00007ffc1f5d4360 Allocated by task 8245: 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:554 [inline] tomoyo_print_header security/tomoyo/audit.c:156 [inline] tomoyo_init_log+0x18a/0x1ee0 security/tomoyo/audit.c:255 tomoyo_supervisor+0x34d/0xf00 security/tomoyo/common.c:2097 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x419/0x590 security/tomoyo/file.c:734 security_file_ioctl+0x50/0xb0 security/security.c:1495 __do_sys_ioctl fs/ioctl.c:747 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0xb3/0x200 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 8245: 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_init_log+0x14f7/0x1ee0 security/tomoyo/audit.c:294 tomoyo_supervisor+0x34d/0xf00 security/tomoyo/common.c:2097 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x419/0x590 security/tomoyo/file.c:734 security_file_ioctl+0x50/0xb0 security/security.c:1495 __do_sys_ioctl fs/ioctl.c:747 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0xb3/0x200 fs/ioctl.c:739 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 ffff88802ad2e000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2048 bytes to the right of 4096-byte region [ffff88802ad2e000, ffff88802ad2f000) The buggy address belongs to the page: page:ffffea0000ab4a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2ad28 head:ffffea0000ab4a00 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: ffff88802ad2f700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802ad2f780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802ad2f800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802ad2f880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802ad2f900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================