[PATCH] drm: Fix FD ownership check in drm_master_check_perm()

Linus Walleij linus.walleij at linaro.org
Thu Dec 7 10:24:59 UTC 2023


On Wed, Dec 6, 2023 at 2:52 PM Lingkai Dong <Lingkai.Dong at arm.com> wrote:

> The DRM subsystem keeps a record of the owner of a DRM device file
> descriptor using thread group ID (TGID) instead of process ID (PID), to
> ensures all threads within the same userspace process are considered the
> owner. However, the DRM master ownership check compares the current
> thread's PID against the record, so the thread is incorrectly considered to
> be not the FD owner if the PID is not equal to the TGID. This causes DRM
> ioctls to be denied master privileges, even if the same thread that opened
> the FD performs an ioctl. Fix this by checking TGID.
>
> Fixes: 4230cea89cafb ("drm: Track clients by tgid and not tid")
> Signed-off-by: Lingkai Dong <lingkai.dong at arm.com>

Tested-by: Linus Walleij <linus.walleij at linaro.org>

Yours,
Linus Walleij


More information about the dri-devel mailing list