From patchwork Mon May 27 08:17:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 10962255 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A01D51390 for ; Mon, 27 May 2019 08:19:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91FFA2899B for ; Mon, 27 May 2019 08:19:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 865D128A05; Mon, 27 May 2019 08:19:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 321C2289A6 for ; Mon, 27 May 2019 08:19:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F8FE899FF; Mon, 27 May 2019 08:19:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id EBCF68999E for ; Mon, 27 May 2019 08:19:27 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id f10so7752466wmb.1 for ; Mon, 27 May 2019 01:19:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bGo+wmfdMFNtr1n5PzMjqu4298v/kiu+NsJd7STGsfY=; b=XMx7C2dnltk5ljq3qCcdQ8ZxvATcqb+QuQAKci4b+HCmPnEqlKTKPLwqt8v00yQaFV oBSj5CLc3CnbQNH1TZCkAsivJ3lu+FgraiwQK/JKp8kssAGdHgaKyAHVr2vMr0PdBZrm bQ07ijuIXCMBC8HRu6AYRXxN7C+kaKJmrNrGfk6IQFkwPf4cmgMkgVXfESalkFWNGwI+ +7bzwhuYYqhaa0eLjG3N1MOlgnaB0UmWF+kWgVTtNJLV/fFV3cIXnbtjEWjQ9T2MfS0N rAtEkWtrf1GK2rqMsJKSwBDLTMU5d/e4muuV1P76tTEBnXqO65ND7cqKCDMglqwaBTPm fT5A== X-Gm-Message-State: APjAAAXyu4LYL1AsN++JhYKyFZK+/Ec69BQQHy3N82fhks8zeinHcUrf OwHGvYIp9FVhUG8QXe0DcDvbcg3/ X-Google-Smtp-Source: APXvYqyZVD1u2Fprbi2Z46JCYije7AL8+ij7toiPDQdPSpMZTCv+CcxCCjDpsyk8zbY545OC02G0Vg== X-Received: by 2002:a05:600c:114f:: with SMTP id z15mr9265708wmz.104.1558945165520; Mon, 27 May 2019 01:19:25 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id a124sm7511876wmh.3.2019.05.27.01.19.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 01:19:25 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 12/13] drm/virtio: drop DRM_AUTH usage from the driver Date: Mon, 27 May 2019 09:17:40 +0100 Message-Id: <20190527081741.14235-12-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190527081741.14235-1-emil.l.velikov@gmail.com> References: <20190527081741.14235-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bGo+wmfdMFNtr1n5PzMjqu4298v/kiu+NsJd7STGsfY=; b=DEgdxNrKgBZYo//4TQnq9pRScePESu2k3EUK0vCL8OX9uFkHxxyLMmFWVrm5bp+dMw O1id/TRhkXrvWY9eieCmsrcQkuIuxx5KtNLxBUb4Efgm9x1UJPxxg1eldOHI/FD862L/ x5fnlCAsHz67w8TCF7oh/AL0cTIrGSTkvu/yuOJwoHQC0wfaiSTQ1vgGOFXt5/DJTaoD C+p5teDn921KesiinoYqauVHXG3ehpt6KyMDd6vAU6LzXM9Hot1nNAGq6lgdyBEPSPbn par945U0E6VLbpvKpdDSmg4HckQbpRd+ailTV0zvlVSkVTPqk5aN2rGz0zKrg5VNPfbs BZYA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com, Gerd Hoffmann , virtualization@lists.linux-foundation.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Emil Velikov The authentication can be circumvented, by design, by using the render node. From the driver POV there is no distinction between primary and render nodes, thus we can drop the token. Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 949a264985fc..e72626faba52 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -553,34 +553,34 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev, struct drm_ioctl_desc virtio_gpu_ioctls[DRM_VIRTIO_NUM_IOCTLS] = { DRM_IOCTL_DEF_DRV(VIRTGPU_MAP, virtio_gpu_map_ioctl, - DRM_AUTH | DRM_UNLOCKED | DRM_RENDER_ALLOW), + DRM_UNLOCKED | DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(VIRTGPU_EXECBUFFER, virtio_gpu_execbuffer_ioctl, - DRM_AUTH | DRM_UNLOCKED | DRM_RENDER_ALLOW), + DRM_UNLOCKED | DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(VIRTGPU_GETPARAM, virtio_gpu_getparam_ioctl, - DRM_AUTH | DRM_UNLOCKED | DRM_RENDER_ALLOW), + DRM_UNLOCKED | DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(VIRTGPU_RESOURCE_CREATE, virtio_gpu_resource_create_ioctl, - DRM_AUTH | DRM_UNLOCKED | DRM_RENDER_ALLOW), + DRM_UNLOCKED | DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(VIRTGPU_RESOURCE_INFO, virtio_gpu_resource_info_ioctl, - DRM_AUTH | DRM_UNLOCKED | DRM_RENDER_ALLOW), + DRM_UNLOCKED | DRM_RENDER_ALLOW), /* make transfer async to the main ring? - no sure, can we * thread these in the underlying GL */ DRM_IOCTL_DEF_DRV(VIRTGPU_TRANSFER_FROM_HOST, virtio_gpu_transfer_from_host_ioctl, - DRM_AUTH | DRM_UNLOCKED | DRM_RENDER_ALLOW), + DRM_UNLOCKED | DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(VIRTGPU_TRANSFER_TO_HOST, virtio_gpu_transfer_to_host_ioctl, - DRM_AUTH | DRM_UNLOCKED | DRM_RENDER_ALLOW), + DRM_UNLOCKED | DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(VIRTGPU_WAIT, virtio_gpu_wait_ioctl, - DRM_AUTH | DRM_UNLOCKED | DRM_RENDER_ALLOW), + DRM_UNLOCKED | DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(VIRTGPU_GET_CAPS, virtio_gpu_get_caps_ioctl, - DRM_AUTH | DRM_UNLOCKED | DRM_RENDER_ALLOW), + DRM_UNLOCKED | DRM_RENDER_ALLOW), };