Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1799064pxa; Thu, 6 Aug 2020 16:41:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7yWYjGr1Hno7tElZ8bEQ+EleMrwChUZmfKqgsmzBPFa1h61jFP4TwAP7bfmj4p832XZIC X-Received: by 2002:a17:906:b294:: with SMTP id q20mr6495819ejz.223.1596757265136; Thu, 06 Aug 2020 16:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596757265; cv=none; d=google.com; s=arc-20160816; b=PbS9MO8FDqp5EblOkm1HFOayHb5YBK++OYx4TzMsDQwBy7pHq4i8tjLL+kXUNE0bZK IB/rlVDU241JExT/7QxBWrevBW7D5jUrttu92bQKXnqhgRvwhcNj8xY+tK/ib3MJ8sLG atNwOrrJ9GlkPE61gJ4IWix/NvwiaMF3+7y6SoN0u0hUwkAMS50ylBmyBBkU4XdfMTAZ d2xe8J8dIS82y6F8vtyZpMVDYwlOH3P5IqgKu2XpTwfYBVFGOmIWOD0OiEv2eXRzmK04 T6ZGVYoX15DH5WRY4H7plFCzM6D+K5ggMZck7qHBYHvQZVR0+G4vh6gKA5RT+4HBdlWP D4/A== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:dkim-signature :dkim-signature:date; bh=tbGZi1eZc6TtzevOnBf91sbjHgLai7dijbdLr8UQ+Dg=; b=s2AKWwSjcnXZMIUmo1XAx5onKXah1hfeO+FKJoKyzQlGZZbBSNzosfxyqVcIOUzL2l klM80oS+YaPDjoZlyRsCNsTliAVs2FuiGYJREVI6cFZKGNa+sPna7IyqBZCBKo1M/IdI X0J68mgTN/k/1FETy06v9zmgc4TWPJZMn3slVd1OS2mof4m4ivJPalr1CQkGnA+PNFpf 1oEABz/YBRVPkYUrWdM7w0fiaWkFSB7jVCK/eimlHNahJSzMREVb/iFIiaLMxQfPLQtz phy7o3aOkW5GBHGsCQPDis22AUIL+zUVHVvBOwulSkTSEs1BlLVcDulvGP6nX1nPtcCm ih+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b="q9P/FZV0"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb21si4254433edb.31.2020.08.06.16.40.42; Thu, 06 Aug 2020 16:41:05 -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=fail header.i=@linutronix.de header.s=2020 header.b="q9P/FZV0"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726967AbgHFXji (ORCPT + 99 others); Thu, 6 Aug 2020 19:39:38 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:60990 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726645AbgHFXjD (ORCPT ); Thu, 6 Aug 2020 19:39:03 -0400 Date: Thu, 06 Aug 2020 23:39:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1596757141; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tbGZi1eZc6TtzevOnBf91sbjHgLai7dijbdLr8UQ+Dg=; b=q9P/FZV0juIRExkQCl4w1lu+de/IDSfo1dUA3mT7YT2hViIz43cI8rvX+TGifod/GjyfaC EBUwIQYiulR+vbdyLGH9JQnIdjkSC9wwxU/aVBmxxY1tj4xi8Cu/thDj2O5uiwAjjnyEBb 8CfxfLDZz+n6wKyGeEFdZ3MwF9JS3y/Hovt4rF3HU0Kzork+v1+kkSW2JFHUzlNTMKIakq iv9Cc26tZcum7I58qreDCGHE9nu1Q8PIjUlRIyDa2I/bDPotCYeN30Z2IKEN0Tg+il9Xs5 oHNKG/MdwcvFn9DMsIDght93bOvZUVU8LuIOwVX00v/9PnEGOAdOxMaeAc2iog== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1596757141; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tbGZi1eZc6TtzevOnBf91sbjHgLai7dijbdLr8UQ+Dg=; b=+HS39mQ4AEnUOjIO/qRz7wR5w+Zc14cbj2ZNwCqfM72s2HW4E9ZpEHuyK4DKBdA2igolw5 L8POtghZdCJTY3Cg== From: "tip-bot2 for Arvind Sankar" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/kaslr] x86/kaslr: Fix off-by-one error in __process_mem_region() Cc: Arvind Sankar , Ingo Molnar , x86 , LKML In-Reply-To: <20200728225722.67457-6-nivedita@alum.mit.edu> References: <20200728225722.67457-6-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <159675714094.3192.4263482900685835481.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/kaslr branch of tip: Commit-ID: 8d1cf8595860f4807f4ff1f8f1fc53e7576e0d71 Gitweb: https://git.kernel.org/tip/8d1cf8595860f4807f4ff1f8f1fc53e7576e0d71 Author: Arvind Sankar AuthorDate: Tue, 28 Jul 2020 18:57:06 -04:00 Committer: Ingo Molnar CommitterDate: Fri, 31 Jul 2020 11:08:17 +02:00 x86/kaslr: Fix off-by-one error in __process_mem_region() In case of an overlap, the beginning of the region should be used even if it is exactly image_size, not just strictly larger. Signed-off-by: Arvind Sankar Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200728225722.67457-6-nivedita@alum.mit.edu --- arch/x86/boot/compressed/kaslr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index da45e66..848346f 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -669,7 +669,7 @@ static void __process_mem_region(struct mem_vector *entry, } /* Store beginning of region if holds at least image_size. */ - if (overlap.start > region.start + image_size) { + if (overlap.start >= region.start + image_size) { struct mem_vector beginning; beginning.start = region.start;