==================================================================
BUG: KASAN: slab-use-after-free in drm_atomic_helper_wait_for_vblanks+0x317/0x8f0
Read of size 1 at addr ffff88811445d409 by task kworker/u9:24/32323

CPU: 0 UID: 0 PID: 32323 Comm: kworker/u9:24 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Workqueue: events_unbound commit_work
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150
 print_address_description+0x55/0x1e0
 print_report+0x58/0x70
 kasan_report+0x117/0x150
 drm_atomic_helper_wait_for_vblanks+0x317/0x8f0
 drm_atomic_helper_commit_tail+0x2e9/0x510
 commit_tail+0x2b1/0x3c0
 process_scheduled_works+0xa8e/0x14e0
 worker_thread+0xa47/0xfb0
 kthread+0x388/0x470
 ret_from_fork+0x514/0xb70
 ret_from_fork_asm+0x1a/0x30
 </TASK>

Allocated by task 21513:
 kasan_save_track+0x3e/0x80
 __kasan_kmalloc+0x93/0xb0
 __kmalloc_cache_noprof+0x32d/0x660
 drm_atomic_helper_crtc_duplicate_state+0x72/0xb0
 drm_atomic_get_crtc_state+0x1b3/0x570
 page_flip_common+0x56/0x2a0
 drm_atomic_helper_page_flip+0xa5/0x160
 drm_mode_page_flip_ioctl+0xe2d/0x13d0
 drm_ioctl_kernel+0x2df/0x3b0
 drm_ioctl+0x70e/0xba0
 __se_sys_ioctl+0xfc/0x170
 do_syscall_64+0x174/0x580
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 5656:
 kasan_save_track+0x3e/0x80
 kasan_save_free_info+0x40/0x50
 __kasan_slab_free+0x5c/0x80
 kfree+0x1c5/0x640
 drm_atomic_commit_default_clear+0x47f/0xf00
 __drm_atomic_commit_free+0xb4/0x230
 drm_atomic_helper_dirtyfb+0xee3/0xfd0
 drm_fbdev_shmem_helper_fb_dirty+0x160/0x310
 drm_fb_helper_damage_work+0x84c/0xf20
 process_scheduled_works+0xa8e/0x14e0
 worker_thread+0xa47/0xfb0
 kthread+0x388/0x470
 ret_from_fork+0x514/0xb70
 ret_from_fork_asm+0x1a/0x30

The buggy address belongs to the object at ffff88811445d400
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 9 bytes inside of
 freed 512-byte region [ffff88811445d400, ffff88811445d600)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11445c
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x17ff00000000040(head|node=0|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 017ff00000000040 ffff888100041c80 dead000000000100 dead000000000122
raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
head: 017ff00000000040 ffff888100041c80 dead000000000100 dead000000000122
head: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
head: 017ff00000000002 ffffffffffffff01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5048, tgid 5048 (udevd), ts 2387242093992
 post_alloc_hook+0x1f9/0x250
 get_page_from_freelist+0x2205/0x2280
 __alloc_frozen_pages_noprof+0x217/0x5a0
 allocate_slab+0x7c/0x5e0
 refill_objects+0x2d5/0x350
 __pcs_replace_empty_main+0x2bf/0x6b0
 __kmalloc_cache_noprof+0x3a7/0x660
 kernfs_fop_open+0x3ac/0xce0
 do_dentry_open+0x816/0x1380
 vfs_open+0x3b/0x340
 path_openat+0x2e44/0x3830
 do_file_open+0x23e/0x4a0
 do_sys_openat2+0x115/0x200
 __x64_sys_openat+0x138/0x170
 do_syscall_64+0x174/0x580
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 7241 tgid 7241 ts 2371295514178 stack trace:
 __free_frozen_pages+0xc8f/0xd80
 __slab_free+0x274/0x2c0
 qlist_free_all+0x99/0x100
 kasan_quarantine_reduce+0x148/0x160
 __kasan_slab_alloc+0x22/0x80
 __kmalloc_cache_noprof+0x2ab/0x660
 drm_atomic_commit_alloc+0xa9/0x100
 drm_atomic_helper_dirtyfb+0x129/0xfd0
 drm_fbdev_shmem_helper_fb_dirty+0x160/0x310
 drm_fb_helper_damage_work+0x84c/0xf20
 process_scheduled_works+0xa8e/0x14e0
 worker_thread+0xa47/0xfb0
 kthread+0x388/0x470
 ret_from_fork+0x514/0xb70
 ret_from_fork_asm+0x1a/0x30

Memory state around the buggy address:
 ffff88811445d300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88811445d380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88811445d400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff88811445d480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811445d500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
