================================================================== BUG: KASAN: stack-out-of-bounds in fb_write_offset drivers/video/fbdev/core/sysmem.h:30 [inline] BUG: KASAN: stack-out-of-bounds in fb_bitmap_2ppw drivers/video/fbdev/core/fb_imageblit.h:366 [inline] BUG: KASAN: stack-out-of-bounds in fb_bitmap_imageblit drivers/video/fbdev/core/fb_imageblit.h:462 [inline] BUG: KASAN: stack-out-of-bounds in fb_imageblit drivers/video/fbdev/core/fb_imageblit.h:492 [inline] BUG: KASAN: stack-out-of-bounds in sys_imageblit+0x1ab8/0x1e60 drivers/video/fbdev/core/sysimgblt.c:22 Write of size 8 at addr ffffc900051efc30 by task syz.4.1026/10083 CPU: 3 UID: 0 PID: 10083 Comm: syz.4.1026 Not tainted 6.16.0-rc5-syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xcd/0x680 mm/kasan/report.c:521 kasan_report+0xe0/0x110 mm/kasan/report.c:634 fb_write_offset drivers/video/fbdev/core/sysmem.h:30 [inline] fb_bitmap_2ppw drivers/video/fbdev/core/fb_imageblit.h:366 [inline] fb_bitmap_imageblit drivers/video/fbdev/core/fb_imageblit.h:462 [inline] fb_imageblit drivers/video/fbdev/core/fb_imageblit.h:492 [inline] sys_imageblit+0x1ab8/0x1e60 drivers/video/fbdev/core/sysimgblt.c:22 drm_fbdev_shmem_defio_imageblit+0x20/0x130 drivers/gpu/drm/drm_fbdev_shmem.c:37 bit_putcs_unaligned drivers/video/fbdev/core/bitblit.c:138 [inline] bit_putcs+0x912/0xde0 drivers/video/fbdev/core/bitblit.c:187 fbcon_putcs+0x380/0x4a0 drivers/video/fbdev/core/fbcon.c:1314 do_update_region+0x2e9/0x3f0 drivers/tty/vt/vt.c:627 invert_screen+0x1e4/0x590 drivers/tty/vt/vt.c:748 highlight drivers/tty/vt/selection.c:57 [inline] clear_selection drivers/tty/vt/selection.c:87 [inline] clear_selection+0x59/0x70 drivers/tty/vt/selection.c:83 vc_do_resize+0xd9b/0x10e0 drivers/tty/vt/vt.c:1195 vc_resize include/linux/vt_kern.h:49 [inline] fbcon_set_disp+0x7ad/0xe40 drivers/video/fbdev/core/fbcon.c:1415 con2fb_init_display drivers/video/fbdev/core/fbcon.c:816 [inline] set_con2fb_map+0x703/0x1060 drivers/video/fbdev/core/fbcon.c:889 fbcon_set_con2fb_map_ioctl+0x16c/0x220 drivers/video/fbdev/core/fbcon.c:3118 do_fb_ioctl+0x328/0x7e0 drivers/video/fbdev/core/fb_chrdev.c:138 fb_ioctl+0xe5/0x150 drivers/video/fbdev/core/fb_chrdev.c:169 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb75498e929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb7557d9038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fb754bb6160 RCX: 00007fb75498e929 RDX: 0000200000000180 RSI: 0000000000004610 RDI: 0000000000000007 RBP: 00007fb754a10b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fb754bb6160 R15: 00007fff73f25fa8 The buggy address belongs to the virtual mapping at [ffffc900051e8000, ffffc900051f1000) created by: kernel_clone+0xfc/0x960 kernel/fork.c:2599 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2474a flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_ZERO|__GFP_NOWARN), pid 219, tgid 219 (kworker/u32:6), ts 7741127099, free_ts 7654981517 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x1321/0x3890 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:4959 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2419 alloc_frozen_pages_noprof mm/mempolicy.c:2490 [inline] alloc_pages_noprof+0x131/0x390 mm/mempolicy.c:2510 vm_area_alloc_pages mm/vmalloc.c:3634 [inline] __vmalloc_area_node mm/vmalloc.c:3712 [inline] __vmalloc_node_range_noprof+0x72f/0x14b0 mm/vmalloc.c:3885 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:3948 alloc_thread_stack_node kernel/fork.c:317 [inline] dup_task_struct kernel/fork.c:877 [inline] copy_process+0x2c70/0x7650 kernel/fork.c:1999 kernel_clone+0xfc/0x960 kernel/fork.c:2599 user_mode_thread+0xc7/0x110 kernel/fork.c:2677 call_usermodehelper_exec_work kernel/umh.c:171 [inline] call_usermodehelper_exec_work+0xcb/0x170 kernel/umh.c:157 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3321 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402 kthread+0x3c5/0x780 kernel/kthread.c:464 ret_from_fork+0x5d4/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page last free pid 54 tgid 54 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] __free_frozen_pages+0x7fe/0x1180 mm/page_alloc.c:2706 vfree+0x1fd/0xb50 mm/vmalloc.c:3426 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:3345 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3321 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3402 kthread+0x3c5/0x780 kernel/kthread.c:464 ret_from_fork+0x5d4/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffffc900051efb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900051efb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc900051efc00: 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1 04 f2 00 00 ^ ffffc900051efc80: f2 f2 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 ffffc900051efd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================