Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp742971imm; Thu, 13 Sep 2018 07:07:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZMbJGUx6TWJED0PhjSQx/6MNo9ydTDn83H29r9w8tJGEysq+H9LW6cntxf7Bi/lJ3rnCiW X-Received: by 2002:a63:e001:: with SMTP id e1-v6mr7428160pgh.380.1536847648694; Thu, 13 Sep 2018 07:07:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847648; cv=none; d=google.com; s=arc-20160816; b=TRCUJk1WpiDHl2JHFKNBrW6xNg5depc8/NPyCNRrET6HMNB0baBe8wiYWqV2BqdZGV 9+Xvmh1YqOB+maPvpMz5gCsAcny8WpueI7edxP24lL3ncHzeVy+52Zq7h1ZG8UogAICr csTgTj7aDx4YaJy3SwWRbMr1xY0Vn7QwmrMW/Ee9EzyHwlOXuV2PWAj0i1khfv50UlwX jgdEcG4PaK3Bca+BVQm5fYfp253JR1kxZ7OKI3Gi4d+QS+mHGOugW4j2cLQERyko15Ji D3jmDBj8U2lfx5BuRUzCQmB94/gTCjgQW5ZbALoJ2UoK4HeCLVRcCUnawhr4f/4afH8g MqSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=hwO3+HYmvMcTCcdiycyjXIV6YuSziIAwLl2LHnydJ+k=; b=nOUm8HO2NXl5QolPU2GwHQZOBJsYt7Y5lT1L/XgbvieHV3vG6iqIHD9oVEEvTF+pW8 ZJ6w57SqToi9xq9erJO8sEs/i71qol143vGUQaj9fvVv4TmnB1G9K4LcJkNTyY0iPdfR nVTQsPiemyi7B3g0RCN4m3EynP3d1jIQkR+r1HMFK99ev+ZR3IrTcZCjBk+I5O/Kp3hb Axln5+XmR3fpokAIhp41GY1t1FshXRZXL4W+zvEWkkcimxcMRlo1Gbs1BrrpSncCf7h3 if87/HZ1acr2SyRks3FRIaFOgV5KaL8RiojdvpHitBTjl5YpGDyx0F6xD6WFcEEq4gC3 KSwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bb7-v6si4052349plb.359.2018.09.13.07.07.13; Thu, 13 Sep 2018 07:07:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732170AbeIMTOl (ORCPT + 99 others); Thu, 13 Sep 2018 15:14:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35460 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731896AbeIMTOl (ORCPT ); Thu, 13 Sep 2018 15:14:41 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0BC88D36; Thu, 13 Sep 2018 14:05:01 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher Subject: [PATCH 4.18 180/197] drm/amdgpu: fix incorrect use of drm_file->pid Date: Thu, 13 Sep 2018 15:32:09 +0200 Message-Id: <20180913131848.765589533@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christian König commit c4aed87630d41ee54e2ee23d4583c3dd423296dd upstream. That's the PID of the creator of the file (usually the X server) and not the end user of the file. Signed-off-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher CC: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c @@ -55,7 +55,6 @@ static int amdgpu_sched_process_priority { struct file *filp = fget(fd); struct drm_file *file; - struct pid *pid; struct amdgpu_fpriv *fpriv; struct amdgpu_ctx *ctx; uint32_t id; @@ -63,20 +62,10 @@ static int amdgpu_sched_process_priority if (!filp) return -EINVAL; - pid = get_pid(((struct drm_file *)filp->private_data)->pid); - - mutex_lock(&adev->ddev->filelist_mutex); - list_for_each_entry(file, &adev->ddev->filelist, lhead) { - if (file->pid != pid) - continue; - - fpriv = file->driver_priv; - idr_for_each_entry(&fpriv->ctx_mgr.ctx_handles, ctx, id) - amdgpu_ctx_priority_override(ctx, priority); - } - mutex_unlock(&adev->ddev->filelist_mutex); - - put_pid(pid); + file = filp->private_data; + fpriv = file->driver_priv; + idr_for_each_entry(&fpriv->ctx_mgr.ctx_handles, ctx, id) + amdgpu_ctx_priority_override(ctx, priority); fput(filp);