================================================================== 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+0x1caa/0x1d60 drivers/video/fbdev/core/sysimgblt.c:24 Write of size 8 at addr ffffc90004f97d90 by task syz.3.1119/8579 CPU: 2 UID: 0 PID: 8579 Comm: syz.3.1119 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] 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+0x1caa/0x1d60 drivers/video/fbdev/core/sysimgblt.c:24 drm_fbdev_shmem_defio_imag drm_fbdev_shmem_defio_imageblit+0x20/0x130 drivers/gpu/drm/drm_fbdev_shmem.c:39 soft_cursor+0x524/0xa10 drivers/video/fbdev/core/softcursor.c:74 bit_cursor+0xcf1/0x14d0 drivers/video/fbdev/core/bitblit.c:372 fbcon_cursor+0x43c/0x5e0 drivers/video/fbdev/core/fbcon.c:1410 set_cursor drivers/tty/vt/vt.c:1010 [inline] set_cursor+0x1db/0x250 drivers/tty/vt/vt.c:1001 con_flush_chars drivers/tty/vt/vt.c:3848 [inline] con_write+0x8c/0xb0 drivers/tty/vt/vt.c:3779 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:0xf7fa8fbc 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:00000000f545650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000080001a40 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 0xffffc90004f90000 allocated at kernel_clone+0x176/0x9d0 kernel/fork.c:2798 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4f68f flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 0000000000000000 ffffea00013da3c8 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 0x29c2(GFP_NOWAIT|__GFP_HIGHMEM|__GFP_IO|__GFP_FS|__GFP_ZERO), pid 5700, tgid 5700 (syz-executor), ts 37387021002 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1860 prep_new_page mm/page_alloc.c:1868 [inline] get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3950 __alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5492 alloc_pages_mpol+0x201/0x560 mm/mempolicy.c:2513 alloc_pages_noprof+0x1a/0x160 mm/mempolicy.c:2604 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/0x88e0 kernel/fork.c:2150 kernel_clone+0x176/0x9d0 kernel/fork.c:2798 __do_sys_clone3+0x214/0x290 kernel/fork.c:3101 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] do_int80_emulation+0x16a/0x670 arch/x86/entry/syscall_32.c:170 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:598 page last free pid 5699 tgid 5699 ts 37328635415 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0x7b1/0x10f0 mm/page_alloc.c:2958 __folio_put+0x3b4/0x5f0 mm/folio.c:106 folio_put include/linux/mm.h:2305 [inline] put_page include/linux/mm.h:2374 [inline] netmem_dec_ref include/net/netmem.h:444 [inline] skb_netmem_unref include/linux/skbuff_ref.h:64 [inline] skb_release_data+0x60c/0x860 net/core/skbuff.c:1118 skb_release_all net/core/skbuff.c:1189 [inline] __kfree_skb net/core/skbuff.c:1203 [inline] napi_consume_skb+0x2c0/0x320 net/core/skbuff.c:1541 __skb_defer_free_flush net/core/dev.c:7098 [inline] __skb_defer_free_flush net/core/dev.c:7086 [inline] skb_defer_free_flush+0x16b/0x290 net/core/dev.c:7120 net_rx_action+0x3ca/0xf20 net/core/dev.c:8198 handle_softirqs+0x216/0xa20 kernel/softirq.c:669 do_softirq kernel/softirq.c:569 [inline] do_softirq+0xaf/0xf0 kernel/softirq.c:556 __local_bh_enable_ip+0xff/0x120 kernel/softirq.c:473 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:923 [inline] __dev_queue_xmit+0xa43/0x48d0 net/core/dev.c:5135 dev_queue_xmit include/linux/netdevice.h:3485 [inline] neigh_hh_output include/net/neighbour.h:538 [inline] neigh_output include/net/neighbour.h:552 [inline] ip_finish_output2+0xfc1/0x26e0 net/ipv4/ip_output.c:236 __ip_finish_output.part.0+0x43b/0x6f0 net/ipv4/ip_output.c:314 __ip_finish_output net/ipv4/ip_output.c:302 [inline] ip_finish_output net/ipv4/ip_output.c:324 [inline] NF_HOOK_COND include/linux/netfilter.h:314 [inline] ip_output+0x392/0xc00 net/ipv4/ip_output.c:437 dst_output include/net/dst.h:471 [inline] ip_local_out+0x193/0x1f0 net/ipv4/ip_output.c:131 __ip_queue_xmit+0x876/0x1f50 net/ipv4/ip_output.c:533 __tcp_transmit_skb+0x34d9/0x4f00 net/ipv4/tcp_output.c:1772 Memory state around the buggy address: ffffc90004f97c80: 00 f1 f1 f1 f1 00 00 00 00 00 00 00 00 00 00 00 ffffc90004f97d00: f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 >ffffc90004f97d80: 00 00 f1 f1 f1 f1 f1 f1 00 00 00 00 00 00 00 00 ^ ffffc90004f97e00: 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 f3 f3 ffffc90004f97e80: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== BUG: unable to handle page fault for address: ffffc90004f99180 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 1d400067 P4D 1d400067 PUD 1eab1067 PMD 271fb067 PTE 0 Oops: Oops: 0002 [#1] SMP KASAN NOPTI CPU: 2 UID: 0 PID: 8579 Comm: syz.3.1119 Tainted: G B L syzkaller #0 PREEMPT(full) Tainted: [B]=BAD_PAGE, [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:fb_write_offset drivers/video/fbdev/core/sysmem.h:30 [inline] RIP: 0010:fb_bitmap_2ppw drivers/video/fbdev/core/fb_imageblit.h:364 [inline] RIP: 0010:fb_bitmap_imageblit drivers/video/fbdev/core/fb_imageblit.h:462 [inline] RIP: 0010:fb_imageblit drivers/video/fbdev/core/fb_imageblit.h:492 [inline] RIP: 0010:sys_imageblit+0x16cb/0x1d60 drivers/video/fbdev/core/sysimgblt.c:24 Code: 80 3c 1e 00 0f 85 aa 05 00 00 4d 63 f6 48 8b 8c cc 88 00 00 00 4f 8d 34 f7 4c 89 f6 48 c1 ee 03 80 3c 1e 00 0f 85 1b 03 00 00 <49> 89 0e 41 89 c6 8d 4d fd 41 c1 ee 04 41 83 e6 03 4b 8d 7c f5 00 RSP: 0000:ffffc90003f5f720 EFLAGS: 00010286 RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffc90003f5f6e8 RBP: 0000000000000004 R08: 0000000000000003 R09: 0000000000000004 R10: ffffffff95bf7b27 R11: 0000000000000000 R12: ffff8880277d0bf4 R13: ffffc90003f5f7a8 R14: ffffc90004f99180 R15: ffffc90004f99180 FS: 0000000000000000(0000) GS:ffff888095471000(0063) knlGS:00000000f5456b40 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: ffffc90004f99180 CR3: 00000000446b1000 CR4: 0000000000352ef0 Call Trace: drm_fbdev_shmem_defio_imageblit+0x20/0x130 drivers/gpu/drm/drm_fbdev_shmem.c:39 soft_cursor+0x524/0xa10 drivers/video/fbdev/core/softcursor.c:74 bit_cursor+0xcf1/0x14d0 drivers/video/fbdev/core/bitblit.c:372 fbcon_cursor+0x43c/0x5e0 drivers/video/fbdev/core/fbcon.c:1410 set_cursor drivers/tty/vt/vt.c:1010 [inline] set_cursor+0x1db/0x250 drivers/tty/vt/vt.c:1001 con_flush_chars drivers/tty/vt/vt.c:3848 [inline] con_write+0x8c/0xb0 drivers/tty/vt/vt.c:3779 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:0xf7fa8fbc 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:00000000f545650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000080001a40 RDX: 0000000000001006 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: CR2: ffffc90004f99180 ---[ end trace 0000000000000000 ]--- RIP: 0010:fb_write_offset drivers/video/fbdev/core/sysmem.h:30 [inline] RIP: 0010:fb_bitmap_2ppw drivers/video/fbdev/core/fb_imageblit.h:364 [inline] RIP: 0010:fb_bitmap_imageblit drivers/video/fbdev/core/fb_imageblit.h:462 [inline] RIP: 0010:fb_imageblit drivers/video/fbdev/core/fb_imageblit.h:492 [inline] RIP: 0010:sys_imageblit+0x16cb/0x1d60 drivers/video/fbdev/core/sysimgblt.c:24 Code: 80 3c 1e 00 0f 85 aa 05 00 00 4d 63 f6 48 8b 8c cc 88 00 00 00 4f 8d 34 f7 4c 89 f6 48 c1 ee 03 80 3c 1e 00 0f 85 1b 03 00 00 <49> 89 0e 41 89 c6 8d 4d fd 41 c1 ee 04 41 83 e6 03 4b 8d 7c f5 00 RSP: 0000:ffffc90003f5f720 EFLAGS: 00010286 RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffc90003f5f6e8 RBP: 0000000000000004 R08: 0000000000000003 R09: 0000000000000004 R10: ffffffff95bf7b27 R11: 0000000000000000 R12: ffff8880277d0bf4 R13: ffffc90003f5f7a8 R14: ffffc90004f99180 R15: ffffc90004f99180 FS: 0000000000000000(0000) GS:ffff888095471000(0063) knlGS:00000000f5456b40 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: ffffc90004f99180 CR3: 00000000446b1000 CR4: 0000000000352ef0 ---------------- 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