Date
June 26, 2025, 9:10 a.m.
Environment | |
---|---|
qemu-x86_64 |
[ 180.631142] ================================================================== [ 180.631852] BUG: KASAN: slab-use-after-free in drm_encoder_cleanup+0x265/0x270 [ 180.632619] Read of size 8 at addr ffff88810713e870 by task kunit_try_catch/1678 [ 180.633360] [ 180.633555] CPU: 0 UID: 0 PID: 1678 Comm: kunit_try_catch Tainted: G B D W N 6.16.0-rc3-next-20250626 #1 PREEMPT(voluntary) [ 180.633606] Tainted: [B]=BAD_PAGE, [D]=DIE, [W]=WARN, [N]=TEST [ 180.633619] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 180.633639] Call Trace: [ 180.633655] <TASK> [ 180.633693] dump_stack_lvl+0x73/0xb0 [ 180.633729] print_report+0xd1/0x650 [ 180.633767] ? __virt_addr_valid+0x1db/0x2d0 [ 180.633793] ? drm_encoder_cleanup+0x265/0x270 [ 180.633818] ? kasan_complete_mode_report_info+0x64/0x200 [ 180.633841] ? drm_encoder_cleanup+0x265/0x270 [ 180.633865] kasan_report+0x141/0x180 [ 180.633887] ? drm_encoder_cleanup+0x265/0x270 [ 180.633914] __asan_report_load8_noabort+0x18/0x20 [ 180.633938] drm_encoder_cleanup+0x265/0x270 [ 180.633963] drmm_encoder_alloc_release+0x36/0x60 [ 180.633987] drm_managed_release+0x15c/0x470 [ 180.634007] ? simple_release_fs+0x86/0xb0 [ 180.634034] drm_dev_put.part.0+0xa1/0x100 [ 180.634052] ? __pfx_devm_drm_dev_init_release+0x10/0x10 [ 180.634073] devm_drm_dev_init_release+0x17/0x30 [ 180.634093] devm_action_release+0x50/0x80 [ 180.634119] devres_release_all+0x186/0x240 [ 180.634151] ? __pfx_devres_release_all+0x10/0x10 [ 180.634169] ? kernfs_remove_by_name_ns+0x166/0x1d0 [ 180.634194] ? sysfs_remove_file_ns+0x56/0xa0 [ 180.634218] device_unbind_cleanup+0x1b/0x1b0 [ 180.634242] device_release_driver_internal+0x3e4/0x540 [ 180.634265] ? klist_devices_put+0x35/0x50 [ 180.634287] device_release_driver+0x16/0x20 [ 180.634309] bus_remove_device+0x1e9/0x3d0 [ 180.634333] device_del+0x397/0x980 [ 180.634358] ? __pfx_device_del+0x10/0x10 [ 180.634379] ? __kasan_check_write+0x18/0x20 [ 180.634401] ? _raw_spin_lock_irqsave+0xa1/0x100 [ 180.634432] ? __pfx_device_unregister_wrapper+0x10/0x10 [ 180.634457] device_unregister+0x1b/0xa0 [ 180.634478] device_unregister_wrapper+0x12/0x20 [ 180.634499] __kunit_action_free+0x57/0x70 [ 180.634523] kunit_remove_resource+0x133/0x200 [ 180.634544] ? preempt_count_sub+0x50/0x80 [ 180.634568] kunit_cleanup+0x7a/0x120 [ 180.634592] kunit_try_run_case_cleanup+0xbd/0xf0 [ 180.634615] ? __pfx_kunit_try_run_case_cleanup+0x10/0x10 [ 180.634637] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 180.634659] ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 [ 180.634680] kthread+0x337/0x6f0 [ 180.634702] ? trace_preempt_on+0x20/0xc0 [ 180.634727] ? __pfx_kthread+0x10/0x10 [ 180.634747] ? _raw_spin_unlock_irq+0x47/0x80 [ 180.634773] ? calculate_sigpending+0x7b/0xa0 [ 180.634797] ? __pfx_kthread+0x10/0x10 [ 180.634818] ret_from_fork+0x116/0x1d0 [ 180.634839] ? __pfx_kthread+0x10/0x10 [ 180.634859] ret_from_fork_asm+0x1a/0x30 [ 180.634892] </TASK> [ 180.634905] [ 180.650797] Allocated by task 1677: [ 180.651235] kasan_save_stack+0x45/0x70 [ 180.651685] kasan_save_track+0x18/0x40 [ 180.652309] kasan_save_alloc_info+0x3b/0x50 [ 180.652801] __kasan_kmalloc+0xb7/0xc0 [ 180.653023] __kmalloc_noprof+0x1c9/0x500 [ 180.653298] __devm_drm_bridge_alloc+0x33/0x170 [ 180.653798] drm_test_bridge_init+0x188/0x5c0 [ 180.654113] drm_test_drm_bridge_get_current_state_atomic+0xea/0x870 [ 180.654317] kunit_try_run_case+0x1a5/0x480 [ 180.654460] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 180.654629] kthread+0x337/0x6f0 [ 180.654746] ret_from_fork+0x116/0x1d0 [ 180.654873] ret_from_fork_asm+0x1a/0x30 [ 180.655204] [ 180.655374] Freed by task 1678: [ 180.655661] kasan_save_stack+0x45/0x70 [ 180.656016] kasan_save_track+0x18/0x40 [ 180.656432] kasan_save_free_info+0x3f/0x60 [ 180.656877] __kasan_slab_free+0x56/0x70 [ 180.657279] kfree+0x222/0x3f0 [ 180.657567] drm_bridge_put.part.0+0xc7/0x100 [ 180.658004] drm_bridge_put_void+0x17/0x30 [ 180.658382] devm_action_release+0x50/0x80 [ 180.658754] devres_release_all+0x186/0x240 [ 180.659158] device_unbind_cleanup+0x1b/0x1b0 [ 180.659763] device_release_driver_internal+0x3e4/0x540 [ 180.660181] device_release_driver+0x16/0x20 [ 180.660463] bus_remove_device+0x1e9/0x3d0 [ 180.660939] device_del+0x397/0x980 [ 180.661190] device_unregister+0x1b/0xa0 [ 180.661476] device_unregister_wrapper+0x12/0x20 [ 180.662011] __kunit_action_free+0x57/0x70 [ 180.662344] kunit_remove_resource+0x133/0x200 [ 180.662781] kunit_cleanup+0x7a/0x120 [ 180.663083] kunit_try_run_case_cleanup+0xbd/0xf0 [ 180.663253] kunit_generic_run_threadfn_adapter+0x85/0xf0 [ 180.663423] kthread+0x337/0x6f0 [ 180.663539] ret_from_fork+0x116/0x1d0 [ 180.663666] ret_from_fork_asm+0x1a/0x30 [ 180.663800] [ 180.663872] The buggy address belongs to the object at ffff88810713e800 [ 180.663872] which belongs to the cache kmalloc-512 of size 512 [ 180.664273] The buggy address is located 112 bytes inside of [ 180.664273] freed 512-byte region [ffff88810713e800, ffff88810713ea00) [ 180.664898] [ 180.665083] The buggy address belongs to the physical page: [ 180.665341] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10713c [ 180.665625] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 [ 180.665980] flags: 0x200000000000040(head|node=0|zone=2) [ 180.666223] page_type: f5(slab) [ 180.666349] raw: 0200000000000040 ffff888100041c80 dead000000000122 0000000000000000 [ 180.666702] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 [ 180.667292] head: 0200000000000040 ffff888100041c80 dead000000000122 0000000000000000 [ 180.667566] head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 [ 180.667859] head: 0200000000000002 ffffea00041c4f01 00000000ffffffff 00000000ffffffff [ 180.668545] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 [ 180.668848] page dumped because: kasan: bad access detected [ 180.669521] [ 180.669615] Memory state around the buggy address: [ 180.670176] ffff88810713e700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 180.670896] ffff88810713e780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 180.671456] >ffff88810713e800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 180.671929] ^ [ 180.672230] ffff88810713e880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 180.672503] ffff88810713e900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 180.672782] ==================================================================