From patchwork Mon May 27 08:17:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 10962235 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 A9F9B13AD for ; Mon, 27 May 2019 08:19:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C68928A05 for ; Mon, 27 May 2019 08:19:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90D5C28AB9; Mon, 27 May 2019 08:19:27 +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 1D7BF28A05 for ; Mon, 27 May 2019 08:19:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0993C89954; Mon, 27 May 2019 08:19:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2124189838 for ; Mon, 27 May 2019 08:19:18 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id y3so15204745wmm.2 for ; Mon, 27 May 2019 01:19:18 -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=3ohXizjfAaR462L3eOhvMCvBzEMDgTc7BEV6UBo4dGE=; b=LYt6+pCY+4mQGQltHZwS1IXeF/12PWuHQbDbOAVfmoDthq5MNz33eO8u79QObfOBYb 7UmeEq4RGjag6RNr+1JSLEjKIs9ZjexLlod7ZxEpy2PADOQ21laSxvmlBVK30FCMS/OA DYQhZe9vtwWrf55Vs+jFg0dhGlEa6RHXieb0hSiiqlTh8dCkyLV/g1livsOXAxRe7eML 38ayMFtXiJuqw8Nb1M7bVdbtcpIqhbNEOLwUZrodp3KFgCbaPdKXvHg9k9CplU2tmM61 321VxFNzML8Lo9yzyKctiP4JOYptcN/GqwXz7XP/8oYJPzCucDvL2AsBWyiBcisBt34K grRw== X-Gm-Message-State: APjAAAVVr8n8SgK3xC2rQniRXhxDIA3L/WiqIWkMhvNlC+E1I67xxdI2 dFcndEltRh8WbM7DyiOu6Y8HUB2L X-Google-Smtp-Source: APXvYqwM7nYzliBoIjpj58mCPP/+W/58TrYzTpfoxNejsGEBc3js5DryEqMOVBbs2kTJ3p7CLvVQ2w== X-Received: by 2002:a7b:c3c3:: with SMTP id t3mr26065327wmj.88.1558945156587; Mon, 27 May 2019 01:19:16 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 May 2019 01:19:16 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 04/13] drm/exynos: drop DRM_AUTH from DRM_RENDER_ALLOW ioctls Date: Mon, 27 May 2019 09:17:32 +0100 Message-Id: <20190527081741.14235-4-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=3ohXizjfAaR462L3eOhvMCvBzEMDgTc7BEV6UBo4dGE=; b=rmw4CxgmbUUZCVNJPr2fRPED5on9xKPuk91IF6HnoRTBX4k7DWvoaef+lOv5fkJVKG MRZVEjpKMnWv/O/qUKjnuH9zrJ6CWyr9GhrMyQGwfLOS22FGYGKaP5OQ4rhBCqJj7vcY t4v8R2e0dVLI6b5evLtAl2xBGeQqyHOdTEMTPxInrwAsm1ki+f/SSgVB9Sbmk9Sksg0F KZMnh5GO1dEoRFKgR9ha90drp3eiBrFaRR/8zIhjT6cqtAW16+LQiTUGtUD1IKgZn3Sr yncUJN1CVNivZTTSFeeMe/xsWvxfZsBf13nHUrQ1HuXxl1rXfEZMHI7pjULXVgBrf4hA 9OKA== 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: emil.l.velikov@gmail.com, Seung-Woo Kim , Tobias Jakobi , Kyungmin Park 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: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Tobias Jakobi Signed-off-by: Emil Velikov Acked-by: Inki Dae --- Gents, I've looked around for userspace and found only libdrm - the exynos library + simple apps and the X driver. All of which are safe with this patch. Please have a look through other some open-source userspace that you have around. Tobias, you mentioned userspace projects (mpv, libretro, other) where you've added exynos backend. Can you please check they work fine with this patch? Thanks Emil --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index e1ef9dc9ebf3..b461d89accff 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -81,29 +81,29 @@ static const struct vm_operations_struct exynos_drm_gem_vm_ops = { static const struct drm_ioctl_desc exynos_ioctls[] = { DRM_IOCTL_DEF_DRV(EXYNOS_GEM_CREATE, exynos_drm_gem_create_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(EXYNOS_GEM_MAP, exynos_drm_gem_map_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(EXYNOS_GEM_GET, exynos_drm_gem_get_ioctl, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(EXYNOS_VIDI_CONNECTION, vidi_connection_ioctl, DRM_AUTH), DRM_IOCTL_DEF_DRV(EXYNOS_G2D_GET_VER, exynos_g2d_get_ver_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(EXYNOS_G2D_SET_CMDLIST, exynos_g2d_set_cmdlist_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(EXYNOS_G2D_EXEC, exynos_g2d_exec_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_RESOURCES, exynos_drm_ipp_get_res_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_CAPS, exynos_drm_ipp_get_caps_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(EXYNOS_IPP_GET_LIMITS, exynos_drm_ipp_get_limits_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(EXYNOS_IPP_COMMIT, exynos_drm_ipp_commit_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), }; static const struct file_operations exynos_drm_driver_fops = {