From patchwork Fri Nov 1 13:03:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11223101 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C5F11515 for ; Fri, 1 Nov 2019 13:05:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23CC3217D9 for ; Fri, 1 Nov 2019 13:05:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23CC3217D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 202266E21E; Fri, 1 Nov 2019 13:05:12 +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 E124F6E21E for ; Fri, 1 Nov 2019 13:05:09 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id 6so8742601wmf.0 for ; Fri, 01 Nov 2019 06:05:09 -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:mime-version :content-transfer-encoding; bh=ImCE5nJq/DYo2Ok76YGyMffnMJmXxt+3gqtE07/WUSI=; b=fENz8N7m0OeqmbL0srL3jgpsAWcGW89zAbsj1eh+8XilIcoU8LhwYamoqQhJVCZYmC RhEM3wXNLhb9aezBsPWCZjzGI2spPKkZ0rMQhpyVi1m26I6gkhyyy27mm3mPffxhii6V g5Dqox9BHMBdooLz6tTiiprZjpB6+3xQ3IFn2pyqt3pguwIhK31DdD3WENcJxNKQfQmh qt5WWQO6MyXQtoHUyi/8ZFrFDJttUgbR2aRCv3PycTCXV+LoF1aElXS48kmwZpHKWL0g hDehs0mYvAz496QTR/+DbdR7DC8NJSGt95hBO6a9XyqP/S4S2Vx9YqvHOE7NeDniLeRh yYsw== X-Gm-Message-State: APjAAAXOPEROPSdXulAC+/RDCxN9D+3RkVISMU6cD+BQlCuo6FaY+9uW +0ptE6qJuFU7HniODUHz3ENJlkRK X-Google-Smtp-Source: APXvYqzjnXie8oyxobwQdtqji8WUXzhYkb/Dr5sBkWbjmRgNCHXCiWC9TGVN5+TnSeZinkv4jFySfA== X-Received: by 2002:a1c:16:: with SMTP id 22mr10887064wma.0.1572613507589; Fri, 01 Nov 2019 06:05:07 -0700 (PDT) Received: from arch-x1c3.cbg.collabora.co.uk ([2a00:5f00:102:0:9665:9cff:feee:aa4d]) by smtp.gmail.com with ESMTPSA id a15sm2450562wmm.12.2019.11.01.06.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 06:05:06 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/5] drm/vmwgfx: move the require_exist handling together Date: Fri, 1 Nov 2019 13:03:09 +0000 Message-Id: <20191101130313.8862-1-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.23.0 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:mime-version :content-transfer-encoding; bh=ImCE5nJq/DYo2Ok76YGyMffnMJmXxt+3gqtE07/WUSI=; b=cCjLvEeoKSNZfi/JAs0L9/InfUMN4ecIybnYK42YHI6MLFXrXIC4LXE1aFJq4B97sW bIWR4g3Uo1dtzB+LqvF4plqP+DyJZ7PmEnNYc0btx04TSQCTglCY7jtuHT/BR3/dVaZg 4JS4bLmnXXt6a90AtZOvSGFhigKCXXvtCWboggskiyoRi1rlBHZYtjBXwlO06ZXa0ejD rtfk7QomTER+TWhctwADWdIzVQTZOJ7k/SUkh+klx1Mr78ZtoA9qgTDmN0tYGMfqJ/63 AUpH9x/hvJj526j3Upl+s4FvNtDoOTE1RXr0ehpQ3KcICY3QvmtN2eDdgPtxPhY/ksBQ KIcw== 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: VMware Graphics , Thomas Hellstrom , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Move the render_client hunk for require_exist alongside the rest. Keeping all the reasons why an existing object is needed, in a single place makes it easier to follow. Cc: VMware Graphics Cc: Thomas Hellstrom Signed-off-by: Emil Velikov Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index 29d8794f0421..1f989f3605c8 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -909,16 +909,12 @@ vmw_surface_handle_reference(struct vmw_private *dev_priv, uint32_t handle; struct ttm_base_object *base; int ret; - bool require_exist = false; if (handle_type == DRM_VMW_HANDLE_PRIME) { ret = ttm_prime_fd_to_handle(tfile, u_handle, &handle); if (unlikely(ret != 0)) return ret; } else { - if (unlikely(drm_is_render_client(file_priv))) - require_exist = true; - handle = u_handle; } @@ -935,6 +931,8 @@ vmw_surface_handle_reference(struct vmw_private *dev_priv, } if (handle_type != DRM_VMW_HANDLE_PRIME) { + bool require_exist = false; + user_srf = container_of(base, struct vmw_user_surface, prime.base); @@ -946,6 +944,9 @@ vmw_surface_handle_reference(struct vmw_private *dev_priv, user_srf->master != file_priv->master) require_exist = true; + if (unlikely(drm_is_render_client(file_priv))) + require_exist = true; + ret = ttm_ref_object_add(tfile, base, TTM_REF_USAGE, NULL, require_exist); if (unlikely(ret != 0)) { From patchwork Fri Nov 1 13:03:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11223105 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 237FB1747 for ; Fri, 1 Nov 2019 13:05:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B0B3217D9 for ; Fri, 1 Nov 2019 13:05:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B0B3217D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D5A66E21F; Fri, 1 Nov 2019 13:05:13 +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 435D96E21E for ; Fri, 1 Nov 2019 13:05:11 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id 11so9299552wmk.0 for ; Fri, 01 Nov 2019 06:05:11 -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=ll9eeyCkfU/EMzR1UDcgIxHkDALIOtrpeq3qFTQ/A3g=; b=hnfGKIIKuDRMW9jabp7F3b1HSJcOHvcxFx7eLl14MBGgk07RjxbCICdLSaryaHRzjt XlLqWmS2me2ZGJpAHfHKwDPEK/hqBAmh7WhxpzCBt68lyjz5t9PKVuir9w/FqupC+ikg C0MBnO6aE1AIqaGSVodsrpoleSkVNteWw7B5rvkaYxGU7SEMH9aSvtIvzKYskoZMuwZd 61GSkUQ9MqCkEHt2ToqgIw2t4/p1t2TThYGNfy+h48aoh8cOEe9T60p8OuMWamWicg3d E62Xhm2Api7lMCGb9frh2uQ/yRyj1zlHUzAmT+eEZ9TEQ9r0FuNTMHiU6XOcWXtgfPgB GzzA== X-Gm-Message-State: APjAAAVKAN4697Rl7kHXcAY5MnaF77SpegkrJKGeOrHlvDMi0Kc0gWxW +RmcIsnFs5Vm9PwwZRfrmeKwUhWC X-Google-Smtp-Source: APXvYqw9ZK4XM7bgq9LfycVRO4MO2UCIUO/mA3mwniyNaY/oO5tCz3U3jcF1s2XUnCgOcgEKVRkgdQ== X-Received: by 2002:a7b:cb89:: with SMTP id m9mr8250573wmi.141.1572613508560; Fri, 01 Nov 2019 06:05:08 -0700 (PDT) Received: from arch-x1c3.cbg.collabora.co.uk ([2a00:5f00:102:0:9665:9cff:feee:aa4d]) by smtp.gmail.com with ESMTPSA id a15sm2450562wmm.12.2019.11.01.06.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 06:05:07 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/5] drm/vmwgfx: check master authentication in surface_ref ioctls Date: Fri, 1 Nov 2019 13:03:10 +0000 Message-Id: <20191101130313.8862-2-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191101130313.8862-1-emil.l.velikov@gmail.com> References: <20191101130313.8862-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=ll9eeyCkfU/EMzR1UDcgIxHkDALIOtrpeq3qFTQ/A3g=; b=YqJMzMQkn6Gci/rGM1NxNVkt6VenoqsAhC27NhEKC43F4CJ9Fo3EKnhfqpsHeHah/H W8bpTl4Wysl5b6LcxKHOT+SSxP3EtqbPsoPr+wAo8PM2L1Px/inxLY62k094Xf3uEMxZ c0V6STJmAYeeJfUykl9/npyUKyR9In5oLvTfPCXJHqNrGWAov+s+v5Ns18CRJrT1/ip/ O/NVISvqyEJVmDXSd7qp7ObqylXnqc/yhYdndPQUBsIdKueiTrpxq4DO/Sx2J6CrhRSk pwUSMdqFI4FhjV7Vq3HEC/rHYKNQZPVvVVoV43ywxqF4/6Un6sRZumURr9erci579odo qUIg== 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: VMware Graphics , Thomas Hellstrom , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov With later commit we'll rework DRM authentication handling. Namely DRM_AUTH will not be a requirement for DRM_RENDER_ALLOW ioctls. Since vmwgfx does isolation for primary clients in different master realms, the DRM_AUTH can be dropped. The only place where authentication matters, is surface_reference ioctls whenever a legacy (non-prime) handle is used. For those ioctls we call vmw_surface_handle_reference(), where we explicitly check if the client is both a) master and b) unauthenticated - bailing out as result. Otherwise the usual isolation path kicks in and we're all good. v2: Reword commit message, since the isolation work has landed. Cc: VMware Graphics Cc: Thomas Hellstrom Signed-off-by: Emil Velikov Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index 1f989f3605c8..596e5c1bc2c1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -936,6 +936,13 @@ vmw_surface_handle_reference(struct vmw_private *dev_priv, user_srf = container_of(base, struct vmw_user_surface, prime.base); + /* Error out if we are unauthenticated master */ + if (drm_is_primary_client(file_priv) && + !file_priv->authenticated) { + ret = -EACCES; + goto out_bad_resource; + } + /* * Make sure the surface creator has the same * authenticating master, or is already registered with us. From patchwork Fri Nov 1 13:03:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11223103 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2697E1515 for ; Fri, 1 Nov 2019 13:05:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E742217D9 for ; Fri, 1 Nov 2019 13:05:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E742217D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ECD226E220; Fri, 1 Nov 2019 13:05:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 89BD76E21F for ; Fri, 1 Nov 2019 13:05:11 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id t26so4934035wmi.4 for ; Fri, 01 Nov 2019 06:05:11 -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=G87VbVz+o5pgqI4V0CBHVR1bmpr5S1GZp67zfuGGaJU=; b=jRO9VOtJzr5WajVRSwgXjtlcJ2hWTPwIRIr9ZPkTEBhMuoAoZwDt7B0h+5zdx09B9Y GA1YR4yg5KKh5TWtqQAI2A+XanCxewwJQmYD6Y+qlUFEa5RJ8LKNHrMB+M7yqKfDs+g6 0mzwourdbQvJM1qqjEpFmzqo47R3anGzqqTOAjvxGBt9REtMY1tRRZHX9sJ5nECfpXZf 0aDfRbTV2xvagpMDxXhVwtSUOP/Lfx5+p2xsypbL+2s9E0TgFQI/gmbKpORKaO+yjfiD EYpKTRhpzpErSmIBdDAkkK1kd9o52kNCyYu05YyGYXY/ubbzpcuiH6WNUZ3ZqMsrs3zP MlCw== X-Gm-Message-State: APjAAAXV+IQ+Gct18sVTUdC3ygmns444LRGC5G7H+Gcm8VUg8Ke6sto4 2WO3OVOJV77ir8Aob8ufH9oB2zl9 X-Google-Smtp-Source: APXvYqywOWzKfv/0/HOb9Yo5Jb5oNbRi51XMOQ8uC/9uoiggvqbvqQViagYICB3tk82XMquHUuwipA== X-Received: by 2002:a05:600c:1150:: with SMTP id z16mr10567126wmz.153.1572613509671; Fri, 01 Nov 2019 06:05:09 -0700 (PDT) Received: from arch-x1c3.cbg.collabora.co.uk ([2a00:5f00:102:0:9665:9cff:feee:aa4d]) by smtp.gmail.com with ESMTPSA id a15sm2450562wmm.12.2019.11.01.06.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 06:05:08 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/5] drm/vmwgfx: drop DRM_AUTH for render ioctls Date: Fri, 1 Nov 2019 13:03:11 +0000 Message-Id: <20191101130313.8862-3-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191101130313.8862-1-emil.l.velikov@gmail.com> References: <20191101130313.8862-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=G87VbVz+o5pgqI4V0CBHVR1bmpr5S1GZp67zfuGGaJU=; b=kwqZkhCSTf8LhZHDC0OVQzzlVVSO8ZHhlqhjwuzBy1wvf38VvebQP3AK0kVaBE2B/Z aLdEXYgmF+lXt8ZcGS7iKU3Q0mF8vkNkgNzAk1ldVSZtjJkVPEpXdfFry10M6ISlV1Ak iitbNm9ND9G0HbC9iYTt+ielmJmbABSiIDVGYVVWa7Zw0nktjsRF/ZB7+U1YAOicYy2G KdlWKj2ShjLijMboGZNQ/ImfChWimffQmh80QequWJ8g4abUwBNqvsm0Z/sOJQFUqnLc EWRrAWEvu+ugFmcZWV40oQbPrIyRp8DhQfRj/dgklImFiYIxICNEtE0STQG7gNr74Eep v6aw== 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: VMware Graphics , Thomas Hellstrom , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov With earlier commit 9c84aeba67cc ("drm/vmwgfx: Kill unneeded legacy security features") we removed the no longer applicable validation, as we now have isolation of primary clients from different master realms. As of last commit, we're explicitly checking for authentication in the only render ioctls which care about one. With those in place, the DRM_AUTH token serves no real purpose. Let's drop it. Cc: VMware Graphics Cc: Thomas Hellstrom Signed-off-by: Emil Velikov Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 81a95651643f..253fae160175 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -165,9 +165,9 @@ static const struct drm_ioctl_desc vmw_ioctls[] = { VMW_IOCTL_DEF(VMW_GET_PARAM, vmw_getparam_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_ALLOC_DMABUF, vmw_bo_alloc_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_UNREF_DMABUF, vmw_bo_unref_ioctl, DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_CURSOR_BYPASS, @@ -182,16 +182,16 @@ static const struct drm_ioctl_desc vmw_ioctls[] = { DRM_MASTER), VMW_IOCTL_DEF(VMW_CREATE_CONTEXT, vmw_context_define_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_UNREF_CONTEXT, vmw_context_destroy_ioctl, DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_CREATE_SURFACE, vmw_surface_define_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_UNREF_SURFACE, vmw_surface_destroy_ioctl, DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_REF_SURFACE, vmw_surface_reference_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), - VMW_IOCTL_DEF(VMW_EXECBUF, vmw_execbuf_ioctl, DRM_AUTH | + DRM_RENDER_ALLOW), + VMW_IOCTL_DEF(VMW_EXECBUF, vmw_execbuf_ioctl, DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_FENCE_WAIT, vmw_fence_obj_wait_ioctl, DRM_RENDER_ALLOW), @@ -201,9 +201,9 @@ static const struct drm_ioctl_desc vmw_ioctls[] = { VMW_IOCTL_DEF(VMW_FENCE_UNREF, vmw_fence_obj_unref_ioctl, DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_FENCE_EVENT, vmw_fence_event_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_GET_3D_CAP, vmw_get_cap_3d_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), /* these allow direct access to the framebuffers mark as master only */ VMW_IOCTL_DEF(VMW_PRESENT, vmw_present_ioctl, @@ -221,28 +221,28 @@ static const struct drm_ioctl_desc vmw_ioctls[] = { DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_CREATE_SHADER, vmw_shader_define_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_UNREF_SHADER, vmw_shader_destroy_ioctl, DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_GB_SURFACE_CREATE, vmw_gb_surface_define_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_GB_SURFACE_REF, vmw_gb_surface_reference_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_SYNCCPU, vmw_user_bo_synccpu_ioctl, DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_CREATE_EXTENDED_CONTEXT, vmw_extended_context_define_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_GB_SURFACE_CREATE_EXT, vmw_gb_surface_define_ext_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_GB_SURFACE_REF_EXT, vmw_gb_surface_reference_ext_ioctl, - DRM_AUTH | DRM_RENDER_ALLOW), + DRM_RENDER_ALLOW), }; static const struct pci_device_id vmw_pci_id_list[] = { From patchwork Fri Nov 1 13:03:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11223109 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2831E1515 for ; Fri, 1 Nov 2019 13:05:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 107EE217F9 for ; Fri, 1 Nov 2019 13:05:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 107EE217F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74BBC6F7CE; Fri, 1 Nov 2019 13:05:18 +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 7D0BB6E223 for ; Fri, 1 Nov 2019 13:05:13 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id t26so4934122wmi.4 for ; Fri, 01 Nov 2019 06:05:13 -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=3IVyhJFBg6AmCFnEdT3lCIZl0TWBzR6nJQgjh9Ae8SU=; b=XpXFcnIexO/2J9GdkISKvhWMvnheVhAIVlqJpd3qixE9nECjCxeNqVbEmvdDi+NbhH ZHhjviVqy9VUrZkFxoAgThVU1qlBFVnXVOfcnvp4R2wNIhvS0rE7/tMWcuQAGE9hc1Gi abwI6wG4e6cUUQYBL6Uj4005yRE6BfeN7sKkH/hCBhTfBzqnHdw20Z3IRVYtzjxSiOm3 uGAuM9KI/NXfQh67brdjH++J8AnFjejEQXOKil+X23BJjJtJ5sIzUglmKWR7LMEPRgkB t/4RWpV4NL7Jln4jpKThqKY1r/2eAQRUlZKNRPGqt31LmCccl3TZftU7yutCHbij6b2Z jzQQ== X-Gm-Message-State: APjAAAXFZVaMMA1WaTWZ0UMEeAKHWK3jvgyz3y2+JofcCW3guDxgAEW6 6d3goFd045TTTz05tmMhuqN0pnSc X-Google-Smtp-Source: APXvYqwiIH70sMtyI+njg4Wgzd3JLPXiBlya1sWilkS6Eo6q6QR0cMsP8916ExJelCDZCZ8vdqi9tw== X-Received: by 2002:a1c:4c11:: with SMTP id z17mr9616143wmf.59.1572613510923; Fri, 01 Nov 2019 06:05:10 -0700 (PDT) Received: from arch-x1c3.cbg.collabora.co.uk ([2a00:5f00:102:0:9665:9cff:feee:aa4d]) by smtp.gmail.com with ESMTPSA id a15sm2450562wmm.12.2019.11.01.06.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 06:05:10 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/5] drm/panfrost: remove DRM_AUTH and respective comment Date: Fri, 1 Nov 2019 13:03:12 +0000 Message-Id: <20191101130313.8862-4-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191101130313.8862-1-emil.l.velikov@gmail.com> References: <20191101130313.8862-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=3IVyhJFBg6AmCFnEdT3lCIZl0TWBzR6nJQgjh9Ae8SU=; b=ndOaYt+a6o98bEuRUvjDHtw9OlGyNIiOh3uBtLlwD7GvAidMvap+4Zwi1dy926/YFp jh9PO8UPxwCUM+GrTQD/gm5vdcD59AWFZJu9EpKfQUDhu0seBBcRUR9N0lfgBnsnI4By bigWwJx0SXGjqR+7slvX8aHd+TD8udICFQ9y/ezQ1UdOa+NxWBkV/0cBQWTK5u5XDrhb EHsYP9LiSTPVUQPhPf8ThnyIyZAJPtURWD+X/4jbFpzlzPiHqzdz3u9I8x5eP4HfUsDY u5k9vLCV0wo4OvP9XXOmyF3sq2A0/jhnzrNxVyr0GrBUEjaKpUZ50zVXzAnwG/RXPuTy 0mmQ== 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: Tomeu Vizoso , David Airlie , emil.l.velikov@gmail.com, Steven Price , Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov As of earlier commit we have address space separation. Yet we forgot to remove the respective comment and DRM_AUTH in the ioctl declaration. Cc: Tomeu Vizoso Cc: David Airlie Cc: Daniel Vetter Cc: Robin Murphy Cc: Steven Price Fixes: 7282f7645d06 ("drm/panfrost: Implement per FD address spaces") Signed-off-by: Emil Velikov Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index bc2ddeb55f5d..c677b2c9e409 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -451,15 +451,11 @@ panfrost_postclose(struct drm_device *dev, struct drm_file *file) kfree(panfrost_priv); } -/* DRM_AUTH is required on SUBMIT for now, while all clients share a single - * address space. Note that render nodes would be able to submit jobs that - * could access BOs from clients authenticated with the master node. - */ static const struct drm_ioctl_desc panfrost_drm_driver_ioctls[] = { #define PANFROST_IOCTL(n, func, flags) \ DRM_IOCTL_DEF_DRV(PANFROST_##n, panfrost_ioctl_##func, flags) - PANFROST_IOCTL(SUBMIT, submit, DRM_RENDER_ALLOW | DRM_AUTH), + PANFROST_IOCTL(SUBMIT, submit, DRM_RENDER_ALLOW), PANFROST_IOCTL(WAIT_BO, wait_bo, DRM_RENDER_ALLOW), PANFROST_IOCTL(CREATE_BO, create_bo, DRM_RENDER_ALLOW), PANFROST_IOCTL(MMAP_BO, mmap_bo, DRM_RENDER_ALLOW), From patchwork Fri Nov 1 13:03:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11223107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08B9C1599 for ; Fri, 1 Nov 2019 13:05:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4D8A217D9 for ; Fri, 1 Nov 2019 13:05:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4D8A217D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 85C426E223; Fri, 1 Nov 2019 13:05:15 +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 4620B6F7CE; Fri, 1 Nov 2019 13:05:14 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id q70so9280305wme.1; Fri, 01 Nov 2019 06:05:14 -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=zi3i9mgv8VFMbmyTgvnufacfN7CC/6vf66SThdAH3gg=; b=EzIrxF4SCODaI4wN89djGHS9fa6fUKAAzxNFYNvK4Lo3SUVeuSjABgxdDTpTzEnOmO 8T+48A2Ov1fDrygdPT6QiwQ2A4N+ngZq6bsJ1qr0TklZVexc+F5TzBOzYCnTE0oNTQyi /u16GMMqnWoyaqsAfvR2MU4XQGYNJtkNAuLcFU6kRBp6BPQ339vuR7UDowRPw29N3JwY SgS1Qv7n4E/8XTbcUEdZtbI+JMXuXP9aC1PfB1OuHephfNwGrgeMVEJwuKuec6PhLdkF moOeQAI9FuvBoTOTE4ho59QSbu17ijVQ0+YzGHPEYwGGVgkGn8R4FgFHJHfU8kgmYxmd P0XA== X-Gm-Message-State: APjAAAWj2P99KcNcsUYbJWfp6JFgHs35tQR47Ko7X8sVAjeLyBRcJKvv on6kBJ7fBI23REeisDwNxkT5xeUG X-Google-Smtp-Source: APXvYqxHh81AXEhkaU+ZJuif3t2u4n9b1mo4TV8GaOshHhflyXrrzKLGROCOWKFwqCyXZQ+4/LWXdQ== X-Received: by 2002:a1c:f302:: with SMTP id q2mr10501386wmq.142.1572613512233; Fri, 01 Nov 2019 06:05:12 -0700 (PDT) Received: from arch-x1c3.cbg.collabora.co.uk ([2a00:5f00:102:0:9665:9cff:feee:aa4d]) by smtp.gmail.com with ESMTPSA id a15sm2450562wmm.12.2019.11.01.06.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 06:05:11 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/5] drm: drop DRM_AUTH from PRIME_TO/FROM_HANDLE ioctls Date: Fri, 1 Nov 2019 13:03:13 +0000 Message-Id: <20191101130313.8862-5-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191101130313.8862-1-emil.l.velikov@gmail.com> References: <20191101130313.8862-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=zi3i9mgv8VFMbmyTgvnufacfN7CC/6vf66SThdAH3gg=; b=gBBYmLhzaS3mgtcaUH+0inAH/OyO7/wNqobjUminYwAKDZfdlkihuKU2YM8RR25VMg U2/7BJXFGnLl5TrCJ0Cb9q0k6YnbhGdGT773Pw4lrhUtHoRt3dQfbi0k7IoobxxfHBuh CWUJz4doYZtTdqC1l+Pqqkk0sx6EqQa7PTYLC63liJ+Ik4ynQ/ZhPSwMNuYEjRYc6w1Z vLqkso1GnWlLmatO3q5/R5snDiJN+hMKhW1CuVjPbNjYlZxfwGmDYiTDcGnSuvnCVEdb u998azT2jzTEJA3u77fc3Zq1UYRdVGaaLI8Np4VnAxb3M2BHA66Hq6aBl1i8MKN7hP7z pVcQ== 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: Alex Deucher , Sean Paul , emil.l.velikov@gmail.com, amd-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov As mentioned by Christian, for drivers which support only primary nodes this changes the returned error from -EACCES into -EOPNOTSUPP/-ENOSYS. For others, this check in particular will be a noop. So let's remove it as suggested by Christian. Cc: Alex Deucher Cc: amd-gfx@lists.freedesktop.org Cc: Daniel Vetter Cc: Sean Paul Acked-by: Christian König Signed-off-by: Emil Velikov Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index fcd728d7cf72..5afb39688b55 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -652,8 +652,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = { DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETRESOURCES, drm_mode_getresources, 0), - DRM_IOCTL_DEF(DRM_IOCTL_PRIME_HANDLE_TO_FD, drm_prime_handle_to_fd_ioctl, DRM_AUTH|DRM_RENDER_ALLOW), - DRM_IOCTL_DEF(DRM_IOCTL_PRIME_FD_TO_HANDLE, drm_prime_fd_to_handle_ioctl, DRM_AUTH|DRM_RENDER_ALLOW), + DRM_IOCTL_DEF(DRM_IOCTL_PRIME_HANDLE_TO_FD, drm_prime_handle_to_fd_ioctl, DRM_RENDER_ALLOW), + DRM_IOCTL_DEF(DRM_IOCTL_PRIME_FD_TO_HANDLE, drm_prime_fd_to_handle_ioctl, DRM_RENDER_ALLOW), DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPLANERESOURCES, drm_mode_getplane_res, 0), DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETCRTC, drm_mode_getcrtc, 0),