Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp890478ybg; Mon, 27 Jul 2020 02:19:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYQkkJm9/ecgkfIbRWfo57RZPlbwgSD1kK96EdgFZsgmHDkWEFBZ2VQhAQ2FIcJ998PzEC X-Received: by 2002:a17:906:22c1:: with SMTP id q1mr11198371eja.443.1595841590565; Mon, 27 Jul 2020 02:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595841590; cv=none; d=google.com; s=arc-20160816; b=wcCaoWiFiefUMKDLgabh++6Ky0J5gfAxsU9VevfOyYf15Rq0s/TJeCx9RM/xEYByVH 6t3n9xo4Rpka109BJeOQHVvgEYBUcFd/GsWOJvfOz1WUvsE1hjBOVLJQartEVenxvDp7 0ryVrMLXsba5gbjjvQBBcXvJ0lTBLizJjG55PyM/yzySFsAL1KLGBWhQ5/BfDD3FU49e s4dR6xeK30dzkEJq41kuWQHKRJ9grWUJ33EjBXHFTt0OIZvd648rL1wPlvY2WMBcd3EE bhZUrIALdnHNrLU+qnM6jHrmv0o2RJQF8ipe+M6bqkxCBJ1yGP7S9a2j6sCHjbO2BJqe 07CQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:dkim-signature; bh=Q9jj7QZNj68fnBYGJPQx+qTfJ8+XVRQLpmzaa/lTBFE=; b=QqjxK/V7GPxzaNeC4ns1v2cT5twfw92sGURFKA/lBHV9KWFfLolGDJT/CZuxn4gJ6J eMurXKyICG+Vf0vlvSFGbGXyFyhfrrWZDNRyn22X52YxvxgJxkE0YOtyelCbFb5IXJC6 HK0oXH22wYVK+F60EjuPdPDp+FeR9W8Sv9rx+2EhKqoZS00/103ehyLCrkf/Ojb/HVbs jSJFRRebCi6fRZ23xNNMcScBzFIA+0XvGNsyIQSdootkhBYD5fyNRbmEVSqvdZ2EhDDV cDMudBqxTkOVpRPnYFNvmkDy2IuC3HE2CrsDA6lVVjlEGv1aDCms5sCQ9kTKDiJTa2WB 0YMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@citrix.com header.s=securemail header.b=KZInzin2; 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=NONE dis=NONE) header.from=citrix.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp11si5307711ejb.430.2020.07.27.02.19.28; Mon, 27 Jul 2020 02:19:50 -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=@citrix.com header.s=securemail header.b=KZInzin2; 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=NONE dis=NONE) header.from=citrix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727924AbgG0JPL (ORCPT + 99 others); Mon, 27 Jul 2020 05:15:11 -0400 Received: from esa3.hc3370-68.iphmx.com ([216.71.145.155]:7835 "EHLO esa3.hc3370-68.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727905AbgG0JPJ (ORCPT ); Mon, 27 Jul 2020 05:15:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1595841309; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Nq9yI9ZapjAU3I2ISQYBx01cREm8iD5IrXb3HWdctu0=; b=KZInzin2gcDJQRvZdUwizW0PAokuwA9G1EfiBgPiA+O49KeLaeSfkJMr f1GNSEvLtMTwrrUrVsUcnLOhOR1fZr6H5SwkForVztBAWQcQ/rljyQO/d Ao6+E4cvtv4YW6j2Xns7IBOVSd5u4r3hr5DvPx21Z+N4q7tfFY29NztrC Y=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: CaWT5LIbKdSm6bglJh6wY7Rm9pQCl8a6jhy9q8a+NizdhgIBcUgMJIVzAoXIXdLIYwEyNXjysu jSQTvNe1bbYVQi7e3KcyTmEZFi3CsDbUMupe+asAciCVSRx7faRfhMETYPniYTT+tB4f4E/ny3 8Z9NHVXMK/B/ZfpG36jfHVTra6T4EWIxWxLV5SwAHLLEW5I157sJPAJSregsF8/dAdp6FxmzH3 k9ZqiAppaKjGEJvBHAgFr+VIUtwQG6LUpdZxvOwrLfYO2QKjsRrmZ1Z54Lp0a4thonvBtWrRo4 ohI= X-SBRS: 2.7 X-MesageID: 23233916 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,402,1589256000"; d="scan'208";a="23233916" From: Roger Pau Monne To: CC: Roger Pau Monne , Juergen Gross , Boris Ostrovsky , Stefano Stabellini , Subject: [PATCH v3 3/4] Revert "xen/balloon: Fix crash when ballooning on x86 32 bit PAE" Date: Mon, 27 Jul 2020 11:13:41 +0200 Message-ID: <20200727091342.52325-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727091342.52325-1-roger.pau@citrix.com> References: <20200727091342.52325-1-roger.pau@citrix.com> 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 This reverts commit dfd74a1edfaba5864276a2859190a8d242d18952. This has been fixed by commit dca4436d1cf9e0d237c which added the out of bounds check to __add_memory, so that trying to add blocks past MAX_PHYSMEM_BITS will fail. Note the check in the Xen balloon driver was bogus anyway, as it checked the start address of the resource, but it should instead test the end address to assert the whole resource falls below MAX_PHYSMEM_BITS. Signed-off-by: Roger Pau Monné Reviewed-by: Juergen Gross --- Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: xen-devel@lists.xenproject.org --- drivers/xen/balloon.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 292413b27575..b1d8b028bf80 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -266,20 +266,6 @@ static struct resource *additional_memory_resource(phys_addr_t size) return NULL; } -#ifdef CONFIG_SPARSEMEM - { - unsigned long limit = 1UL << (MAX_PHYSMEM_BITS - PAGE_SHIFT); - unsigned long pfn = res->start >> PAGE_SHIFT; - - if (pfn > limit) { - pr_err("New System RAM resource outside addressable RAM (%lu > %lu)\n", - pfn, limit); - release_memory_resource(res); - return NULL; - } - } -#endif - return res; } -- 2.27.0