From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89301C636C9 for ; Sat, 17 Jul 2021 11:36:57 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C7963613D8 for ; Sat, 17 Jul 2021 11:36:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7963613D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D1D8780C94; Sat, 17 Jul 2021 13:36:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="w08ERtlN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 80B7A80F32; Sat, 17 Jul 2021 13:36:53 +0200 (CEST) Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EDDAB80C8F for ; Sat, 17 Jul 2021 13:36:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ej1-x632.google.com with SMTP id c17so19360676ejk.13 for ; Sat, 17 Jul 2021 04:36:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=R5WdtICJupg5swmjnJcB6NqQtOi2gxhf5E75Wom9zKw=; b=w08ERtlNNcWkvSNiY4etzFwnd6fAOhuuTBTQlv1qIV27swUmdPEFZ7ef1okJBKNmG3 rld9MjGEG3sv91KmJU3zzVZBQvofsH5nR551vbGGgh9Dov8Et7OAk2wZU7WkmfMk/MBq nkjh2EDUE8Qc1lasEeUZj05lIkgPJeql05Y6LsIp3OeKeH8lrtnfikkfT2Mw8hujlpAg mi04Jq+5gCReT6ZDGFKReW33+DrIJ5nQ/MR+6Zo7rC2OseZGITdJtc0T8tuOaWw4Kdz1 novoSCtbKHEWAGTlafx9a/RlmPd+nUdyBDx209JVMrd6loKmnuqNgpSkdC/LzfAe7tVb lE/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=R5WdtICJupg5swmjnJcB6NqQtOi2gxhf5E75Wom9zKw=; b=lQnyqzkoa0j5i4z46Mwz+kyDv/t4Yj7NL2R/VWxompYJYpMJIC0Syw+ZKhDBz7Z/kU T0+Fd5JsBIGWS59fAgqQN/9EcDu0NiNYlq5K5VDa/6cl6+Vhwh7EU4v7xIAhJUDVqHfy j56Z8w+lNlzZ9G6k6Bgv64JMwqwTiBiabQ5zj5zZ4L/gq9Qhe/jeIYRxJZFxJp4c+GTj sRU0qcX8mROS6i130vvWvdSkwuVcN9hFwSMRJgQM7HIBXup9cfHcQUcqL/GhzNBM9oJD qkXHO4lnLFBB6VdKQenmEb7wQ+2eqz6KyxR5R0qt8byYBuB7WyzZ8Pj9nAVlof6faVoA AmzA== X-Gm-Message-State: AOAM5331CM6qj875uGzuwlWGgipEVEjWBkdMGgZmlDjzOM3BJYYVSldy VAx3J25hDehL8rol1Sp/OA/a3pr85ntgC3zy X-Google-Smtp-Source: ABdhPJx3MO/WcORgNilEXSQrvU9U7ROJxAMd1vgYo/0zwkFp09BiuEMyym9dFu9M/SISu0zDfVs5FQ== X-Received: by 2002:a17:906:718c:: with SMTP id h12mr16653334ejk.6.1626521810643; Sat, 17 Jul 2021 04:36:50 -0700 (PDT) Received: from apalos.home (ppp-94-66-220-20.home.otenet.gr. [94.66.220.20]) by smtp.gmail.com with ESMTPSA id jw8sm3771251ejc.60.2021.07.17.04.36.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 04:36:50 -0700 (PDT) Date: Sat, 17 Jul 2021 14:36:47 +0300 From: Ilias Apalodimas To: Simon Glass Cc: Heinrich Schuchardt , Masami Hiramatsu , AKASHI Takahiro , Alexander Graf , Sughosh Ganu , U-Boot Mailing List Subject: Re: [PATCH 1/3] efi_capsule: Move signature from DTB to .rodata Message-ID: References: <20210715170030.97758-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Fri, Jul 16, 2021 at 07:49:09AM -0600, Simon Glass wrote: > Hi Ilias, > > On Thu, 15 Jul 2021 at 11:00, Ilias Apalodimas > wrote: > > > > The capsule signature is now part of our DTB. This is problematic when a > > user is allowed to change/fixup that DTB from U-Boots command line since he > > can overwrite the signature as well. > > Do you mean with the 'fdt' command? > > If you mean the FDT fixups, they happen to a different DT, the one > being passed to Linux. > This was only usable in QEMU pre-patch. I think Sughosh replaced the entire DTB (including the signature) on his tests. Sughosh? Cheers /Ilias > > So Instead of adding the key on the DTB, embed it in the u-boot binary it > > self as part of it's .rodata. This assumes that the U-Boot binary we load > > is authenticated by a previous boot stage loader. > > > > Signed-off-by: Ilias Apalodimas > > --- > > board/emulation/common/Makefile | 1 - > > board/emulation/common/qemu_capsule.c | 43 --------------------------- > > include/asm-generic/sections.h | 2 ++ > > lib/efi_loader/Kconfig | 6 ++++ > > lib/efi_loader/Makefile | 8 +++++ > > lib/efi_loader/efi_capsule.c | 18 +++++++++-- > > lib/efi_loader/efi_capsule_key.S | 8 +++++ > > 7 files changed, 39 insertions(+), 47 deletions(-) > > delete mode 100644 board/emulation/common/qemu_capsule.c > > create mode 100644 lib/efi_loader/efi_capsule_key.S > > Regards, > Simon