================================================================== 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 ffff88802b5bf800 by task systemd-udevd/6422 CPU: 1 PID: 6422 Comm: systemd-udevd 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:tomoyo_check_acl+0xc1/0x450 security/tomoyo/domain.c:173 Code: f5 28 e2 fd 48 8d 7b 18 48 89 f8 48 89 fa 48 c1 e8 03 83 e2 07 0f b6 04 28 38 d0 7f 08 84 c0 0f 85 f7 02 00 00 44 0f b6 73 18 <31> ff 44 89 f6 e8 75 2f e2 fd 45 84 f6 0f 85 61 01 00 00 e8 b7 28 RSP: 0018:ffffc900058cf5a0 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffff888144ae0000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff8391cd6b RDI: ffff888144ae0018 RBP: dffffc0000000000 R08: 0000000000000000 R09: 0000000000000002 R10: ffffffff8391cdf1 R11: 0000000000000000 R12: ffffc900058cf668 R13: ffff888015623d10 R14: 0000000000000000 R15: 0000000000000002 tomoyo_path_number_perm+0x32a/0x590 security/tomoyo/file.c:733 tomoyo_path_mknod+0x10d/0x190 security/tomoyo/tomoyo.c:240 security_path_mknod+0xf9/0x170 security/security.c:1087 may_o_create fs/namei.c:3040 [inline] lookup_open.isra.0+0x475/0x13d0 fs/namei.c:3184 open_last_lookups fs/namei.c:3291 [inline] path_openat+0x9b4/0x27e0 fs/namei.c:3497 do_filp_open+0x190/0x3d0 fs/namei.c:3527 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+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f0600a926f0 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:00007ffd2af724c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0600a926f0 RDX: 0000000000000180 RSI: 00000000000800c2 RDI: 000055c872390620 RBP: 000000000003a2f8 R08: 000000000000fefe R09: 0000000000000030 R10: 0000000000000000 R11: 0000000000000246 R12: 000055c872390635 R13: 8421084210842109 R14: 00000000000800c2 R15: 00007f0600b20540 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 ffff88802b5be000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2048 bytes to the right of 4096-byte region [ffff88802b5be000, ffff88802b5bf000) The buggy address belongs to the page: page:ffffea0000ad6e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2b5b8 head:ffffea0000ad6e00 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: ffff88802b5bf700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802b5bf780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802b5bf800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802b5bf880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802b5bf900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================