Re: [PATCH v7 5/8] drm/panthor: Introduce sampling sessions to handle userspace clients
From: Ashley Smith
Date: Wed Nov 04 2026 - 12:50:29 EST
On Sun, Oct 11, 2026 at 06:36:52PM +0100, Lukas Zapolskas wrote:
> + ret = panthor_perf_bo_get(file, create_args->control_handle, 0, &control);
Like the ringbuffer BO above, I think we need to include the size here since
if the actual size is less than what the kernel expects it could lead to
writing to out of bounds memory (imported BOs):
ret = panthor_perf_bo_get(file, create_args->control_handle, sizeof(
struct drm_panthor_perf_ringbuf_control), &control);
Could also change panthor_perf_bo_get() to always test and instead
of != use <=
if (obj->size <= PFN_ALIGN(expected_size))
so callers cant silently skip validation.
FWIW, I have tested v7 of this patch series on a Rock5B and can see reliable
counter values.
Tested-by: Ashley Smith <ashley.smith@xxxxxxxxxxxxx>