Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2147196ybh; Fri, 24 Jul 2020 05:44:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdwMqmvaXNSSGbbJuhaGzkmpZH+QYkFWfjPQK22hzpTLUFD+yFLaNw2HUEjKojkqDUdoAM X-Received: by 2002:a17:906:7855:: with SMTP id p21mr9019819ejm.492.1595594658804; Fri, 24 Jul 2020 05:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595594658; cv=none; d=google.com; s=arc-20160816; b=QzWXzEogipVspe/RbP/7c73O3s1VxBfPcFvFfroFoOkC684vgmg92gN3u7qxcJ5qYM 4qGOr8XLBJORyfORZTi4DAndSOYLJsxcxBWTGiM5wfSmhyoaj8PHnWpESK6hU0s8AziV 7o7lJ3VFZkg06VC9GN/ypUDjMtGTr9z3psHo3cX50nloTxuQKqsqF2kT9EoyjHnJL9bZ 9c6AyuDdlDqlCNykh4Nla/oYsGy363ztSKatHzPevZzI462tAnX8DYNIrh4EV0Fon/KF lKZYyFKQgTyOIWkCOWbcfX9CLcjFPxIPbVLdkw/9Sgr5LXm6ai+aa1Cmt33fiEPjSxzD dadA== 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=p54evg5BmLlzMLCU/1C6lb3klAR8+ZfWWOcArHnTaWs=; b=BYnQjkYMoyAujVX0WgnpwX5agA7GDyP5IpgwU8DB6Glg8s87uod1E2BkxYDJVaDjEq 6ZQUeCx630FcinFGQahd6OijZpRjMah3p1dWsiUL0psZtd9lPhXZx0XHx1dsPqSb68QA e7xzQj8Yd5cbyUPEyXoLJhBScV5efE25L4gl+8FBN7nah4+iihTYcBY6n8mYkg3jgIma h4/iR7qAHoD5j8S1noWqaSaoe1ui33Ij2ixHof+0oDvIp/j2thbSgxtTH8EIHwKuUB/3 MBh1T8LLPbS82cr4gUnvchalkhO9Ni9bkx78H5zbm3gRh61OwDySY4uteuff+ACtQHXy l8Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@citrix.com header.s=securemail header.b=Czt7CIUx; 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 cn25si456101edb.68.2020.07.24.05.43.56; Fri, 24 Jul 2020 05:44:18 -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=Czt7CIUx; 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 S1727050AbgGXMnA (ORCPT + 99 others); Fri, 24 Jul 2020 08:43:00 -0400 Received: from esa1.hc3370-68.iphmx.com ([216.71.145.142]:34762 "EHLO esa1.hc3370-68.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727041AbgGXMm5 (ORCPT ); Fri, 24 Jul 2020 08:42:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1595594578; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9vtgZWvCFbf23f9EcBa2/BD85tIDxfXjWQT+ZKvEIkQ=; b=Czt7CIUx0nuOtcFFImq/Lq+aTFgHTtUp6IoZl/XgDTav3ihP76Tw4QkQ Fta6Q9dZZpy43XhWnibp0U0lFGILLn00+TiO1QW6xkX0DiL3ISp4nbKGZ IFOOox7mwYuX9uzH+BpxwIVx6pEkBERteak3IlFwXgFLRmkfKjigL5QnI M=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: Dc8nqelwNvG0/+NMY4+cPWhthOaCyoSnUTP+8s1m6cGyixWFyqmz0D0lOYHL0AUzwySXw/Dsum o63shKP7+8p2KQKTGtvB48PgrA6dEpk+FjgHPkyzfK2BdO9RZy5LFaeWiHSJ7I+WDhXsT2jHOT wwolMT+yZOPpLqEFoJMnTdrZTr/gAGSMeUDtDsDdVOpmphY1HzwjTNCmNpwC1cqbLeglQMR3MV SEkdE4rvDQv+7kDNXpiuvhHJxFMiP7UZpwCwBW/hxpICmMVwcLWyQ/67BEdhKdnVHEXcmpAL5L 8z8= X-SBRS: 2.7 X-MesageID: 23454363 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,390,1589256000"; d="scan'208";a="23454363" From: Roger Pau Monne To: CC: Roger Pau Monne , Boris Ostrovsky , Juergen Gross , "Stefano Stabellini" , Subject: [PATCH v2 3/4] Revert "xen/balloon: Fix crash when ballooning on x86 32 bit PAE" Date: Fri, 24 Jul 2020 14:42:40 +0200 Message-ID: <20200724124241.48208-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200724124241.48208-1-roger.pau@citrix.com> References: <20200724124241.48208-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é --- 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