From nobody Sun Feb 8 21:33:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542904611973761.6338315857851; Thu, 22 Nov 2018 08:36:51 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 71EBB3138B99; Thu, 22 Nov 2018 16:36:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D66060627; Thu, 22 Nov 2018 16:36:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D690A18327E8; Thu, 22 Nov 2018 16:36:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAMGamLQ027888 for ; Thu, 22 Nov 2018 11:36:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id A6DE65D76C; Thu, 22 Nov 2018 16:36:48 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 047AF5D760; Thu, 22 Nov 2018 16:36:47 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Thu, 22 Nov 2018 17:36:08 +0100 Message-Id: <3ad65b3de2b627b932cd8db17ccbb77e38d65d5c.1542903572.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [PATCH 10/12] security: dac: Relabel the DRI render device for egl-headless too X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 22 Nov 2018 16:36:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Just like for SPICE, we need to change the permissions on the DRI device used as the @rendernode for egl-headless graphics type. Signed-off-by: Erik Skultety --- src/security/security_dac.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 6b64d2c07a..646b3d4745 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -1492,11 +1492,17 @@ virSecurityDACSetGraphicsLabel(virSecurityManagerPt= r mgr, virDomainGraphicsDefPtr gfx) =20 { + const char *rendernode =3D NULL; virSecurityDACDataPtr priv =3D virSecurityManagerGetPrivateData(mgr); virSecurityLabelDefPtr seclabel; uid_t user; gid_t group; =20 + /* So far, only SPICE and EGL headless support rendering on DRM nodes = */ + if (gfx->type !=3D VIR_DOMAIN_GRAPHICS_TYPE_SPICE && + gfx->type !=3D VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS) + return 0; + /* Skip chowning the shared render file if namespaces are disabled */ if (!priv->mountNamespace) return 0; @@ -1508,14 +1514,13 @@ virSecurityDACSetGraphicsLabel(virSecurityManagerPt= r mgr, if (virSecurityDACGetIds(seclabel, priv, &user, &group, NULL, NULL) < = 0) return -1; =20 - if (gfx->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_SPICE && - gfx->data.spice.gl =3D=3D VIR_TRISTATE_BOOL_YES && - gfx->data.spice.rendernode) { - if (virSecurityDACSetOwnership(mgr, NULL, - gfx->data.spice.rendernode, - user, group) < 0) - return -1; - } + if (gfx->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS) + rendernode =3D gfx->data.egl_headless.rendernode; + else if (gfx->data.spice.gl =3D=3D VIR_TRISTATE_BOOL_YES) + rendernode =3D gfx->data.spice.rendernode; + + if (virSecurityDACSetOwnership(mgr, NULL, rendernode, user, group) < 0) + return -1; =20 return 0; } --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list