mirror-linux/drivers/gpu
Thadeu Lima de Souza Cascardo d11ac90434 drm/ttm/tests: add a test to exercise ttm_bo_swapout
Currently, ttm_bo_swapout is not exercised by the TTM KUnit tests.

It used to be exercised until commit 76689eb526 ("drm/ttm: remove
ttm_bo_validate_swapout test"), but that test was removed as it was
unreliable due to requiring to allocate half of the system memory.

Calling ttm_bo_swapout directly with a single allocated BO, however, does
not suffer from that problem, and was able to detect a UAF introduced by
commit c06da4b357 ("drm/ttm: Tidy usage of local variables a little
bit"), when built with KASAN.

When applying a fix to that UAF, the test passed without any issues.

Cc: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
Link: https://lore.kernel.org/r/20260309-ttm_bo_swapout_test-v2-1-219f64046cfe@igalia.com
2026-03-12 10:53:22 +00:00
..
drm drm/ttm/tests: add a test to exercise ttm_bo_swapout 2026-03-12 10:53:22 +00:00
host1x Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
ipu-v3 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nova-core Driver core changes for 7.0-rc1 2026-02-11 17:43:59 -08:00
tests gpu/tests/gpu_buddy: Add gpu_test_buddy_alloc_range for exact-range allocation 2026-03-09 13:58:12 +05:30
trace
vga Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig gpu: Move DRM buddy allocator one level up (part two) 2026-02-06 11:38:35 +10:00
Makefile gpu: Fix uninitialized buddy for built-in drivers 2026-02-24 13:40:59 +10:00
buddy.c drm/buddy: Improve offset-aligned allocation handling 2026-03-09 12:36:10 +05:30