Message ID | 1514377566-28512-12-git-send-email-bryan.odonoghue@linaro.org |
---|---|
State | Superseded |
Delegated to: | Stefano Babic |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="HRPDa/9M"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3z6CHB1jq8z9s7h for <incoming@patchwork.ozlabs.org>; Wed, 27 Dec 2017 23:44:54 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id BBDE9C21E0F; Wed, 27 Dec 2017 12:36:41 +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 D5971C21E5D; Wed, 27 Dec 2017 12:33:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 287C9C21C59; Wed, 27 Dec 2017 12:26:33 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by lists.denx.de (Postfix) with ESMTPS id B9569C21C59 for <u-boot@lists.denx.de>; Wed, 27 Dec 2017 12:26:32 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id n138so39128252wmg.2 for <u-boot@lists.denx.de>; Wed, 27 Dec 2017 04:26:32 -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=P9u5NqvqMl22xGhcG/VI5xoMMiekv1o5CaYnjb0ZKeY=; b=HRPDa/9M2mkHLzquK/q51fh3DATzX+llx8LB5aKorPWnRHxCovFVqaMz5uKYAeZDDI SWMImBYYNixKH5gmjCPYr4GO3n1OYwIpUM8EusoNM9M+UBXrrcUTLd1q7kn+5DGgLNeN to9+/iaZbyR2PZnZmZU0Wfw+dJ1aCSIMd+dwk= 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=P9u5NqvqMl22xGhcG/VI5xoMMiekv1o5CaYnjb0ZKeY=; b=bFVNMWUqXxEwrjZoMOkFkbdfZW6ZbYjnUtTjVvxoCr7G442ahPCNxJvpgmVHrxoUdQ FeIVnchuj9xTdZlNEyLraWkp9z8Ar/d5n2cpcIPuQkkgvMz8PhToX8rZS9uH2QJTSEf0 ftb37KUpLWjP+pSlYT32KaKMghv9Qvgzk+mR/yfgUyf19bPgOhE80T9KqoMaI8UXeeKy Yx/WWlkc6Q7t4aNtAprbEpwASBqAwQDif1RrLGejeWJyE65pkMCK5bLuSvhEz6sS0dIu wC8wcM8fTyjqVfUT7O14826rklf+4X5wVgeo84ffaIp+TkKxBgfq8zR60+g/vH6ZE6i5 qVBA== X-Gm-Message-State: AKGB3mIoyp+WrPwA8frPqxSl8ykQ3ZcI8aDbCvMkyHiZiQVmmumfa30B mDhKE5bf7WrUSf/HR0aS8fBMEufwrd0= X-Google-Smtp-Source: ACJfBovFS6LbRA/1lZzZH3JNaeZpE8rKt4O/DPWidTkIz1ARL702ZV0iWSyA3WVxcCusvTzOxlpkdA== X-Received: by 10.80.244.16 with SMTP id r16mr35157842edm.26.1514377592101; Wed, 27 Dec 2017 04:26:32 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a5sm28388838edm.47.2017.12.27.04.26.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Dec 2017 04:26:31 -0800 (PST) From: Bryan O'Donoghue <bryan.odonoghue@linaro.org> To: u-boot@lists.denx.de Date: Wed, 27 Dec 2017 12:25:54 +0000 Message-Id: <1514377566-28512-12-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514377566-28512-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514377566-28512-1-git-send-email-bryan.odonoghue@linaro.org> X-Mailman-Approved-At: Wed, 27 Dec 2017 12:32:58 +0000 Cc: Fabio Estevam <fabio.estevam@nxp.com> Subject: [U-Boot] [PATCH 11/23] 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 5591cb5..8ac4f92 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> --- arch/arm/mach-imx/hab.c | 7 +++++++ 1 file changed, 7 insertions(+)