From patchwork Tue Jun 22 14:38:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 465169 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp715542jao; Tue, 22 Jun 2021 07:39:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3cL9wxw9GvCrAkvgyzGxAN3dSCcjN1ZBmsuNfF0sJWIjQVJZE8i9O+iXtPCTlftr6jJGp X-Received: by 2002:a17:906:585a:: with SMTP id h26mr4379832ejs.31.1624372762771; Tue, 22 Jun 2021 07:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624372762; cv=none; d=google.com; s=arc-20160816; b=aYfzAMpQkWGwR9Bqh2BomDbH2glvZypKiJtTOLjk78VUIpjo9u+srZ8xSo9jmXf7hh xNFK5G0qgtMx85MqVgusZ9xIeOoro8+TtVg5cSrC9MZv96e8C0P0Q8Y0VlInZfa2KW0z ibjZXMGcxc5KQ2J+TaJdxBTtS8WWQTp9uIsQe6RWcJlsA73VVkT9c950jdQfexsOPuPR VL7wNIz0mlYiwisZ0yzRxZY9SmVOJNXZuCGEJd8vfBTNpXi0s+Y+s+4KKso2+ecN1moT CzvNU3dW9B3iA/z50qvp0ODwoO0Qf9X7nPKX0EGgdvdE/Pxg9vioU2gRfs1UnfWdgOHA Ofvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=sujtLF292oYFVhzMF5y3Tfd2OO0snB1vQaRoWfQRvKE=; b=Az8UkDOaUGbuvBmlDXi2MooGf5oPyvpd8D0gUVPqJxEES53x5jdxTJ40IVCCXPfDoR w0EkBlQKyllNinT40rtLQ0WwcAyvMM2lLbJKHBua2TSBqC4lKxUuOQYu5stM00sNu1kS 8QTGf4e6FGn+jVUnr0ZKKDmCT44UyJ3RG+J4I+rZ2jaTRjegYmnaqRiDtAo2bihAVZqW NuN0BetnXUwZDeRvJX1NcO3mcYhOj4yv7Z7m+fsTpLsScv+BgBrbG+WEmQL15Wl74/ZW C8aipi9jKEuWVxFEAt2KDz9GR0u0PLlPLbVYvU9fCJTt5xgz3qiLjwopYAEKdtafLwU1 BMmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pAhYN6mv; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id gv6si2927402ejc.459.2021.06.22.07.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 07:39:22 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pAhYN6mv; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 77CA6829BF; Tue, 22 Jun 2021 16:39:11 +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="pAhYN6mv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 28E26829B7; Tue, 22 Jun 2021 16:39:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (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 64D7280F32 for ; Tue, 22 Jun 2021 16:38:58 +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-wr1-x432.google.com with SMTP id d11so21582521wrm.0 for ; Tue, 22 Jun 2021 07:38:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sujtLF292oYFVhzMF5y3Tfd2OO0snB1vQaRoWfQRvKE=; b=pAhYN6mv62u2H3IZ0Kr+nmm7g0MD9QE6xGOovRtxsgt/GP/zzVMRdBkBhcBA2kbkhN ud8LVDLGZwm7vyInLp5nFBc6qJjq14cKAp00FLFvmEaC5I/UxEZvTb1eZbsjSSSHjYbH Jz5ronutHhvLI8YbzxBn0CxPNrtilFMzHlxr6U9DovSNmbmr75gY9tzygF91bwIOAfW7 5/knXgO4YYofaL587QQIh2n9cJ81Z5Jo1NrAIlhiOoo/H9Zb+/SlgKYlsLYrpn9Tqhxn imqNEQyxOx+D9S9fX0BJ2ao9DnYHE8/QA2vNVrqarYAYJPGVV3/ezchOirXkaDLhyN1Q /cgQ== 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:mime-version :content-transfer-encoding; bh=sujtLF292oYFVhzMF5y3Tfd2OO0snB1vQaRoWfQRvKE=; b=dHi/oZSVwd/wpLXY00zgCcfwtPwjW5crQ8OghLq91PdinKnVndwFxsMKSmspcPaXdF pUg/1U3S7wKMmwUvM6/ncl6BszFf1bOj/Hqj3kyCLQGftvDaRbN9iM/cIe4bqLUNrzKP PPxCsYqOJRVveDMFTrcy4xeuImKMkUUizowYRU2xrxHnS03Wv1bnaEBUpfUjM0pjr1WO qWZkcPl99PjIKK7nxcnbZ2Y+lx9CUeB3LoexkL47O7nSVeH/RSt/sTMY7KTub2qiR+yn gb8gTq56FDnTSVnlZuoxc7dL9bg4dcIFLYLGT0dWEYMBQWiAY/pBCiZoRQPdAsoWX4eX 5Xlw== X-Gm-Message-State: AOAM531kKt1i/gSDsPdHYsvjrnbJnNLZCyG4BF/oXG6Ln3eBMRKGXWxK 46OxF5S3WF+pPZHAruP67eZA8Q== X-Received: by 2002:a5d:650b:: with SMTP id x11mr5473880wru.198.1624372737928; Tue, 22 Jun 2021 07:38:57 -0700 (PDT) Received: from localhost.localdomain (athedsl-419796.home.otenet.gr. [79.131.191.210]) by smtp.gmail.com with ESMTPSA id y17sm2615009wma.48.2021.06.22.07.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 07:38:57 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: masami.hiramatsu@linaro.org, takahiro.akashi@linaro.org, Ilias Apalodimas , Michal Simek , Alexander Graf , u-boot@lists.denx.de Subject: [PATCH 1/3 v3] efi: Fix to use null handle to create new handle for efi_fmp_raw Date: Tue, 22 Jun 2021 17:38:51 +0300 Message-Id: <20210622143854.15682-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.32.0.rc0 MIME-Version: 1.0 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 From: Masami Hiramatsu When running the efidebug capsule disk-update command, the efi_fmp_raw protocol installation fails with 2 (EFI_INVALID_PARAMETER) as below. This is because the code passes efi_root instead of the handle local var. => efidebug capsule disk-update EFI: Call: efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL) EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbaf5988) EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Entry efi_install_protocol_interface(00000000fbaf5988, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6ee8) EFI: new handle 00000000fbb37520 EFI: Exit: efi_install_protocol_interface: 0 EFI: 0 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Exit: efi_install_multiple_protocol_interfaces: 0 EFI: 0 returned by efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL) EFI: Call: efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL) EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbfec648) EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Entry efi_install_protocol_interface(00000000fbfec648, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6f18) EFI: handle 00000000fbaf8520 EFI: Exit: efi_install_protocol_interface: 2 EFI: 2 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Exit: efi_install_multiple_protocol_interfaces: 2 EFI: 2 returned by efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL) Command failed, result=1 To fix this issue, pass the handle local var which is set NULL right before installing efi_fmp_raw as same as the installing efi_fmp_fit. (In both cases, the local reference to the handle will be just discarded) Signed-off-by: Masami Hiramatsu Signed-off-by: Ilias Apalodimas --- Changes since v2: - Updated commit description Changes since v1: - lib/efi_loader/efi_capsule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.32.0.rc0 diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 60309d4a07d0..cc6ed453ed21 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -940,7 +940,7 @@ efi_status_t __weak arch_efi_load_capsule_drivers(void) if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)) { handle = NULL; ret = EFI_CALL(efi_install_multiple_protocol_interfaces( - &efi_root, + &handle, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL)); }