================================================================== 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:367 [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+0x1dbb/0x1e60 drivers/video/fbdev/core/sysimgblt.c:24 Write of size 8 at addr ffffc900050b7ab8 by task syz.6.2016/11898 CPU: 0 UID: 0 PID: 11898 Comm: syz.6.2016 Not tainted 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:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 fb_write_offset drivers/video/fbdev/core/sysmem.h:30 [inline] fb_bitmap_2ppw drivers/video/fbdev/core/fb_imageblit.h:367 [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+0x1dbb/0x1e60 drivers/video/fbdev/core/sysimgblt.c:24 drm_fbdev_shmem_defio_imageblit+0x20/0x130 drivers/gpu/drm/drm_fbdev_shmem.c:38 bit_putcs_unaligned drivers/video/fbdev/core/bitblit.c:138 [inline] bit_putcs+0x912/0xde0 drivers/video/fbdev/core/bitblit.c:187 fbcon_putcs+0x387/0x450 drivers/video/fbdev/core/fbcon.c:1320 do_update_region+0x2e6/0x3f0 drivers/tty/vt/vt.c:628 invert_screen+0x1e4/0x590 drivers/tty/vt/vt.c:749 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:1196 vc_resize include/linux/vt_kern.h:49 [inline] fbcon_set_disp+0x7ad/0xe50 drivers/video/fbdev/core/fbcon.c:1423 con2fb_init_display drivers/video/fbdev/core/fbcon.c:821 [inline] set_con2fb_map+0x703/0x1080 drivers/video/fbdev/core/fbcon.c:895 fbcon_set_con2fb_map_ioctl+0x16c/0x220 drivers/video/fbdev/core/fbcon.c:3132 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:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18b/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fbf7e78eec9 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:00007fbf7c9ee038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fbf7e9e5fa0 RCX: 00007fbf7e78eec9 RDX: 0000200000000180 RSI: 0000000000004610 RDI: 0000000000000009 RBP: 00007fbf7e811f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fbf7e9e6038 R14: 00007fbf7e9e5fa0 R15: 00007ffc939269a8 The buggy address belongs to a 8-page vmalloc region starting at 0xffffc900050b0000 allocated at kernel_clone+0xfc/0x930 kernel/fork.c:2609 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x32a1b 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 5344, tgid 5344 (udevd), ts 72926521949, free_ts 72415535519 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5183 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline] alloc_pages_noprof+0x131/0x390 mm/mempolicy.c:2507 vm_area_alloc_pages mm/vmalloc.c:3647 [inline] __vmalloc_area_node mm/vmalloc.c:3724 [inline] __vmalloc_node_range_noprof+0x6f8/0x1480 mm/vmalloc.c:3897 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:3960 alloc_thread_stack_node kernel/fork.c:311 [inline] dup_task_struct kernel/fork.c:881 [inline] copy_process+0x2c77/0x76a0 kernel/fork.c:2012 kernel_clone+0xfc/0x930 kernel/fork.c:2609 __do_sys_clone+0xce/0x120 kernel/fork.c:2750 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 6145 tgid 6145 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2906 vfree+0x1fd/0xb50 mm/vmalloc.c:3440 sel_release_policy+0xd1/0x120 security/selinux/selinuxfs.c:422 __fput+0x402/0xb70 fs/file_table.c:468 task_work_run+0x14d/0x240 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xec/0x130 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x426/0xfa0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffffc900050b7980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900050b7a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc900050b7a80: 00 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1 04 f2 00 ^ ffffc900050b7b00: 00 f2 f2 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 ffffc900050b7b80: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 ==================================================================