From patchwork Thu Aug 20 09:21:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 265380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87DC4C433E1 for ; Thu, 20 Aug 2020 12:55:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 604D42078B for ; Thu, 20 Aug 2020 12:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597928114; bh=ACTaPf3WB8xQMkrMtFCoSoFHetoXM3EoWgiMsXUUXhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MXvMtxbnFnouB3fnR6mnx6lc65bT8NOOffIw+nCZW+hJqOTNOYQc54SUWL0OaqJEg bRPeignlajVGnp2hhRl+GKZgmUddOfbNcND2uMTtUaaGxvle3Il5NgpACnLFFr1weL jZkkPfHfLiKvuXfyw8z+MFZaN1uwgY2nhw1cQEek= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729043AbgHTJnN (ORCPT ); Thu, 20 Aug 2020 05:43:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:38574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729169AbgHTJmk (ORCPT ); Thu, 20 Aug 2020 05:42:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 AC3DA22C9F; Thu, 20 Aug 2020 09:42:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916555; bh=ACTaPf3WB8xQMkrMtFCoSoFHetoXM3EoWgiMsXUUXhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qcPaY3wO9rNWisxvS4OjL0mklM/K3qGSuDptiZFtYSpWcwH0j4OpeYe0XptdBoIGY QgfVO0DH97ndu4zfadZFf68Sjq7JzEQpVnjhRKg9flY7MTzOgYzGfLhcRUHgfWCLDN FCrihLuaSRUv5NP1PsPbaqwoJuzP2WnqyjtGKPao= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wang Hai , Ilya Leoshkevich , Heiko Carstens , Sasha Levin Subject: [PATCH 5.7 170/204] s390/test_unwind: fix possible memleak in test_unwind() Date: Thu, 20 Aug 2020 11:21:07 +0200 Message-Id: <20200820091614.699700594@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091606.194320503@linuxfoundation.org> References: <20200820091606.194320503@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wang Hai [ Upstream commit 75d3e7f4769d276a056efa1cc7f08de571fc9b4b ] test_unwind() misses to call kfree(bt) in an error path. Add the missed function call to fix it. Fixes: 0610154650f1 ("s390/test_unwind: print verbose unwinding results") Reported-by: Hulk Robot Signed-off-by: Wang Hai Acked-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- arch/s390/lib/test_unwind.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/lib/test_unwind.c b/arch/s390/lib/test_unwind.c index 32b7a30b2485d..b0b12b46bc572 100644 --- a/arch/s390/lib/test_unwind.c +++ b/arch/s390/lib/test_unwind.c @@ -63,6 +63,7 @@ static noinline int test_unwind(struct task_struct *task, struct pt_regs *regs, break; if (state.reliable && !addr) { pr_err("unwind state reliable but addr is 0\n"); + kfree(bt); return -EINVAL; } sprint_symbol(sym, addr);