================================================================== BUG: KASAN: slab-out-of-bounds in soft_cursor+0x458/0xa10 drivers/video/fbdev/core/softcursor.c:70 Read of size 92 at addr ffff88805acc5ee4 by task syz.6.4622/22278 CPU: 0 UID: 0 PID: 22278 Comm: syz.6.4622 Tainted: G L N syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP, [N]=TEST Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:186 [inline] kasan_check_range+0x10f/0x1e0 mm/kasan/generic.c:200 __asan_memcpy+0x23/0x60 mm/kasan/shadow.c:105 soft_cursor+0x458/0xa10 drivers/video/fbdev/core/softcursor.c:70 cw_cursor+0xd70/0x15b0 drivers/video/fbdev/core/fbcon_cw.c:324 fbcon_cursor+0x43c/0x5e0 drivers/video/fbdev/core/fbcon.c:1427 hide_cursor+0x87/0x230 drivers/tty/vt/vt.c:883 redraw_screen+0x5d4/0x760 drivers/tty/vt/vt.c:985 vc_do_resize+0xc3d/0xeb0 drivers/tty/vt/vt.c:1309 vc_resize include/linux/vt_kern.h:49 [inline] fbcon_do_set_font+0x443/0x8c0 drivers/video/fbdev/core/fbcon.c:2435 fbcon_set_font+0x4be/0x730 drivers/video/fbdev/core/fbcon.c:2518 con_font_set drivers/tty/vt/vt.c:4992 [inline] con_font_op+0x9c0/0x1040 drivers/tty/vt/vt.c:5032 vt_k_ioctl drivers/tty/vt/vt_ioctl.c:472 [inline] vt_ioctl+0xdd1/0x3110 drivers/tty/vt/vt_ioctl.c:743 tty_ioctl+0x26a/0x1640 drivers/tty/tty_io.c:2792 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7fe4f9e0d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7fe5f38028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f7fe5225fa0 RCX: 00007f7fe4f9e0d9 RDX: 0000200000000000 RSI: 0000000000004b72 RDI: 0000000000000007 RBP: 00007f7fe5035024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f7fe5226038 R14: 00007f7fe5225fa0 R15: 00007ffe6728c308 Allocated by task 22222: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x2e5/0x6c0 mm/slub.c:5489 _kmalloc_noprof include/linux/slab.h:988 [inline] _kzalloc_noprof include/linux/slab.h:1309 [inline] kobject_uevent_env+0x263/0x18b0 lib/kobject_uevent.c:543 driver_register+0x29c/0x360 drivers/base/driver.c:182 usb_gadget_register_driver_owner+0x132/0x210 drivers/usb/gadget/udc/core.c:1752 raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:596 [inline] raw_ioctl+0x1a85/0x2b80 drivers/usb/gadget/legacy/raw_gadget.c:1307 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 22222: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2677 [inline] slab_free mm/slub.c:6377 [inline] kfree+0x22b/0x6c0 mm/slub.c:6692 kobject_uevent_env+0x2e2/0x18b0 lib/kobject_uevent.c:643 driver_register+0x29c/0x360 drivers/base/driver.c:182 usb_gadget_register_driver_owner+0x132/0x210 drivers/usb/gadget/udc/core.c:1752 raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:596 [inline] raw_ioctl+0x1a85/0x2b80 drivers/usb/gadget/legacy/raw_gadget.c:1307 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88805acc4000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 3812 bytes to the right of allocated 4096-byte region [ffff88805acc4000, ffff88805acc5000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5acc0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801bc43040 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800040004 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801bc43040 dead000000000100 dead000000000122 head: 0000000000000000 0000000800040004 00000000f5000000 0000000000000000 head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5151, tgid 5151 (udevd), ts 60713775316, free_ts 58585568260 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0xf48/0x3530 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304 alloc_slab_page mm/slub.c:3266 [inline] allocate_slab mm/slub.c:3380 [inline] new_slab+0xa2/0x640 mm/slub.c:3426 refill_objects+0xe3/0x410 mm/slub.c:7310 refill_sheaf mm/slub.c:2804 [inline] __pcs_replace_empty_main+0x376/0x680 mm/slub.c:4675 alloc_from_pcs mm/slub.c:4773 [inline] slab_alloc_node mm/slub.c:4905 [inline] __do_kmalloc_node mm/slub.c:5333 [inline] __kmalloc_noprof+0x66d/0x820 mm/slub.c:5359 _kmalloc_noprof include/linux/slab.h:992 [inline] tomoyo_realpath_from_path+0xb6/0x690 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x2af/0x3c0 security/tomoyo/file.c:776 tomoyo_file_open+0x6b/0x90 security/tomoyo/tomoyo.c:334 security_file_open+0xb5/0x1e0 security/security.c:2739 do_dentry_open+0x588/0x14d0 fs/open.c:924 vfs_open+0x82/0x3f0 fs/open.c:1052 do_open fs/namei.c:4700 [inline] path_openat+0x2873/0x4280 fs/namei.c:4863 do_file_open+0x20e/0x430 fs/namei.c:4892 do_sys_openat2+0x10f/0x1e0 fs/open.c:1368 page last free pid 5927 tgid 5927 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] free_pages_prepare+0x586/0xd80 mm/page_alloc.c:1451 __free_contig_range_common+0x14f/0x250 mm/page_alloc.c:6897 __free_contig_range mm/page_alloc.c:6942 [inline] free_pages_bulk+0xbd/0x200 mm/page_alloc.c:5257 vm_area_free_pages+0xad/0x2b0 mm/vmalloc.c:3439 vfree mm/vmalloc.c:3488 [inline] vfree+0x107/0x750 mm/vmalloc.c:3462 vb2_vmalloc_put drivers/media/common/videobuf2/videobuf2-vmalloc.c:68 [inline] vb2_vmalloc_put+0x80/0xc0 drivers/media/common/videobuf2/videobuf2-vmalloc.c:63 __vb2_buf_mem_free+0x121/0x240 drivers/media/common/videobuf2/videobuf2-core.c:275 __vb2_free_mem drivers/media/common/videobuf2/videobuf2-core.c:571 [inline] __vb2_queue_free+0x7ec/0xa30 drivers/media/common/videobuf2/videobuf2-core.c:599 vb2_core_queue_release+0x70/0x190 drivers/media/common/videobuf2/videobuf2-core.c:2679 v4l2_m2m_ctx_release+0x1e/0x40 drivers/media/v4l2-core/v4l2-mem2mem.c:1285 vicodec_release+0xa0/0x160 drivers/media/test-drivers/vicodec/vicodec-core.c:1947 v4l2_release+0x1cf/0x390 drivers/media/v4l2-core/v4l2-dev.c:468 __fput+0x3ff/0xb50 fs/file_table.c:512 task_work_run+0x150/0x240 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:70 [inline] exit_to_user_mode_loop+0x1d8/0x6f0 kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline] do_syscall_64+0x666/0x870 arch/x86/entry/syscall_64.c:100 Memory state around the buggy address: ffff88805acc5d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805acc5e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805acc5e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88805acc5f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805acc5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================