Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2951379imu; Mon, 19 Nov 2018 08:31:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/VpUGJ5FbVyOQoMbT20VXuEslKNUfNxnPLUk3hx7Gr1U2kYsA1qodAGlqkn3J7JKjnSO4R5 X-Received: by 2002:a17:902:b416:: with SMTP id x22mr7675212plr.276.1542645103366; Mon, 19 Nov 2018 08:31:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542645103; cv=none; d=google.com; s=arc-20160816; b=ykDxhCBBjggMJeULeNbcKVhxi7qq+Lm7oA52bDkxyh/li7K5oA+ZlK8Wa7RvrMMVr5 EMH9QwHyE9VIDtPnEoGnp8c+jGn+QK+wqg3yojjjPfFrMvK1H7EgBpczKMOWjaPQQvC4 Cz4+rjYRA2fecuAbuTQKPiw3TbGUPG6ZN2I6kvWPPNgH7fdbUL6XaevZuYv5/P3MMTyc 1BEp2I8uzuGgVUMgMG3Kw0stbQZFr4LtrHH+0fIdGYHbvtfRiBN8g0FNL9OYoeVC2AGQ lMLEAep+Hsse9Tf6HsUPyqD1pQG+PPJXol388c1axdZTTsWOEId38fPXpUdGG4YzUJGH 3Gkw== 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:dkim-signature; bh=SfoIfDW7xk6RPnw7JPD+mCDJjfklI8CirKT1H8rYY/4=; b=Wf6qrps3Pn/4fWdfoF3b+sqCUAdoFNl+pNv+PTiufUTTjB+aHbwaYAffhzPVyTEDoJ 98jUw8fn67ROc1E273p1dEB5U3jUp/Rb841GdGZVo/mmtRB/s6EX6GE8UzW4JV0eBnus fAL1tHkoONG4iq7ct/PRPnM0EsuHhycNDInjU4PQrgFbfQ7JvUQ2ndXeqgvZakKFLopU I6qmrOhhjtejZbbZIUoSrS50pIf2Wa/sDA/OEek9uvfn2jBUW59Kjgc+LRnmtw7GORew TpLNNI2xnVGjzdT4L3T8Ui8oDHuQBXTVeluN28IXTdO5uynnlQ3yGT85p3y8dnGXLHMB DTvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=onEQQNUS; 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 o127si4697340pfo.251.2018.11.19.08.31.27; Mon, 19 Nov 2018 08:31:43 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=onEQQNUS; 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 S1730112AbeKTCyl (ORCPT + 99 others); Mon, 19 Nov 2018 21:54:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:52000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730070AbeKTCyk (ORCPT ); Mon, 19 Nov 2018 21:54:40 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9CD4320831; Mon, 19 Nov 2018 16:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645034; bh=58sBviAd0iLp4+DNdHd7IOwjQx49qPw4VPYDxzTUGjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=onEQQNUSAkTTtpkQLKN2oeB16QBpHng7PZihhXQJyYYJZasjDVn/86nfldxRkUOoF ttgFPUNv9PHsc9UIQeohPCzIJHEvI2dlodMmRU0NGNDlBLYJY2GmnbkEu31SNdQjs1 H//9B3UoNL0TAaNKcoQV7IzCS+VZm5Vt2SZfvnXg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , John Hubbard , Kees Cook , Ben Skeggs , Sasha Levin Subject: [PATCH 4.19 011/205] drm/nouveau/secboot/acr: fix memory leak Date: Mon, 19 Nov 2018 17:25:18 +0100 Message-Id: <20181119162619.142193127@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@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.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Gustavo A. R. Silva" [ Upstream commit 74a07c0a59fa372b069d879971ba4d9e341979cf ] In case memory resources for *bl_desc* were allocated, release them before return. Addresses-Coverity-ID: 1472021 ("Resource leak") Fixes: 0d466901552a ("drm/nouveau/secboot/acr: Remove VLA usage") Signed-off-by: Gustavo A. R. Silva Reviewed-by: John Hubbard Reviewed-by: Kees Cook Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c @@ -801,6 +801,7 @@ acr_r352_load(struct nvkm_acr *_acr, str bl = acr->hsbl_unload_blob; } else { nvkm_error(_acr->subdev, "invalid secure boot blob!\n"); + kfree(bl_desc); return -EINVAL; }