==================================================================
BUG: KASAN: slab-out-of-bounds in memcpy include/linux/fortify-string.h:191 [inline]
BUG: KASAN: slab-out-of-bounds in page_to_skb+0x5cf/0xb70 drivers/net/virtio_net.c:480
Read of size 12 at addr ffff8880147d7800 by task systemd-udevd/6409
CPU: 0 PID: 6409 Comm: systemd-udevd Not tainted 5.12.0-rc8-next-20210420-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:__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 da 3a 44 f8 48 89 ef e8 72 b3 44 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 53 ba 38 f8 65 8b 05 8c 25 ec 76 85 c0 74 0a 5b 5d c3 e8 90 b9
RSP: 0000:ffffc9000350f420 EFLAGS: 00000206
RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff204533a
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffffffff90926bb0 R08: 0000000000000001 R09: ffffffff901f592f
R10: 0000000000000001 R11: 000000000000003f R12: 1ffffffff2124d75
R13: 0000000000000000 R14: dead000000000100 R15: dffffc0000000000
__debug_check_no_obj_freed lib/debugobjects.c:997 [inline]
debug_check_no_obj_freed+0x20c/0x420 lib/debugobjects.c:1018
slab_free_hook mm/slub.c:1568 [inline]
slab_free_freelist_hook+0x174/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_number_perm+0x1d5/0x590 security/tomoyo/file.c:723
tomoyo_path_mknod+0x10d/0x190 security/tomoyo/tomoyo.c:240
security_path_mknod+0xf9/0x170 security/security.c:1131
may_o_create fs/namei.c:3036 [inline]
lookup_open.isra.0+0x475/0x13d0 fs/namei.c:3178
open_last_lookups fs/namei.c:3285 [inline]
path_openat+0x9af/0x27d0 fs/namei.c:3491
do_filp_open+0x190/0x3d0 fs/namei.c:3521
do_sys_openat2+0x16d/0x420 fs/open.c:1187
do_sys_open fs/open.c:1203 [inline]
__do_sys_open fs/open.c:1211 [inline]
__se_sys_open fs/open.c:1207 [inline]
__x64_sys_open+0x119/0x1c0 fs/open.c:1207
do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f0b763776f0
Code: 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d 19 30 2c 00 00 75 10 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 fe 9d 01 00 48 89 04 24
RSP: 002b:00007ffcff6c6b88 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0b763776f0
RDX: 0000000000000180 RSI: 00000000000800c2 RDI: 000055be24e6d2f0
RBP: 000000000003a2f8 R08: 000000000000fec0 R09: 0000000000000030
R10: 0000000000000000 R11: 0000000000000246 R12: 000055be24e6d306
R13: 8421084210842109 R14: 00000000000800c2 R15: 00007f0b76405540
Allocated by task 6427:
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_slab_alloc+0x84/0xa0 mm/kasan/common.c:461
kasan_slab_alloc include/linux/kasan.h:236 [inline]
slab_post_alloc_hook mm/slab.h:527 [inline]
slab_alloc_node mm/slub.c:2924 [inline]
slab_alloc mm/slub.c:2932 [inline]
kmem_cache_alloc+0x219/0x3a0 mm/slub.c:2937
getname_flags.part.0+0x50/0x4f0 fs/namei.c:138
getname_flags fs/namei.c:2734 [inline]
user_path_at_empty+0xa1/0x100 fs/namei.c:2734
user_path_at include/linux/namei.h:60 [inline]
vfs_statx+0x142/0x390 fs/stat.c:203
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 6427:
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]
kmem_cache_free+0x97/0x750 mm/slub.c:3194
putname+0xe1/0x120 fs/namei.c:259
filename_lookup+0x3c3/0x570 fs/namei.c:2464
user_path_at include/linux/namei.h:60 [inline]
vfs_statx+0x142/0x390 fs/stat.c:203
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 ffff8880147d6600
which belongs to the cache names_cache of size 4096
The buggy address is located 512 bytes to the right of
4096-byte region [ffff8880147d6600, ffff8880147d7600)
The buggy address belongs to the page:
page:ffffea000051f400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x147d0
head:ffffea000051f400 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888140007280
raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8880147d7700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880147d7780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880147d7800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff8880147d7880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880147d7900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
CPU: 0 PID: 6409 Comm: systemd-udevd Tainted: G B 5.12.0-rc8-next-20210420-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:103 [inline]
end_report.cold+0x5a/0x5a mm/kasan/report.c:88
__kasan_report mm/kasan/report.c:426 [inline]
kasan_report.cold+0x6a/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:__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 da 3a 44 f8 48 89 ef e8 72 b3 44 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 53 ba 38 f8 65 8b 05 8c 25 ec 76 85 c0 74 0a 5b 5d c3 e8 90 b9
RSP: 0000:ffffc9000350f420 EFLAGS: 00000206
RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff204533a
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffffffff90926bb0 R08: 0000000000000001 R09: ffffffff901f592f
R10: 0000000000000001 R11: 000000000000003f R12: 1ffffffff2124d75
R13: 0000000000000000 R14: dead000000000100 R15: dffffc0000000000
__debug_check_no_obj_freed lib/debugobjects.c:997 [inline]
debug_check_no_obj_freed+0x20c/0x420 lib/debugobjects.c:1018
slab_free_hook mm/slub.c:1568 [inline]
slab_free_freelist_hook+0x174/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_number_perm+0x1d5/0x590 security/tomoyo/file.c:723
tomoyo_path_mknod+0x10d/0x190 security/tomoyo/tomoyo.c:240
security_path_mknod+0xf9/0x170 security/security.c:1131
may_o_create fs/namei.c:3036 [inline]
lookup_open.isra.0+0x475/0x13d0 fs/namei.c:3178
open_last_lookups fs/namei.c:3285 [inline]
path_openat+0x9af/0x27d0 fs/namei.c:3491
do_filp_open+0x190/0x3d0 fs/namei.c:3521
do_sys_openat2+0x16d/0x420 fs/open.c:1187
do_sys_open fs/open.c:1203 [inline]
__do_sys_open fs/open.c:1211 [inline]
__se_sys_open fs/open.c:1207 [inline]
__x64_sys_open+0x119/0x1c0 fs/open.c:1207
do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f0b763776f0
Code: 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d 19 30 2c 00 00 75 10 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 fe 9d 01 00 48 89 04 24
RSP: 002b:00007ffcff6c6b88 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0b763776f0
RDX: 0000000000000180 RSI: 00000000000800c2 RDI: 000055be24e6d2f0
RBP: 000000000003a2f8 R08: 000000000000fec0 R09: 0000000000000030
R10: 0000000000000000 R11: 0000000000000246 R12: 000055be24e6d306
R13: 8421084210842109 R14: 00000000000800c2 R15: 00007f0b76405540
Kernel Offset: disabled
Rebooting in 86400 seconds..