==================================================================
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 ffff888013e67800 by task systemd-udevd/8388
CPU: 0 PID: 8388 Comm: systemd-udevd Not tainted 5.12.0-rc8-next-20210419-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:233
__kasan_report mm/kasan/report.c:419 [inline]
kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436
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+0x2bc0/0x6250 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/0x9fe kernel/softirq.c:559
invoke_softirq kernel/softirq.c:433 [inline]
__irq_exit_rcu+0x136/0x200 kernel/softirq.c:637
irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
common_interrupt+0xa4/0xd0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:623
RIP: 0010:instrument_atomic_read include/linux/instrumented.h:71 [inline]
RIP: 0010:atomic_read include/asm-generic/atomic-instrumented.h:27 [inline]
RIP: 0010:lock_page_memcg+0x1bf/0x7d0 mm/memcontrol.c:1997
Code: 16 bf 81 58 e8 a2 fa 9a ff 4d 85 ed 0f 85 a7 03 00 00 9c 58 f6 c4 02 0f 85 fc 03 00 00 4d 85 ed 74 01 fb 4c 8d ab 80 10 00 00 04 00 00 00 4c 89 ef e8 f4 31 fa ff 4c 89 e8 48 be 00 00 00 00
RSP: 0018:ffffc90000f0f680 EFLAGS: 00000206
RAX: 0000000000000002 RBX: ffff888011f14000 RCX: 1ffffffff1fbf6f2
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc90000f0f6c8 R08: 0000000000000001 R09: ffffffff8fdf48b7
R10: 0000000000000001 R11: 0000000000000000 R12: ffffea0000c49308
R13: ffff888011f15080 R14: fffff94000189261 R15: ffffea0000c49300
page_remove_rmap+0x25/0x1430 mm/rmap.c:1348
zap_pte_range mm/memory.c:1270 [inline]
zap_pmd_range mm/memory.c:1374 [inline]
zap_pud_range mm/memory.c:1403 [inline]
zap_p4d_range mm/memory.c:1424 [inline]
unmap_page_range+0xe30/0x2650 mm/memory.c:1445
unmap_single_vma+0x198/0x300 mm/memory.c:1490
unmap_vmas+0x16d/0x2f0 mm/memory.c:1522
exit_mmap+0x2a8/0x590 mm/mmap.c:3207
__mmput+0x122/0x470 kernel/fork.c:1095
mmput+0x58/0x60 kernel/fork.c:1116
exec_mmap fs/exec.c:1031 [inline]
begin_new_exec+0xea9/0x2c40 fs/exec.c:1287
load_elf_binary+0x159d/0x4b30 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+0x7ef/0x19b0 fs/exec.c:1792
do_execveat_common+0x621/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+0x3a/0xb0 arch/x86/entry/common.c:47
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fac2795d647
Code: Unable to access opcode bytes at RIP 0x7fac2795d61d.
RSP: 002b:00007ffd2d635af8 EFLAGS: 00000207 ORIG_RAX: 000000000000003b
RAX: ffffffffffffffda RBX: 00007ffd2d636040 RCX: 00007fac2795d647
RDX: 000056379776dfd0 RSI: 00007ffd2d636040 RDI: 00007ffd2d635c40
RBP: 000000000000000f R08: 000000000000feff R09: 0000000000000070
R10: 0000000000000008 R11: 0000000000000207 R12: 00007ffd2d635bc0
R13: 0000000000000012 R14: 000056379776dfd0 R15: 00007ffd2d637610
Allocated by task 8378:
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:428 [inline]
____kasan_kmalloc mm/kasan/common.c:507 [inline]
____kasan_kmalloc mm/kasan/common.c:466 [inline]
__kasan_kmalloc+0x9b/0xd0 mm/kasan/common.c:516
kmalloc include/linux/slab.h:563 [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:1332
vfs_getattr fs/stat.c:139 [inline]
vfs_statx+0x164/0x390 fs/stat.c:207
vfs_fstatat fs/stat.c:225 [inline]
vfs_lstat include/linux/fs.h:3384 [inline]
__do_sys_newlstat+0x91/0x110 fs/stat.c:380
do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
entry_SYSCALL_64_after_hwframe+0x44/0xae
Freed by task 8378:
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+0xfb/0x130 mm/kasan/common.c:368
kasan_slab_free include/linux/kasan.h:212 [inline]
slab_free_hook mm/slub.c:1593 [inline]
slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1618
slab_free mm/slub.c:3178 [inline]
kfree+0xe5/0x7f0 mm/slub.c:4245
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:1332
vfs_getattr fs/stat.c:139 [inline]
vfs_statx+0x164/0x390 fs/stat.c:207
vfs_fstatat fs/stat.c:225 [inline]
vfs_lstat include/linux/fs.h:3384 [inline]
__do_sys_newlstat+0x91/0x110 fs/stat.c:380
do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
entry_SYSCALL_64_after_hwframe+0x44/0xae
The buggy address belongs to the object at ffff888013e66000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 2048 bytes to the right of
4096-byte region [ffff888013e66000, ffff888013e67000)
The buggy address belongs to the page:
page:ffffea00004f9800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13e60
head:ffffea00004f9800 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010c42140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888013e67700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888013e67780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888013e67800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888013e67880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888013e67900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================