From nobody Tue Feb 10 10:08:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1687726198; cv=none; d=zohomail.com; s=zohoarc; b=fJOIr9P+VJprMsPxGsl2tFwGdPdBuZxqzCpq6HMsvbB4HqVkCzu9wbCTX380YEEkI+Xv+SwtqYE7Uort0RqSQ7kgSWzHr/XNGOgddRPfAwk5aszKX8KYKnh3TWRUYcG6vp6DJVdV+quhZFLFxQKwpgRm74frEL7ynBeeQjNsW60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687726198; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9w0nZdIHxyhiPgNJV2nNqGag3fqrurdY4W4q6aF8hO0=; b=jl8yhLSozmh/W+sS6IR4iF0R3hdODicr3KOIXAZkRFBgNLEjYglG7OGrWYJYVpTE96pvjNC9M5LfC7D4hIE1cM00WSDLxHCaI6ElGM3Hhl/dLQzJAsu64WNgGCWlLe7Nk9wHErTOAVursCHP1MzrCw5vQRit9JK0dTVq3xZ9bj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1687726198350571.2829906656422; Sun, 25 Jun 2023 13:49:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.554872.866292 (Exim 4.92) (envelope-from ) id 1qDWfe-0002j2-Iw; Sun, 25 Jun 2023 20:49:18 +0000 Received: by outflank-mailman (output) from mailman id 554872.866292; Sun, 25 Jun 2023 20:49:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDWfe-0002h6-Bc; Sun, 25 Jun 2023 20:49:18 +0000 Received: by outflank-mailman (input) for mailman id 554872; Sun, 25 Jun 2023 20:49:17 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDWfc-0002bq-Vd for xen-devel@lists.xenproject.org; Sun, 25 Jun 2023 20:49:16 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDWfc-0003Lu-La; Sun, 25 Jun 2023 20:49:16 +0000 Received: from 54-240-197-232.amazon.com ([54.240.197.232] helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qDWfc-00021M-DA; Sun, 25 Jun 2023 20:49:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=9w0nZdIHxyhiPgNJV2nNqGag3fqrurdY4W4q6aF8hO0=; b=P4wzfzxnhQFImT7ocJPK4FhQMa MB+CM/UwBTtJdUqR1QgSF0mVJR/SdxD4ai6WIaLBAXDb6mOj64aShcnNMK89Wv1D1oQic7iEdhmUG p+9uzZu7+P3STuBKaEMsloWfgVqMQDcba58XjSOjwOM9r0ZKgXS6j8ncfXmuFy4eYT20=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: Luca.Fancellu@arm.com, michal.orzel@amd.com, Henry.Wang@arm.com, Julien Grall , Stefano Stabellini , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH 1/9] xen/arm: Check Xen size when linking Date: Sun, 25 Jun 2023 21:48:59 +0100 Message-Id: <20230625204907.57291-2-julien@xen.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230625204907.57291-1-julien@xen.org> References: <20230625204907.57291-1-julien@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1687726199565100009 Content-Type: text/plain; charset="utf-8" The linker will happily link Xen if it is bigger than what we can handle (e.g 2MB). This will result to unexpected failure after boot. This unexpected failure can be prevented by forbidding linking if Xen is bigger than the area we reversed. Signed-off-by: Julien Grall Reviewed-by: Henry Wang Reviewed-by: Michal Orzel Tested-by: Henry Wang --- xen/arch/arm/xen.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index be58c2c39514..c5d8c6201423 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -241,3 +241,4 @@ ASSERT(IS_ALIGNED(__init_begin, 4), "__init_begin i= s misaligned") ASSERT(IS_ALIGNED(__init_end, 4), "__init_end is misaligned") ASSERT(IS_ALIGNED(__bss_start, POINTER_ALIGN), "__bss_start is misali= gned") ASSERT(IS_ALIGNED(__bss_end, POINTER_ALIGN), "__bss_end is misalign= ed") +ASSERT((_end - start) <=3D XEN_VIRT_SIZE, "Xen is too big") --=20 2.40.1