Skip to content

drm/panthor: Restrict high priorities on group_create#260

Merged
igorpecovnik merged 1 commit intoarmbian:rk-6.1-rkr3from
amazingfate:rkr3-panthor-backport-6.11
Oct 9, 2024
Merged

drm/panthor: Restrict high priorities on group_create#260
igorpecovnik merged 1 commit intoarmbian:rk-6.1-rkr3from
amazingfate:rkr3-panthor-backport-6.11

Conversation

@amazingfate
Copy link
Copy Markdown
Collaborator

We were allowing any users to create a high priority group without any
permission checks. As a result, this was allowing possible denial of
service.

We now only allow the DRM master or users with the CAP_SYS_NICE
capability to set higher priorities than PANTHOR_GROUP_PRIORITY_MEDIUM.

As the sole user of that uAPI lives in Mesa and hardcode a value of
MEDIUM [1], this should be safe to do.

Additionally, as those checks are performed at the ioctl level,
panthor_group_create now only check for priority level validity.

[1]https://gitlab.freedesktop.org/mesa/mesa/-/blob/f390835074bdf162a63deb0311d1a6de527f9f89/src/gallium/drivers/panfrost/pan_csf.c#L1038

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: de85488 ("drm/panthor: Add the scheduler logical block")
Cc: stable@vger.kernel.org
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240903144955.144278-2-mary.guillemard@collabora.com
@igorpecovnik igorpecovnik merged commit cbd34d0 into armbian:rk-6.1-rkr3 Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants