[Devel] [PATCH hci-8.2 2/4] ms/gpu/buddy: Fix use-after-free in split_block() call sites

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Wed Nov 18 14:43:40 MSK 2026


> From: Francois Dugast <francois.dugast at intel.com>
> 
> When split_block() fails it returns before calling mark_split(), leaving
> the block in the FREE state and still linked in the rbtree.  The four
> err_undo paths then call __gpu_buddy_free() without first removing the
> block from the tree, which leads to two distinct bugs:
> 
>  - If the buddy is also free, __gpu_buddy_free() merges the two siblings
>    by calling gpu_block_free(mm, block) while block->rb is still linked
>    in the tree.  Any subsequent rbtree traversal will follow the now-
>    dangling pointer, causing a use-after-free.
> 
>  - In alloc_from_freetree(), where there is no buddy guard,
>    __gpu_buddy_free() always reaches mark_free() -> rbtree_insert() with
>    block still in the tree, corrupting the rbtree.
> [ ... ]
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-155318
> Feature: fix ms/drm
> 
> Signed-off-by: Mirian Shilakadze <mirian.shilakadze at virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261118113935.381228-1-mirian.shilakadze@virtuozzo.com?part=2




More information about the Devel mailing list