From patchwork Wed Dec 19 19:22:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 10738031 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 D4E1514DE for ; Wed, 19 Dec 2018 19:25:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3D5127D29 for ; Wed, 19 Dec 2018 19:25:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7ED927E5A; Wed, 19 Dec 2018 19:25:41 +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 5B6FB27D29 for ; Wed, 19 Dec 2018 19:25:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5DA416F169; Wed, 19 Dec 2018 19:25:39 +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 061816F169 for ; Wed, 19 Dec 2018 19:25:36 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id y185so10249089wmd.1 for ; Wed, 19 Dec 2018 11:25:35 -0800 (PST) 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=ng57qfuULVl+QfSEngJ+uYqLaNdZ5BkQdHPe0AS5zAs=; b=hhZYhKrI8zxI1byvZRvH+YTmRex8tsCuicHRRvVPETZxnthVy8QAT0w0vaWQPQ1rGu qLtZoY4+0dyfZkSo7leVaGVWCDK/JYTkGmTkSluRIjbAU+cKW53IK/B3aRWLEF0mmtQK 23wRdQ72otE18ddN8ZunJVfFI2iKNbrlsq4XTyBtSFuYwsjIpmRY6zVWHN4UwhHhdn4H TfolADAJmYsp80XToP4nU1G1AjhcgWPi/hnMNvhoD3nihVeiCx6SWGJ8/CqR9GGmWwn3 h7E22n66V0LgBLoI4j3HGGmaXHw9ISb69SrjZjtnko73F+KfLJ+AY4ccZaadGhfOH3E3 4xRg== X-Gm-Message-State: AA+aEWbvdevp1lqp0/AsrBI9fWRwxWADtky2GxdNj+06qwRChBah3C84 QxQaJqmhRvY+03ujIoRuEYkK+7Bwxkc= X-Google-Smtp-Source: AFSGD/W0oS6BA16y3FqBsLfaagYtTkEx452C6EPcqWXVgmyOgORjr+UcaMZU6v+D70Vnr4aUw5TK4Q== X-Received: by 2002:a1c:f8f:: with SMTP id 137mr8171004wmp.96.1545247534146; Wed, 19 Dec 2018 11:25:34 -0800 (PST) Received: from arch-x1c3.cbg.collabora.co.uk ([2a00:5f00:102:0:9665:9cff:feee:aa4d]) by smtp.gmail.com with ESMTPSA id c9sm7385483wmh.27.2018.12.19.11.25.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 11:25:33 -0800 (PST) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm: change DROP_MASTER permissions to allow DRM_MASTER Date: Wed, 19 Dec 2018 19:22:45 +0000 Message-Id: <20181219192247.29880-2-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181219192247.29880-1-emil.l.velikov@gmail.com> References: <20181219192247.29880-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Emil Velikov Currently only DRM_ROOT_ONLY is allowed to call the ioctl. Change that to DRM_MASTER, which means that only a process that is the current DRM master can drop it. Which makes sense, the process should be able to opt-out without any specific requirements. Signed-off-by: Emil Velikov --- drivers/gpu/drm/drm_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 94bd872d56c4..2221c8857fb0 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -578,7 +578,7 @@ static const struct drm_ioctl_desc drm_ioctls[] = { DRM_IOCTL_DEF(DRM_IOCTL_GET_SAREA_CTX, drm_legacy_getsareactx, DRM_AUTH), DRM_IOCTL_DEF(DRM_IOCTL_SET_MASTER, drm_setmaster_ioctl, DRM_UNLOCKED|DRM_ROOT_ONLY), - DRM_IOCTL_DEF(DRM_IOCTL_DROP_MASTER, drm_dropmaster_ioctl, DRM_UNLOCKED|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_DROP_MASTER, drm_dropmaster_ioctl, DRM_UNLOCKED|DRM_MASTER), DRM_IOCTL_DEF(DRM_IOCTL_ADD_CTX, drm_legacy_addctx, DRM_AUTH|DRM_ROOT_ONLY), DRM_IOCTL_DEF(DRM_IOCTL_RM_CTX, drm_legacy_rmctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),