Date
June 25, 2025, 8:08 a.m.
Environment | |
---|---|
qemu-x86_64 |
[ 176.896720] ================================================================== [ 176.897498] BUG: KASAN: slab-use-after-free in drm_encoder_cleanup+0x265/0x270 [ 176.898263] Read of size 8 at addr ffff88810336bc70 by task kunit_try_catch/1678 [ 176.899029] [ 176.899184] CPU: 1 UID: 0 PID: 1678 Comm: kunit_try_catch Tainted: G B D W N 6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) [ 176.899234] Tainted: [B]=BAD_PAGE, [D]=DIE, [W]=WARN, [N]=TEST [ 176.899248] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 176.899265] Call Trace: [ 176.899280] <TASK> [ 176.899301] dump_stack_lvl+0x73/0xb0 [ 176.899332] print_report+0xd1/0x650 [ 176.899357] ? __virt_addr_valid+0x1db/0x2d0 [ 176.899381] ? drm_encoder_cleanup+0x265/0x270 [ 176.899404] ? kasan_complete_mode_report_info+0x64/0x200 [ 176.899427] ? drm_encoder_cleanup+0x265/0x270 [ 176.899449] kasan_report+0x141/0x180 [ 176.899470] ? drm_encoder_cleanup+0x265/0x270 [ 176.899496] __asan_report_load8_noabort+0x18/0x20 [ 176.899519] drm_encoder_cleanup+0x265/0x270 [ 176.899542] drmm_encoder_alloc_release+0x36/0x60 [ 176.899561] drm_managed_release+0x15c/0x470 [ 176.899580] ? simple_release_fs+0x86/0xb0 [ 176.899605] drm_dev_put.part.0+0xa1/0x100 [ 176.899625] ? __pfx_devm_drm_dev_init_release+0x10/0x10 [ 176.899644] devm_drm_dev_init_release+0x17/0x30 [ 176.899663] devm_action_release+0x50/0x80 [ 176.899690] devres_release_all+0x186/0x240 [ 176.899710] ? __pfx_devres_release_all+0x10/0x10 [ 176.899729] ? kernfs_remove_by_name_ns+0x166/0x1d0 [ 176.899753] ? sysfs_remove_file_ns+0x56/0xa0 [ 176.899775] device_unbind_cleanup+0x1b/0x1b0 [ 176.899798] device_release_driver_internal+0x3e4/0x540 [ 176.899820] ? klist_devices_put+0x35/0x50 [ 176.899842] device_release_driver+0x16/0x20 [ 176.899863] bus_remove_device+0x1e9/0x3d0 [ 176.899887] device_del+0x397/0x980 [ 176.899925] ? __pfx_device_del+0x10/0x10 [ 176.899946] ? __kasan_check_write+0x18/0x20 [ 176.899966] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 176.899987] ? __pfx_device_unregister_wrapper+0x10/0x10 [ 176.900013] device_unregister+0x1b/0xa0 [ 176.900034] device_unregister_wrapper+0x12/0x20 [ 176.900054] __kunit_action_free+0x57/0x70 [ 176.900078] kunit_remove_resource+0x133/0x200 [ 176.900125] ? preempt_count_sub+0x50/0x80 [ 176.900158] kunit_cleanup+0x7a/0x120 [ 176.900183] kunit_try_run_case_cleanup+0xbd/0xf0 [ 176.900205] ? __pfx_kunit_try_run_case_cleanup+0x10/0x10 [ 176.900226] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 176.900248] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 176.900268] kthread+0x337/0x6f0 [ 176.900440] ? trace_preempt_on+0x20/0xc0 [ 176.900469] ? __pfx_kthread+0x10/0x10 [ 176.900489] ? _raw_spin_unlock_irq+0x47/0x80 [ 176.900512] ? calculate_sigpending+0x7b/0xa0 [ 176.900535] ? __pfx_kthread+0x10/0x10 [ 176.900555] ret_from_fork+0x116/0x1d0 [ 176.900574] ? __pfx_kthread+0x10/0x10 [ 176.900594] ret_from_fork_asm+0x1a/0x30 [ 176.900624] </TASK> [ 176.900636] [ 176.915078] Allocated by task 1677: [ 176.915458] kasan_save_stack+0x45/0x70 [ 176.915666] kasan_save_track+0x18/0x40 [ 176.916090] kasan_save_alloc_info+0x3b/0x50 [ 176.916300] __kasan_kmalloc+0xb7/0xc0 [ 176.916564] __kmalloc_noprof+0x1c9/0x500 [ 176.916873] __devm_drm_bridge_alloc+0x33/0x170 [ 176.917177] drm_test_bridge_init+0x188/0x5c0 [ 176.917391] drm_test_drm_bridge_get_current_state_atomic+0xea/0x870 [ 176.917814] kunit_try_run_case+0x1a5/0x480 [ 176.918267] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 176.918728] kthread+0x337/0x6f0 [ 176.918865] ret_from_fork+0x116/0x1d0 [ 176.919380] ret_from_fork_asm+0x1a/0x30 [ 176.919525] [ 176.919617] Freed by task 1678: [ 176.919775] kasan_save_stack+0x45/0x70 [ 176.920304] kasan_save_track+0x18/0x40 [ 176.920600] kasan_save_free_info+0x3f/0x60 [ 176.920967] __kasan_slab_free+0x56/0x70 [ 176.921289] kfree+0x222/0x3f0 [ 176.921553] drm_bridge_put.part.0+0xc7/0x100 [ 176.921959] drm_bridge_put_void+0x17/0x30 [ 176.922251] devm_action_release+0x50/0x80 [ 176.922543] devres_release_all+0x186/0x240 [ 176.922730] device_unbind_cleanup+0x1b/0x1b0 [ 176.922955] device_release_driver_internal+0x3e4/0x540 [ 176.923306] device_release_driver+0x16/0x20 [ 176.923520] bus_remove_device+0x1e9/0x3d0 [ 176.923708] device_del+0x397/0x980 [ 176.923835] device_unregister+0x1b/0xa0 [ 176.924084] device_unregister_wrapper+0x12/0x20 [ 176.924492] __kunit_action_free+0x57/0x70 [ 176.924653] kunit_remove_resource+0x133/0x200 [ 176.924984] kunit_cleanup+0x7a/0x120 [ 176.925268] kunit_try_run_case_cleanup+0xbd/0xf0 [ 176.925510] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 176.925746] kthread+0x337/0x6f0 [ 176.925987] ret_from_fork+0x116/0x1d0 [ 176.926214] ret_from_fork_asm+0x1a/0x30 [ 176.926424] [ 176.926532] The buggy address belongs to the object at ffff88810336bc00 [ 176.926532] which belongs to the cache kmalloc-512 of size 512 [ 176.927133] The buggy address is located 112 bytes inside of [ 176.927133] freed 512-byte region [ffff88810336bc00, ffff88810336be00) [ 176.927637] [ 176.927730] The buggy address belongs to the physical page: [ 176.928038] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103368 [ 176.928560] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 [ 176.929102] flags: 0x200000000000040(head|node=0|zone=2) [ 176.929482] page_type: f5(slab) [ 176.929706] raw: 0200000000000040 ffff888100041c80 dead000000000122 0000000000000000 [ 176.930079] raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 [ 176.930567] head: 0200000000000040 ffff888100041c80 dead000000000122 0000000000000000 [ 176.930923] head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 [ 176.931437] head: 0200000000000002 ffffea00040cda01 00000000ffffffff 00000000ffffffff [ 176.931781] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 [ 176.932256] page dumped because: kasan: bad access detected [ 176.932515] [ 176.932594] Memory state around the buggy address: [ 176.932809] ffff88810336bb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 176.933168] ffff88810336bb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 176.933444] >ffff88810336bc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 176.933802] ^ [ 176.934059] ffff88810336bc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 176.934379] ffff88810336bd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 176.934712] ==================================================================