From patchwork Wed Aug 3 18:04:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 9261711 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 E7E2E60754 for ; Wed, 3 Aug 2016 18:05:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD9A1281F9 for ; Wed, 3 Aug 2016 18:05:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2A5228210; Wed, 3 Aug 2016 18:05:55 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 64B3728249 for ; Wed, 3 Aug 2016 18:05:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8973F6E895; Wed, 3 Aug 2016 18:05:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD3296E896 for ; Wed, 3 Aug 2016 18:05:04 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id i5so37519287wmg.2 for ; Wed, 03 Aug 2016 11:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Tcps8ducmDwWQIC5C8l8UVdOHLBSvzpkEGXLwagRUr0=; b=c+QRzgy7CMyDy8uibEMhlMpCXU+XbLwVpvxmat6qxyHHx4s6e2BYIVco96tR84cWPo DlGquO2ygGUTjMGOOxDzHmAIrcVIAN8KcnNhU1qtm4ilGWpTVpUmwSuu6Jj19W0h2N3q nz4uJRwLeAGHDZUKcWFWiBxvl9i3tADTaPqoSsOeHCYVorEcRHrEuFkFymlRdPLd+g4r 13P8t3uLBW7R/FuwtEKaWytL+U6065JQCP7M35SLIrbrxiF75FAg2ZPDeSRxirBQYqub fcSekoZydO+j/1DGZbjTjSFUWn9zZQtL9pFZPB0wttssrjmFMC9OWJdAVd43lyz7j/Cv w8qg== 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:in-reply-to :references; bh=Tcps8ducmDwWQIC5C8l8UVdOHLBSvzpkEGXLwagRUr0=; b=hdbEYrEgWGRUOH1hjWwd1tYkGu+52lJxExceNJn1GQnZkUZMaKrzI7iTZlKplbYjcE 0HAFUDucSa0+MGCCWLHFBeYFSWhiMozy3lGBrTStoypShuuTax3+AvO9aOUe6xaNITFb pSccWJnnte0yJLN1oW/4g1TIBE4XSBcDYlzlh38tYxrs9kl8X8gXrxFnaweneXDgBHGW dI+zzbYjPXrYGzQgSFByfG867ZgeAngwoy+rmo61xObDS6RWZcmCnOx3jtlWmGhem4gz zv8vNvfYmXrUwpk2diBHmzm+Oe7AKcP2fRDT2WLcUX5MRrCGTODga/9TSGDB0QsXfMk0 vyeA== X-Gm-Message-State: AEkooutxvAn720PJXyYDiXWXyK8Q/mw99fSu1FBB/1A3CcFODXhmQc+oGWIDxWL6dyMqcA== X-Received: by 10.28.127.209 with SMTP id a200mr65312024wmd.99.1470247502053; Wed, 03 Aug 2016 11:05:02 -0700 (PDT) Received: from localhost.localdomain ([37.120.18.65]) by smtp.gmail.com with ESMTPSA id va3sm8854296wjb.18.2016.08.03.11.05.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Aug 2016 11:05:01 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/8] drm: use priv->pid to deduce task EUID Date: Wed, 3 Aug 2016 20:04:30 +0200 Message-Id: <20160803180432.1341-7-dh.herrmann@gmail.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160803180432.1341-1-dh.herrmann@gmail.com> References: <20160803180432.1341-1-dh.herrmann@gmail.com> Cc: Daniel Vetter 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 Rather than accessing priv->filp->f_cred, use priv->pid->task->creds. We want to get rid of "priv->filp", so lets avoid it if possible. Since we already are in an rcu-read-side, we can use __task_cred() rather than task_cred_xxx(). Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c index 247ba2b..1df2d33 100644 --- a/drivers/gpu/drm/drm_info.c +++ b/drivers/gpu/drm/drm_info.c @@ -99,7 +99,7 @@ int drm_clients_info(struct seq_file *m, void *data) rcu_read_lock(); /* locks pid_task()->comm */ task = pid_task(priv->pid, PIDTYPE_PID); - uid = priv->filp ? priv->filp->f_cred->euid : GLOBAL_ROOT_UID; + uid = task ? __task_cred(task)->euid : GLOBAL_ROOT_UID; seq_printf(m, "%20s %5d %3d %c %c %5d %10u\n", task ? task->comm : "", pid_vnr(priv->pid),