Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4122536ybe; Mon, 9 Sep 2019 04:42:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxC1vDcYcJUuh1OlK1ZEnxDhLNFlBHc2iBWSU2ImeGSUFL85EmPYTEqUZ/E8iQZzH2NQFIc X-Received: by 2002:a50:9e6c:: with SMTP id z99mr23188309ede.200.1568029333077; Mon, 09 Sep 2019 04:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568029333; cv=none; d=google.com; s=arc-20160816; b=OKLhZrqYCTg/E2AquU6ZXW8SVoEVs0Am4Lwc23/pZP/Pc38ZXDFid8n2VLFNpVxIxI kuLIohhRg7CJ4UrWS0IFPDcuE4qdOyp5gdqvK1g/od+nXbu9HOkgZXX+EQz3yj2hVv7y j074HHcu2+oO1TAh20ayv1glEhWU4Fb/FsgHAr4eXuZ7xYAGIv5pjA9Zxu2Qec3Y+Qnw YPV4nqxupijacQQ929LvwedjC/CQOUBuZNaI9rgWsrw0yajA7YtF/uE40cfznm6Pz9vR GM6vVAClL/B6T/OGBVFBY2hVqSZc1qFFQCquxTeLYbW7xtCwncfzTGdKlNqnQBU0jmkq zfJw== 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=Kkl5zIO6OG1NaWqe3EnxJlkDXaBac/bLf9oDy8mjVMM=; b=VcNtMR8qIms/xc4DenDzQhtc4T1JF5AoMbSY9FW71u1pGMM7hroddhO5A/Rjdx0zPK OzcKAtPmGRS6TH9RMf+w2caWDcMRBEAq41wQD4iEJIwCN2vrKIbDauQlVBidlfVFOzvf QS1tWBd7FCnc9WmtYrXz6gR7fFZv9fpVx9WhdPlNUHn7GekCEVBr+eadXwrfdIAL0pqB /Aq0MUXikfpNBYBpSbkiOjAs/hsPJkSjoI37DEs2d0MN1Y8SgNUJlqqxrXSHWRVECON+ IQ501JPxAHDwGAAahtxdpSpV3nsvRE6J2f/I7GtBkoYFaJgqCDuQvypNXYCBqyWB332E qItA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CuC22lfQ; 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 ce25si7208983ejb.78.2019.09.09.04.41.49; Mon, 09 Sep 2019 04:42:13 -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; dkim=pass header.i=@kernel.org header.s=default header.b=CuC22lfQ; 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 S1731241AbfIHMs4 (ORCPT + 99 others); Sun, 8 Sep 2019 08:48:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:38342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731219AbfIHMsy (ORCPT ); Sun, 8 Sep 2019 08:48:54 -0400 Received: from localhost (unknown [62.28.240.114]) (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 BAA94218AF; Sun, 8 Sep 2019 12:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946933; bh=27jcVKK/qpC0ilYCPfzWwVPw9oGhG5I+khgjFLMDj+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CuC22lfQUDmkYixF0xDIU5MtCLWVCKUsKgdJTynp2Va+l8SjPd5sUYgTZo6jNE/V+ XeSy2V/mYPxD7j8uM+0SLmLqxkct+Fx9U2CDeL4nyqrN9z+WR62ALh83CHN5cs0RbO N2S6TGhILxhhIfD4aIT608Y67YKQq5BIiMI/8TBw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , "Kirill A. Shutemov" , Thomas Gleixner , Sasha Levin Subject: [PATCH 4.19 55/57] x86/boot/compressed/64: Fix missing initialization in find_trampoline_placement() Date: Sun, 8 Sep 2019 13:42:19 +0100 Message-Id: <20190908121146.493805918@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121125.608195329@linuxfoundation.org> References: <20190908121125.608195329@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit c96e8483cb2da6695c8b8d0896fe7ae272a07b54 ] Gustavo noticed that 'new' can be left uninitialized if 'bios_start' happens to be less or equal to 'entry->addr + entry->size'. Initialize the variable at the begin of the iteration to the current value of 'bios_start'. Fixes: 0a46fff2f910 ("x86/boot/compressed/64: Fix boot on machines with broken E820 table") Reported-by: "Gustavo A. R. Silva" Signed-off-by: Kirill A. Shutemov Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20190826133326.7cxb4vbmiawffv2r@box Signed-off-by: Sasha Levin --- arch/x86/boot/compressed/pgtable_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/pgtable_64.c b/arch/x86/boot/compressed/pgtable_64.c index f0537a1f7fc25..76e1edf5bf12a 100644 --- a/arch/x86/boot/compressed/pgtable_64.c +++ b/arch/x86/boot/compressed/pgtable_64.c @@ -73,7 +73,7 @@ static unsigned long find_trampoline_placement(void) /* Find the first usable memory region under bios_start. */ for (i = boot_params->e820_entries - 1; i >= 0; i--) { - unsigned long new; + unsigned long new = bios_start; entry = &boot_params->e820_table[i]; -- 2.20.1