From patchwork Thu Jun 9 21:19:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 69732 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp534080qgf; Thu, 9 Jun 2016 14:19:34 -0700 (PDT) X-Received: by 10.66.168.13 with SMTP id zs13mr14449407pab.68.1465507174719; Thu, 09 Jun 2016 14:19:34 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTP id e21si9411683pfj.74.2016.06.09.14.19.34; Thu, 09 Jun 2016 14:19:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) 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 DD5DE6EC7C; Thu, 9 Jun 2016 21:19:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oi0-f67.google.com (mail-oi0-f67.google.com [209.85.218.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 466A96EC7C for ; Thu, 9 Jun 2016 21:19:28 +0000 (UTC) Received: by mail-oi0-f67.google.com with SMTP id k63so9834188oib.2 for ; Thu, 09 Jun 2016 14:19:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nW4I7T2ceZQY274/Vdbl1BdsIlrKjaRTzpX7OYDpepE=; b=mprs1+GC8SmII80NrJOCkCtJ2j98NV8em16JZiccKsuh5aCx9oiozGdmjboAquI+tw ZXLj7fcEgcuv0MqNsvc2/c9t0/HxCfoOCZJsQ2oUUoAVS1xpIfg4prKZzF+wlyqhvvyQ r6fBVvP5eNE5V1QRgg10cMeKf9vN2gRqH2NDcRgz1xooK6O+LSqgkxue8bARhXmCXOou AqgpNcpEF3LqDZBUTnQ1lyECLruYnhCyGqG8Sw+Tsoszb6QY/NESW0WTu/9bUFx1wWAq vBXiKM7KDgE2Xh427YuIpzvGLONP+Fep+qtmzKOc871tlA+JF8UdJVhCA+8zpXdXbugv 9Zuw== X-Gm-Message-State: ALyK8tLcu9KZoI3FiXNXAqxcMF1cVyeL5VyVPEnbRJ9pYdTrj1qohGu/nakJoibUR1FNGg== X-Received: by 10.202.89.68 with SMTP id n65mr6346092oib.138.1465507167088; Thu, 09 Jun 2016 14:19:27 -0700 (PDT) Received: from rob-hp-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by smtp.googlemail.com with ESMTPSA id e184sm3736463oia.11.2016.06.09.14.19.26 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Jun 2016 14:19:26 -0700 (PDT) From: Rob Herring To: Eric Anholt Subject: [PATCH 1/2] drm: vc4: set permissions for ioctls Date: Thu, 9 Jun 2016 16:19:24 -0500 Message-Id: <1465507165-16345-1-git-send-email-robh@kernel.org> X-Mailer: git-send-email 2.7.4 Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Ioctls generally have DRM_AUTH and DRM_RENDER_ALLOW set to restrict them to authorized clients and render nodes. Without this, access from render nodes fails. Signed-off-by: Rob Herring --- drivers/gpu/drm/vc4/vc4_drv.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 3446ece..2077589 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -66,12 +66,18 @@ static const struct file_operations vc4_drm_fops = { }; static const struct drm_ioctl_desc vc4_drm_ioctls[] = { - DRM_IOCTL_DEF_DRV(VC4_SUBMIT_CL, vc4_submit_cl_ioctl, 0), - DRM_IOCTL_DEF_DRV(VC4_WAIT_SEQNO, vc4_wait_seqno_ioctl, 0), - DRM_IOCTL_DEF_DRV(VC4_WAIT_BO, vc4_wait_bo_ioctl, 0), - DRM_IOCTL_DEF_DRV(VC4_CREATE_BO, vc4_create_bo_ioctl, 0), - DRM_IOCTL_DEF_DRV(VC4_MMAP_BO, vc4_mmap_bo_ioctl, 0), - DRM_IOCTL_DEF_DRV(VC4_CREATE_SHADER_BO, vc4_create_shader_bo_ioctl, 0), + DRM_IOCTL_DEF_DRV(VC4_SUBMIT_CL, vc4_submit_cl_ioctl, + DRM_AUTH | DRM_RENDER_ALLOW), + DRM_IOCTL_DEF_DRV(VC4_WAIT_SEQNO, vc4_wait_seqno_ioctl, + DRM_AUTH | DRM_RENDER_ALLOW), + DRM_IOCTL_DEF_DRV(VC4_WAIT_BO, vc4_wait_bo_ioctl, + DRM_AUTH | DRM_RENDER_ALLOW), + DRM_IOCTL_DEF_DRV(VC4_CREATE_BO, vc4_create_bo_ioctl, + DRM_AUTH | DRM_RENDER_ALLOW), + DRM_IOCTL_DEF_DRV(VC4_MMAP_BO, vc4_mmap_bo_ioctl, + DRM_AUTH | DRM_RENDER_ALLOW), + DRM_IOCTL_DEF_DRV(VC4_CREATE_SHADER_BO, vc4_create_shader_bo_ioctl, + DRM_AUTH | DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl, DRM_ROOT_ONLY), };