Date
June 18, 2025, 6:43 a.m.
Environment | |
---|---|
qemu-x86_64 |
[ 146.061522] ================================================================== [ 146.062389] BUG: KASAN: slab-use-after-free in drm_encoder_cleanup+0x265/0x270 [ 146.063042] Read of size 8 at addr ffff88810a109c70 by task kunit_try_catch/1605 [ 146.063615] [ 146.063720] CPU: 0 UID: 0 PID: 1605 Comm: kunit_try_catch Tainted: G B D W N 6.16.0-rc2-next-20250618 #1 PREEMPT(voluntary) [ 146.063767] Tainted: [B]=BAD_PAGE, [D]=DIE, [W]=WARN, [N]=TEST [ 146.063780] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 146.063798] Call Trace: [ 146.063812] <TASK> [ 146.063833] dump_stack_lvl+0x73/0xb0 [ 146.063866] print_report+0xd1/0x650 [ 146.063891] ? __virt_addr_valid+0x1db/0x2d0 [ 146.063915] ? drm_encoder_cleanup+0x265/0x270 [ 146.063936] ? kasan_complete_mode_report_info+0x64/0x200 [ 146.063959] ? drm_encoder_cleanup+0x265/0x270 [ 146.063981] kasan_report+0x141/0x180 [ 146.064001] ? drm_encoder_cleanup+0x265/0x270 [ 146.064026] __asan_report_load8_noabort+0x18/0x20 [ 146.064048] drm_encoder_cleanup+0x265/0x270 [ 146.064071] drmm_encoder_alloc_release+0x36/0x60 [ 146.064092] drm_managed_release+0x15c/0x470 [ 146.064114] ? simple_release_fs+0x86/0xb0 [ 146.064159] drm_dev_put.part.0+0xa1/0x100 [ 146.064181] ? __pfx_devm_drm_dev_init_release+0x10/0x10 [ 146.064203] devm_drm_dev_init_release+0x17/0x30 [ 146.064225] devm_action_release+0x50/0x80 [ 146.064249] devres_release_all+0x186/0x240 [ 146.064271] ? __pfx_devres_release_all+0x10/0x10 [ 146.064292] ? kernfs_remove_by_name_ns+0x166/0x1d0 [ 146.064317] ? sysfs_remove_file_ns+0x56/0xa0 [ 146.064340] device_unbind_cleanup+0x1b/0x1b0 [ 146.064361] device_release_driver_internal+0x3e4/0x540 [ 146.064380] ? klist_devices_put+0x35/0x50 [ 146.064406] device_release_driver+0x16/0x20 [ 146.064426] bus_remove_device+0x1e9/0x3d0 [ 146.064446] device_del+0x397/0x980 [ 146.064468] ? __pfx_device_del+0x10/0x10 [ 146.064487] ? __kasan_check_write+0x18/0x20 [ 146.064508] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 146.064531] ? __pfx_device_unregister_wrapper+0x10/0x10 [ 146.064556] device_unregister+0x1b/0xa0 [ 146.064574] device_unregister_wrapper+0x12/0x20 [ 146.064598] __kunit_action_free+0x57/0x70 [ 146.064621] kunit_remove_resource+0x133/0x200 [ 146.064641] ? preempt_count_sub+0x50/0x80 [ 146.064664] kunit_cleanup+0x7a/0x120 [ 146.064687] kunit_try_run_case_cleanup+0xbd/0xf0 [ 146.064708] ? __pfx_kunit_try_run_case_cleanup+0x10/0x10 [ 146.064730] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 146.064749] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 146.064769] kthread+0x337/0x6f0 [ 146.064790] ? trace_preempt_on+0x20/0xc0 [ 146.064814] ? __pfx_kthread+0x10/0x10 [ 146.064834] ? _raw_spin_unlock_irq+0x47/0x80 [ 146.064853] ? calculate_sigpending+0x7b/0xa0 [ 146.064875] ? __pfx_kthread+0x10/0x10 [ 146.064896] ret_from_fork+0x116/0x1d0 [ 146.064914] ? __pfx_kthread+0x10/0x10 [ 146.064933] ret_from_fork_asm+0x1a/0x30 [ 146.064964] </TASK> [ 146.064975] [ 146.082463] Allocated by task 1604: [ 146.082797] kasan_save_stack+0x45/0x70 [ 146.083167] kasan_save_track+0x18/0x40 [ 146.083492] kasan_save_alloc_info+0x3b/0x50 [ 146.083869] __kasan_kmalloc+0xb7/0xc0 [ 146.084302] __kmalloc_noprof+0x1c9/0x500 [ 146.084607] __devm_drm_bridge_alloc+0x33/0x170 [ 146.084756] drm_test_bridge_init+0x188/0x5c0 [ 146.084900] drm_test_drm_bridge_get_current_state_atomic+0xea/0x870 [ 146.085087] kunit_try_run_case+0x1a5/0x480 [ 146.085455] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 146.086026] kthread+0x337/0x6f0 [ 146.086355] ret_from_fork+0x116/0x1d0 [ 146.086701] ret_from_fork_asm+0x1a/0x30 [ 146.087046] [ 146.087206] Freed by task 1605: [ 146.087511] kasan_save_stack+0x45/0x70 [ 146.087946] kasan_save_track+0x18/0x40 [ 146.088223] kasan_save_free_info+0x3f/0x60 [ 146.088382] __kasan_slab_free+0x56/0x70 [ 146.088511] kfree+0x222/0x3f0 [ 146.088627] drm_bridge_put.part.0+0xc7/0x100 [ 146.088766] drm_bridge_put_void+0x17/0x30 [ 146.088899] devm_action_release+0x50/0x80 [ 146.089031] devres_release_all+0x186/0x240 [ 146.089202] device_unbind_cleanup+0x1b/0x1b0 [ 146.089403] device_release_driver_internal+0x3e4/0x540 [ 146.089592] device_release_driver+0x16/0x20 [ 146.089792] bus_remove_device+0x1e9/0x3d0 [ 146.089961] device_del+0x397/0x980 [ 146.090123] device_unregister+0x1b/0xa0 [ 146.090295] device_unregister_wrapper+0x12/0x20 [ 146.090479] __kunit_action_free+0x57/0x70 [ 146.090612] kunit_remove_resource+0x133/0x200 [ 146.090755] kunit_cleanup+0x7a/0x120 [ 146.090932] kunit_try_run_case_cleanup+0xbd/0xf0 [ 146.091138] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 146.091461] kthread+0x337/0x6f0 [ 146.091618] ret_from_fork+0x116/0x1d0 [ 146.091742] ret_from_fork_asm+0x1a/0x30 [ 146.091875] [ 146.091941] The buggy address belongs to the object at ffff88810a109c00 [ 146.091941] which belongs to the cache kmalloc-512 of size 512 [ 146.092491] The buggy address is located 112 bytes inside of [ 146.092491] freed 512-byte region [ffff88810a109c00, ffff88810a109e00) [ 146.093274] [ 146.093356] The buggy address belongs to the physical page: [ 146.093526] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10a108 [ 146.093870] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 [ 146.094755] flags: 0x200000000000040(head|node=0|zone=2) [ 146.094969] page_type: f5(slab) [ 146.095214] raw: 0200000000000040 ffff888100041c80 dead000000000122 0000000000000000 [ 146.095674] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 [ 146.095994] head: 0200000000000040 ffff888100041c80 dead000000000122 0000000000000000 [ 146.096486] head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 [ 146.096868] head: 0200000000000002 ffffea0004284201 00000000ffffffff 00000000ffffffff [ 146.097157] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 [ 146.097532] page dumped because: kasan: bad access detected [ 146.097781] [ 146.097861] Memory state around the buggy address: [ 146.098069] ffff88810a109b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 146.098710] ffff88810a109b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 146.098990] >ffff88810a109c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 146.099501] ^ [ 146.099769] ffff88810a109c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 146.100162] ffff88810a109d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 146.100517] ==================================================================