Message ID | 1514596142-22050-12-git-send-email-bryan.odonoghue@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5327105qgn; Fri, 29 Dec 2017 17:28:56 -0800 (PST) X-Google-Smtp-Source: ACJfBovEDnDv8Xw5T3ooVcQ7GCiUFURLkf8uoQIinadBDhYFw4IWfMVCIWVf5d3FOgbXg9jVrqw5 X-Received: by 10.80.179.39 with SMTP id q36mr46516666edd.85.1514597336096; Fri, 29 Dec 2017 17:28:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514597336; cv=none; d=google.com; s=arc-20160816; b=q6h2B6BKu9aOu1vdDF/RpQCJ2J8zmiSFhaJjBbXvL9fIfG7kAwse39BZaG2FWEHHEn cMuIcYihUxH1O9XCbnazuz5YJIBShSybc8+Ujzypgp98bohI7QJRThOO0veYRRp/rNJk fFZp5Ezl2WgDPvQaQCDwOa/pLSNuCCQ9shKbmDqIf9aAfN+MpjaLw9NLYqDZzN0vap93 y2L+oAH4oTKMP22pgW5YDMwurtMCX2bukHKOR9HEB3F5GqLqlNVARYs/CyK+4XddbQNj NnVvWX0THwF/8uyaDglNi12owr8HCssLe9ZAgTNNt/KZ113g+Fml7cxcuvfLE4/vhN0F 3GGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=MMozsOA+Wk4tbzbRTQ3ojzdmn5TvblgykYvZr4MNXaI=; b=BMsR9YxxHaZZRKlpuBFuSmjsHy+S1FJ2XHteoWMBD/uOmpvjA3dj3zcrtO4OTcC86P 5rXX9xK2RTd4+eC0TdkRvmrVOd24tBfaeVs1wcD2jWru8re8tDqohHaLHs/B8wiCSPXD i7A7akOg9drmkwjxiWZNk33V+Ph/7rSgP2dOymOPnfo056tE9HexMhEF1rh41J4mFNiJ zF2GcGNFhz4rBbAc3EhYKLDSXI2GGdqyYMAxfNtej25dywVZgzeS5M29O4BuAWzMOHem 2vMheYFvy548hgW4pgPlsjJk/ubIfwXtWAWn6Pkp7aOJvnRNy9T3QZ3e0lSJijO1y0rh lAeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FkTrcrhg; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <u-boot-bounces@lists.denx.de> Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id p32si287012edp.271.2017.12.29.17.28.55; Fri, 29 Dec 2017 17:28:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FkTrcrhg; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id B654FC21DA0; Sat, 30 Dec 2017 01:12:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5C74DC21E2C; Sat, 30 Dec 2017 01:10:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BA095C21DCE; Sat, 30 Dec 2017 01:09:21 +0000 (UTC) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by lists.denx.de (Postfix) with ESMTPS id 04899C21DA6 for <u-boot@lists.denx.de>; Sat, 30 Dec 2017 01:09:17 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id t8so50410998wmc.3 for <u-boot@lists.denx.de>; Fri, 29 Dec 2017 17:09:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G8z/3TFmKGvjjpDslWr0bG7tKU0tOafBwtE3humwEZA=; b=FkTrcrhgc2CWLhvyOYb8FudOc3SSK8a48baM2hUlUJi/9nddNrPbgwQqW2APEhN7rQ PH5auSrAQdBvEs/bnQYAYRbDX8m9El2YjtcEkTbUYulM8giggpJhf49bOLAanaM8HmdU E9sAJ0g5w0Qkr3hAxAMuEohwJjK5oBP/sGsVU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G8z/3TFmKGvjjpDslWr0bG7tKU0tOafBwtE3humwEZA=; b=rq0ljaWJCyV553h1xtWOR5V2A4fEv+bH+4W20+XM0XD7OnTdqLmMfXrKLjOUwVfLH0 kXppWEUQh1kgYTewvr6Jp5yhQth0WdBOjzaqJDxXkPQEzkA7OumO83ap6YC6Iy5r4U9n HRT4AM+2AJnp+47gDusDzoE5a6VU1APt2ZcByElhyBsWqovCxtPkUqSqcXb1VcEBHHGg 2eHNHDpIKa9K95WLMgXhfc7ot2BA55NORyexlWI2Aq6QiqSou3BhYcTSM+Cf55snAARJ nLzIz3HZnXcY/sTkmLSaOubejQVmcy6aoZLvemELUFIZoTgm5Tm1oQW2QJd3mDMHjAIS oxIg== X-Gm-Message-State: AKGB3mJqelFZps2HdWdn9hokzhj5dknXER+rkull5Vw+JYw8DaR0yfdn wILmKwHdR8feJAe3cboXcnX+meywcII= X-Received: by 10.80.186.18 with SMTP id g18mr47608572edc.206.1514596156447; Fri, 29 Dec 2017 17:09:16 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id f9sm26484148edm.83.2017.12.29.17.09.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:09:15 -0800 (PST) From: Bryan O'Donoghue <bryan.odonoghue@linaro.org> To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Sat, 30 Dec 2017 01:08:40 +0000 Message-Id: <1514596142-22050-12-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514596142-22050-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514596142-22050-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam <fabio.estevam@nxp.com> Subject: [U-Boot] [PATCH v3 11/25] arm: imx: hab: Verify IVT self matches calculated address X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
Series |
Fix and extend i.MX HAB layer
|
expand
|
diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c index cb6214d..479ed96 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -450,6 +450,13 @@ int authenticate_image(uint32_t ddr_start, uint32_t image_size, if (verify_ivt_header(ivt_hdr)) goto hab_caam_clock_disable; + /* Verify IVT body */ + if (ivt->self != ivt_addr) { + printf("ivt->self 0x%08x pointer is 0x%08x\n", + ivt->self, ivt_addr); + goto hab_caam_clock_disable; + } + start = ddr_start; bytes = image_size; #ifdef DEBUG
The IVT is a self-describing structure which contains a self field. The self field is the absolute physical base address the IVT ought to be at in memory. Use the IVT self field to validate the calculated ivt_addr bugging out if the two values differ. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Sven Ebenfeld <sven.ebenfeld@gmail.com> Cc: George McCollister <george.mccollister@gmail.com> Cc: Breno Matheus Lima <brenomatheus@gmail.com> --- arch/arm/mach-imx/hab.c | 7 +++++++ 1 file changed, 7 insertions(+)