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 (Arm)" X-Patchwork-Id: 9168041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 66638607DA for ; Thu, 9 Jun 2016 21:19:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5514324B44 for ; Thu, 9 Jun 2016 21:19:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4764A28338; Thu, 9 Jun 2016 21:19:34 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0883624B44 for ; Thu, 9 Jun 2016 21:19:33 +0000 (UTC) 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" X-Virus-Scanned: ClamAV using ClamSMTP 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), };