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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 07.12.23 um 11:12 schrieb Linus Walleij:
On Wed, Dec 6, 2023 at 2:52 PM Lingkai Dong <Lingkai.Dong@xxxxxxx> 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@xxxxxxx>
Paging the patch author (Tvrko) and committer (Christian).
Here is the patch if you don't have it in your mailbox:
https://lore.kernel.org/dri-devel/PA6PR08MB107665920BE9A96658CDA04CE8884A@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/

I'm seeing this as well (on Android).

Tvrko, Christian: can you look at this?

Good catch, looks like we missed this occasion while switching from PID to TGID.

Will you apply it to the AMD tree for fixes if it looks OK
or does it go elsewhere?

I can push this to drm-misc-fixes as long as nobody objects in the next hour or so.

CC: stable? If yes which versions?

Regards,
Christian.


Yours,
Linus Walleij




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux