From: Pekka Paalanen Subject: Re: [PATCH v7] unstable/drm-lease: DRM lease protocol support Date: Fri, 18 Oct 2019 16:43:29 +0300 Message-ID: <20191018164329.412b14ca@eldfell.localdomain> References: <20191018122130.0f880724@eldfell.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0293801670==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Drew DeVault Cc: Daniel Vetter , Marius Vlad , DRI Development , wayland-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0293801670== Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/+7kNDCAdp+DpbaRNMMoqC8/"; protocol="application/pgp-signature" --Sig_/+7kNDCAdp+DpbaRNMMoqC8/ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 18 Oct 2019 07:54:50 -0400 "Drew DeVault" wrote: > On Fri Oct 18, 2019 at 12:21 PM Pekka Paalanen wrote: > > One thing I did not know the last time was that apparently > > systemd-logind may not like to give out non-master DRM fds. That might > > need fixing in logind implementations. I hope someone would step up to > > look into that. > > > > This protocol aims to deliver a harmless "read-only" DRM device file > > description to a client, so that the client can enumerate all DRM > > resources, fetch EDID and other properties to be able to decide which > > connector it would want to lease. The client should not be able to > > change any KMS state through this fd, and it should not be able to e.g. > > spy on display contents. The assumption is that a non-master DRM fd > > from a fresh open() would be fine for this, but is it? =20 >=20 > What I do for wlroots is call drmGetDeviceNameFromFd2, which returns the > path to the device file, and then I open() it and use > drmIsMaster/drmDropMaster to make sure it's not a master fd. This seems > to work correctly in practice. That is nice. Personally I'm specifically worried about a setup where the user has no access permissions to open the DRM device node directly, as is (or should be) the case with input devices. However, since DRM has the master concept which input devices do not, maybe there is no reason to prevent a normal user from opening a DRM device directly. That is, if our assumption that a non-master DRM fd is harmless holds. (Wayland display servers usually run as a normal user, while logind or another service runs with elevated privileges and opens input and DRM devices on behalf of the display server.) Thanks, pq --Sig_/+7kNDCAdp+DpbaRNMMoqC8/ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJQjwWQChkWOYOIONI1/ltBGqqqcFAl2pwYEACgkQI1/ltBGq qqeSqQ/+Nyov3Yu8NHgt7YM/ETuNOXXYb6n1LmRTdQPUyePiE4TRhj/udpbDQADn f+Pk9PbxoMAPGlyOePil8KBvgSRh+ELAAOxKSfhXsT/3bet1+5Rj97PtscZbzZ/s HIx5Ww+aKH4J0maybaQ8alyDKam3NfwE1vk6eJ28FcRQUCpF73/OtBHnhdW05jHK sSKjrxuQdEMNYvIYZxjru8ra5hQQciWWPUdl59Y7+dvRBylIswS68+LOHH7g+MBU DCBa9nzU86tJIVahNcL0VBUyjvhqnjUXbHGXHDNOzmCCVj978ZZwpjc1C72OM/1P XCiuV6RnQ4z5cMQH+KMjVHksSJjJ239f+WZOHDK30/QSdNY0ICFPoiTse+ad4cfU YyNsa793KESmySLv1tKOWqnERWzbTNTI47oDNQgvZrY8utKnOc2YK+L50NJbqFKA u9v+a7+8ELteHewaVQDbnfD0MPGcDWbNwbzU6/HGEPjmQr/npiK2S1g5jjBasrqD 3QBvmqrgsuiEPddsK5MBrdkUFGm9tuz+LT5PPe4be7lROzYf7UlIm0d3GSLJgAiC yP0NTFob1gzJexrrghuFaPJWJc8t0Tpkv6LtpnrO/IuVhTV8tRRA8Jd9buQ92N6U tK7Yb1wemPCxCgFwD2DQlElOS3czN9ftXnQAPX67iLAyazZUue0= =nyJA -----END PGP SIGNATURE----- --Sig_/+7kNDCAdp+DpbaRNMMoqC8/-- --===============0293801670== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0293801670==--