Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1799206pxa; Thu, 6 Aug 2020 16:41:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1NFagBaXwWxOHoRp5PBWiM3bTeDEV6KTXFLiLdQOHItZLJkVnAYIY/ga9YFa3XlX+l6i9 X-Received: by 2002:a17:906:2e51:: with SMTP id r17mr6599958eji.308.1596757279717; Thu, 06 Aug 2020 16:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596757279; cv=none; d=google.com; s=arc-20160816; b=m33Ue/DiOzKGrpdBTPrQ3APIbIrNohAf+ouxeuML3QoCWslD8Qdsii1OciZdb2MH5F 5yYCdVXPlkdmIvoOvAk7VAPIAuvRIlBx4WSMpIDEQH7vriE6hbI0jqwSIECHexO6Woo6 rOE0kwFPyx/6HlZkBrFiIbCFn7HjyskMBUc5LO5IAtfRJKLNYyA9enlMcpLY+p6scPhE /gYzsFdR1V/iGNK5Ef+h1ISXgVckgXj1B8lj1KCAdozYK/3n4/wmbQPYZ/aV+mXlqguM ZM9M/Fe+1JZ56Zq0qwQUdfef8ZtKlcelys6Lw7OzxTPfTqOQEAvlsxAvwKLPR1LNfIUU HDTw== 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=SoGwbeniZcTcC+/aO5s8sy1siKGbmbzC9qilfsWJ9cw=; b=qW92byXb0bMXAoiQ44FAmCaZ3IGblcjmkCaLY175yKjX47Jdb6S4NP/M9MHxMa8Zw7 68yP7FmQfY2Rkw57Ej8hbXc3ZOQtRYEUYstp+FlSL3ZlVJ0HDYN/q2kA/rZaRYUhkxXR ASFaCKmr1WYeK1s8rmbseX8Xt7eZ/C3J55E6O1B8IArCZUp8x0p2jD6U3txIuKjx4tdV xUansFZTwXD2jsdDJwCoeCgurhuy5SgOWqZ4eEb0nPTaLK+YWwmnZg45dlipwy4cxVo+ Qqva/b71CzADNLtRzpDA5IaKcnNlVjtGLTm1J/pEsYSGfIOck2ZuaM8+iKyTCXsmV88Y vRMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=oOwKOdDU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=+iyxTgfl; 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 t3si4522302edi.461.2020.08.06.16.40.56; Thu, 06 Aug 2020 16:41:19 -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=oOwKOdDU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=+iyxTgfl; 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 S1726806AbgHFXjK (ORCPT + 99 others); Thu, 6 Aug 2020 19:39:10 -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 S1726606AbgHFXjA (ORCPT ); Thu, 6 Aug 2020 19:39:00 -0400 Date: Thu, 06 Aug 2020 23:38:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1596757138; 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=SoGwbeniZcTcC+/aO5s8sy1siKGbmbzC9qilfsWJ9cw=; b=oOwKOdDUFN712jZW3717UqSaaQBAQdVOS2B3IJ2EbBefWzXM8bB1vzgqYP9DXNiebS3J0A M54waJMheSFcipBBg4WzeYpPkrUggeRgX3LMWutG6BanflYN7+gpdjH6R3EiHppyQ15Vda rM+evyyAugWrgBd/0Zyvvac4MDckR0gAZhu1Mv7mXd5EbZyUhIPjY2IUL6sHlQadOJPjwv nT9MkfIQDPl1ezyityXACEsN06g3aGrdO/KR2tawZLOEqZD7cP+p0HcdY0qgsVAIHjTLEX fcA25Mr+gRm6wCaXZjv+nVox3hbmB/suWJNM83jx9dBDMCMnjH/dTJs0kidQfg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1596757138; 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=SoGwbeniZcTcC+/aO5s8sy1siKGbmbzC9qilfsWJ9cw=; b=+iyxTgflByffOv3KvHmacDqaDjKM08r+H2lcV9ddkIYqgNdfOrb2G4ecdv/LIh0s1A/1ZN UOy+JbuUYqUbDoCw== 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_gb_huge_pages() Cc: Arvind Sankar , Ingo Molnar , x86 , LKML In-Reply-To: <20200728225722.67457-11-nivedita@alum.mit.edu> References: <20200728225722.67457-11-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <159675713763.3192.15033718411509821639.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: 79c2fd2afe55944098047721c33e06fd48654e57 Gitweb: https://git.kernel.org/tip/79c2fd2afe55944098047721c33e06fd48654e57 Author: Arvind Sankar AuthorDate: Tue, 28 Jul 2020 18:57:11 -04:00 Committer: Ingo Molnar CommitterDate: Fri, 31 Jul 2020 11:08:17 +02:00 x86/kaslr: Fix off-by-one error in process_gb_huge_pages() If the remaining size of the region is exactly 1Gb, there is still one hugepage that can be reserved. Signed-off-by: Arvind Sankar Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200728225722.67457-11-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 d074986..0df513e 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -562,7 +562,7 @@ process_gb_huge_pages(struct mem_vector *region, unsigned long image_size) size = region->size - (addr - region->start); /* Check how many 1GB huge pages can be filtered out: */ - while (size > PUD_SIZE && max_gb_huge_pages) { + while (size >= PUD_SIZE && max_gb_huge_pages) { size -= PUD_SIZE; max_gb_huge_pages--; i++;