================================================================== 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 bitfill drivers/video/fbdev/core/fb_fillrect.h:143 [inline] BUG: KASAN: stack-out-of-bounds in fb_fillrect_static drivers/video/fbdev/core/fb_fillrect.h:219 [inline] BUG: KASAN: stack-out-of-bounds in fb_fillrect drivers/video/fbdev/core/fb_fillrect.h:278 [inline] BUG: KASAN: stack-out-of-bounds in sys_fillrect+0x176e/0x1910 drivers/video/fbdev/core/sysfillrect.c:24 Write of size 8 at addr ffffc90004a67c68 by task syz.4.3208/17025 CPU: 2 UID: 0 PID: 17025 Comm: syz.4.3208 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP 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 fb_write_offset drivers/video/fbdev/core/sysmem.h:30 [inline] bitfill drivers/video/fbdev/core/fb_fillrect.h:143 [inline] fb_fillrect_static drivers/video/fbdev/core/fb_fillrect.h:219 [inline] fb_fillrect drivers/video/fbdev/core/fb_fillrect.h:278 [inline] sys_fillrect+0x176e/0x1910 drivers/video/fbdev/core/sysfillrect.c:24 drm_fbdev_shmem_defio_fillrect+0x22/0x140 drivers/gpu/drm/drm_fbdev_shmem.c:39 bit_clear+0x17d/0x220 drivers/video/fbdev/core/bitblit.c:73 __fbcon_clear+0x633/0x760 drivers/video/fbdev/core/fbcon.c:1387 fbcon_scroll+0x48b/0x650 drivers/video/fbdev/core/fbcon.c:1939 con_scroll+0x464/0x690 drivers/tty/vt/vt.c:730 csi_M drivers/tty/vt/vt.c:2309 [inline] csi_ECMA.constprop.0+0x1238/0x3b80 drivers/tty/vt/vt.c:2732 do_con_trol drivers/tty/vt/vt.c:2947 [inline] do_con_write+0x366b/0x4b10 drivers/tty/vt/vt.c:3444 con_write+0x23/0xb0 drivers/tty/vt/vt.c:3780 process_output_block drivers/tty/n_tty.c:557 [inline] n_tty_write+0x440/0x1200 drivers/tty/n_tty.c:2366 iterate_tty_write drivers/tty/tty_io.c:1008 [inline] file_tty_write.isra.0+0x4ca/0x8f0 drivers/tty/tty_io.c:1056 new_sync_write fs/read_write.c:575 [inline] vfs_write+0x6af/0x1040 fs/read_write.c:667 ksys_write+0x12a/0x250 fs/read_write.c:719 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x14d/0x8e0 arch/x86/entry/syscall_32.c:286 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:311 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf6fcefbc Code: d2 74 05 c1 e8 0c 89 02 8b 5d fc 31 c0 c9 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 2e 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 58 b8 RSP: 002b:00000000f53bd50c EFLAGS: 00000292 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000009 RCX: 00000000800071c0 RDX: 0000000000001006 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to a 8-page vmalloc region starting at 0xffffc90004a60000 allocated at kernel_clone+0x176/0x9d0 kernel/fork.c:2813 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x2611 pfn:0x56ed7 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000002611 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 0x29c2(GFP_NOWAIT|__GFP_HIGHMEM|__GFP_IO|__GFP_FS|__GFP_ZERO), pid 2, tgid 2 (kthreadd), ts 449355449831 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1873 prep_new_page mm/page_alloc.c:1881 [inline] get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3963 __alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5505 alloc_pages_mpol+0x201/0x560 mm/mempolicy.c:2520 alloc_pages_noprof+0x1a/0x160 mm/mempolicy.c:2611 vm_area_alloc_pages mm/vmalloc.c:3726 [inline] __vmalloc_area_node mm/vmalloc.c:3948 [inline] __vmalloc_node_range_noprof+0x899/0x1440 mm/vmalloc.c:4152 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4213 alloc_thread_stack_node kernel/fork.c:359 [inline] dup_task_struct kernel/fork.c:931 [inline] copy_process+0x80b/0x8880 kernel/fork.c:2150 kernel_clone+0x176/0x9d0 kernel/fork.c:2813 kernel_thread+0xdb/0x120 kernel/fork.c:2874 create_kthread kernel/kthread.c:459 [inline] kthreadd+0x498/0x7a0 kernel/kthread.c:817 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page last free pid 5904 tgid 5904 ts 449327209675 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1415 [inline] free_pages_prepare+0x586/0xe00 mm/page_alloc.c:1460 __free_contig_range_common+0x14f/0x250 mm/page_alloc.c:7136 __free_contig_range mm/page_alloc.c:7181 [inline] free_pages_bulk+0x125/0x1f0 mm/page_alloc.c:5389 vm_area_free_pages+0xb2/0x2a0 mm/vmalloc.c:3498 vfree mm/vmalloc.c:3547 [inline] vfree+0xfc/0x850 mm/vmalloc.c:3521 delayed_vfree_work+0x56/0x80 mm/vmalloc.c:3451 process_one_work+0xaeb/0x1b40 kernel/workqueue.c:3497 process_scheduled_works kernel/workqueue.c:3580 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3661 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffffc90004a67b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90004a67b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90004a67c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 ^ ffffc90004a67c80: f1 00 00 f3 f3 00 00 00 00 00 00 00 00 00 00 00 ffffc90004a67d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: d2 74 05 c1 shlb %cl,-0x3f(%rbp,%rax,1) 4: e8 0c 89 02 8b call 0x8b028915 9: 5d pop %rbp a: fc cld b: 31 c0 xor %eax,%eax d: c9 leave e: c3 ret f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 90 nop 15: 90 nop 16: 90 nop 17: 90 nop 18: 90 nop 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 0f 1f 00 nopl (%rax) 21: 51 push %rcx 22: 52 push %rdx 23: 55 push %rbp 24: 89 e5 mov %esp,%ebp 26: 0f 34 sysenter 28: cd 80 int $0x80 * 2a: 5d pop %rbp <-- trapping instruction 2b: 5a pop %rdx 2c: 59 pop %rcx 2d: c3 ret 2e: 90 nop 2f: 2e 8d b4 26 00 00 00 cs lea 0x0(%rsi,%riz,1),%esi 36: 00 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 3e: 58 pop %rax 3f: b8 .byte 0xb8