Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2370593pxb; Mon, 20 Sep 2021 20:26:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+gz7YOF3w5m6hgevNGKCu5gflUp1A7Oi2/u3hBCSS/pev+0TlR3dYBorIy14kX87IKUZq X-Received: by 2002:a17:906:90c9:: with SMTP id v9mr30818662ejw.356.1632194790935; Mon, 20 Sep 2021 20:26:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632194790; cv=none; d=google.com; s=arc-20160816; b=TOFEzcqNq2vnp2VmpJFvwnsO+GFKQ/B7XLocjXilUAUD8V+RyxT7yYEtFba9Slwf6Q QlyONWY97a87XdV3UEA92CweZhTMhiu2fEbJtM/Xb8k1gucGitR6kM+JGLD13ZWEPpes f72pJapU0vFDIbxOHTXY/blt4lYDdVVXxAN32YdtshGS7cBUFNvjZEideyU2s2yxnqdT b1W1oz6dp75iZTSZT+anN9/uqzvB3AZv3qLRNY47Z1xc/kkU1YfOUJfv8vLQwUpCo9/q dlmXVV67gYXKoJfNsJ/fGxJX+9fvgsIGDJsczXSJsLCiCFQ9FnR1ffZ3c7isaCfGeUSE 1edQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=f1xcSFNr3kilc3ggkr7nyiSr3xMSkY2vZ0JW3upfEg4=; b=gTvJZLhtuFcKk7OzcAXrn101w/Sl12Y7hTOuPaQ53ml51ag4j39shvTspN4Badi2S3 M632HdtWUqKczqxzuewfOIErQVOIA9D0+ijqplLDrTAjM3vYgDQfZbyXmS2lLutF1gFi Lhi13K5jinHfI65MJa3ZSJPqTbNvjlG8rveAzcottDISQlaIFjn7oTMCS38X1PYiGoIT pHeI6BUzi+6L2eEt3ED3arFYMM8FerEA0BWZrb4ucoAskdPIYVSwP1G0zNMB1J9J3GO5 9L702LSG3Gc/HMVe6ez6GoIhdZFPrv+5BirEp1AoGlJuOfm3wUgHociWO8TrbyxgrS8m dC/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sipxmxPR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 21si10747407ejc.493.2021.09.20.20.26.07; Mon, 20 Sep 2021 20:26:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sipxmxPR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344420AbhITSay (ORCPT + 99 others); Mon, 20 Sep 2021 14:30:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:44428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378274AbhITSYV (ORCPT ); Mon, 20 Sep 2021 14:24:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 30DB7632CC; Mon, 20 Sep 2021 17:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158697; bh=WMsX3IiJl0h+IkwgC/SBoTFdZO0CwS/kfV5k9J9w7io=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sipxmxPRh4c5BtOyAMtroEOu37ZtPkBDmSe2yYBirrvrswF0WmeSEJgAoGCcScaiA EpIk4mNu/L3bsvJ6h1BXbepNQLAkncXuxl5bS+WGav65KwQCEmx1rR71fURYBkhqWW cji9N2HvooSOensSdY5Skwnn132+kkxlr6fh0dxU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Walle , Lucas Stach , Marek Vasut , Christian Gmeiner Subject: [PATCH 5.10 015/122] drm/etnaviv: fix MMU context leak on GPU reset Date: Mon, 20 Sep 2021 18:43:07 +0200 Message-Id: <20210920163916.274991706@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lucas Stach commit f978a5302f5566480c58ffae64a16d34456801bd upstream. After a reset the GPU is no longer using the MMU context and may be restarted with a different context. While the mmu_state proeprly was cleared, the context wasn't unreferenced, leading to a memory leak. Cc: stable@vger.kernel.org # 5.4 Reported-by: Michael Walle Signed-off-by: Lucas Stach Tested-by: Michael Walle Tested-by: Marek Vasut Reviewed-by: Christian Gmeiner Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -563,6 +563,8 @@ static int etnaviv_hw_reset(struct etnav gpu->fe_running = false; gpu->exec_state = -1; + if (gpu->mmu_context) + etnaviv_iommu_context_put(gpu->mmu_context); gpu->mmu_context = NULL; return 0;