From patchwork Wed Oct 23 17:31:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 177337 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1040278ill; Wed, 23 Oct 2019 10:32:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxILg8PwuxC6WLbZCMsg5CZDAhk5bkRs2HeHYIa5dIb4j3HMPKCm/BMNndjz1546+kgdxK2 X-Received: by 2002:a50:ed05:: with SMTP id j5mr38571163eds.251.1571851928347; Wed, 23 Oct 2019 10:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571851928; cv=none; d=google.com; s=arc-20160816; b=sibGLONU4C4nkNQLZ/xQ/0Vz9Q+Gyz26meLEja5/bqHxQf+2nhCxK1NvCohmpsxZcR P8lwKNN/+xq9ZS5m9NskyuVVoGRcPON4a2gQD38j1QS78Bt/Z2GELjPHJ6EQKsbSTDnw TAO7t21qXRBBiSFqsx1Be2hlWv7sBiZr/ZmI+8tI0PvbzQX+hNU3uRLeoT1Cz6I5bnn6 caKbBdeJQC+dQw7bRGDQtS6zM7rdLu+R3y7ptJoe9rIUaDSioum0o5T9lVJMRMirTzH3 Cg4xxocKhbUfSFuKjIVX5052a52uHLOjvaBIXw40jvGCDUTQzH1YspI62b/Msrd0vRm+ /PHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=LMJXqmk6RQTbWYCNHCam9h3+n8eYtkpYb5J9t6ynQv4=; b=lTMrMMWw+trzPUWZ8952FQRwLsoRer9PG54Gv5K4MJRHfszysSI31ps74nP2SuSbHu cyKaBxINCkIdR9EbqcP6T1RigCQEkChqlEv+r6qq5RapAdCjUE/WwYky1/A/zt82y8Z0 1/qNkVHuxLOnV9LFLQfjHC+01wU6yA1yNDMcNno2GgFj++Iqg5mW1rG0tLPfPwcPVFXI NvzrDbdVmuVo3sd7bSyxfvxZOMRT17nqd6P0O8W9MqdgnwGX/gjCZyG2pUELJvvU3bUQ 9DIT450vwz6jnXek11v6rRuZWaT6BqE6w+D2gdepkJaMb4nrHBX+Bqk1jw88d5vVqhZ7 JOJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TOaj2vgs; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z44si6691527edb.418.2019.10.23.10.32.08; Wed, 23 Oct 2019 10:32:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TOaj2vgs; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729249AbfJWRcG (ORCPT + 3 others); Wed, 23 Oct 2019 13:32:06 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:38176 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728832AbfJWRcF (ORCPT ); Wed, 23 Oct 2019 13:32:05 -0400 Received: by mail-wm1-f67.google.com with SMTP id 3so20476776wmi.3 for ; Wed, 23 Oct 2019 10:32:03 -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:in-reply-to:references; bh=LMJXqmk6RQTbWYCNHCam9h3+n8eYtkpYb5J9t6ynQv4=; b=TOaj2vgsemOLgcAdk2Q++vNiURX2IRRaQjRpl/iS81HHZqob6R8ZiNwdCgG9qjhfwu j9tRZ7I+4bl0v8HbusUmSBNsjAQdSgt5zfPP70oozlSFSRF5P9i6t6eDf3lz9K1DPg+t aBXCFmJv3Rps0Dt8ox3QLKZKvow0rlWkdSkbMoRJ9TUg4NdJeGl37q32xBWeCqwdygjc qcAHztoWvtBV7GLuy9/jWjT5RVNCsmeByDVkI7POAI0vNNqp1uYFRtSXbIjfGEoMa7Wk oEipeSJ3DyTKYe7fuz67V+lybmXC4owCtfAAdIH+vNqMeK/7dCyTFyoIUvVimHN8uSoN ubOA== 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=LMJXqmk6RQTbWYCNHCam9h3+n8eYtkpYb5J9t6ynQv4=; b=OYBQfygnGN32c9F9pNdED3r/WRp4CKoz19qwZoqOU62cOE/AlXu2Ba6HliGXcdEeX5 eYm9/2C8MeMdStib5jUVUMKShGge3++xuh/nmSQdNndg47oL0SvalWUNpOVhMYt9ovqy MqAjCo6Z4rJnvWdbpjKbnhBjYI7tvtO3m/cF6cdM3SLaIWaWOrfO7RQjirUlHxtTHG6R YHoR9ARpA02XaW1xyf+rR9w/AuFbJYPVi8BJktbJGFaFy6IdNBvT8b2YoKF/SQqym2Ax r2DpdmJAKumhRYzwefkxwcK0p9AnAlh0SOT+G6OFzXR9jlao4qrugilkVmr64F13mGTB s0iw== X-Gm-Message-State: APjAAAX/pBC2Hv2A62GxSvHQC0SCVKd0hiG/J/SwR9i079nQ8o23NBW4 rjpuWmjhnL9GE41sp0ulyg8Yxk1SQz2xbibl X-Received: by 2002:a05:600c:21c8:: with SMTP id x8mr861248wmj.123.1571851922155; Wed, 23 Oct 2019 10:32:02 -0700 (PDT) Received: from e123331-lin.home (lfbn-mar-1-643-104.w90-118.abo.wanadoo.fr. [90.118.215.104]) by smtp.gmail.com with ESMTPSA id f7sm14900374wre.68.2019.10.23.10.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 10:32:01 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Narendra K , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] efi: Make CONFIG_EFI_RCI2_TABLE selectable on x86 only Date: Wed, 23 Oct 2019 19:31:57 +0200 Message-Id: <20191023173201.6607-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023173201.6607-1-ard.biesheuvel@linaro.org> References: <20191023173201.6607-1-ard.biesheuvel@linaro.org> X-ARM-No-Footer: FoSSMail Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Narendra K For the EFI_RCI2_TABLE kconfig option, 'make oldconfig' asks the user for input on platforms where the option may not be applicable. This patch modifies the kconfig option to ask the user for input only when CONFIG_X86 or CONFIG_COMPILE_TEST is set to y. Reported-by: Geert Uytterhoeven Suggested-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Signed-off-by: Narendra K Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/drivers/firmware/efi/Kconfig b/drivers/firmware/efi/Kconfig index 178ee8106828..b248870a9806 100644 --- a/drivers/firmware/efi/Kconfig +++ b/drivers/firmware/efi/Kconfig @@ -182,6 +182,7 @@ config RESET_ATTACK_MITIGATION config EFI_RCI2_TABLE bool "EFI Runtime Configuration Interface Table Version 2 Support" + depends on X86 || COMPILE_TEST help Displays the content of the Runtime Configuration Interface Table version 2 on Dell EMC PowerEdge systems as a binary From patchwork Wed Oct 23 17:31:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 177338 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1040291ill; Wed, 23 Oct 2019 10:32:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwO2iF4wny1dcFT/Mm5AiAl5Thxh1ERDS9AnRt3rsNwmgyM8jw+lFAAH8Hcv5DbsOP/i01z X-Received: by 2002:a50:bac2:: with SMTP id x60mr38400207ede.96.1571851928655; Wed, 23 Oct 2019 10:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571851928; cv=none; d=google.com; s=arc-20160816; b=x0XKDNLKwG77r9qyKn97kvCw41+6imO7r4ft16FkhdCam8rvSdoygKatRR/LQUaApH /9s/PLF38NLooCNu/Hy9/7b6FpQUMzF1pzSsslHB96NAyw8KVMZVM+2mlnkhsiYnqBd9 C4Q/n81qc3AiYhx0OAo9XZdwnaasg2mlV3ZN0Ou8vltPUA470T4kq9ykhkNPl4kfDCpT LCi903qPj16TpViDTpWLTympGJQXc6pP9Aqa+hx3bmhIOC0Acuc5hZGhujQooBP3lwCC 99x5nbTcjdG1u+AF0SCo/qF1FrX7uL4kQxsjTpwEYQosdnKTmFAzn7KX4qrr5ZfIyOZE 3vJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=wkSWabqYVL066Xoh2VEh6KAZRi4MksvH/vrykc5mNu8=; b=nqPXQKAjzy/em3wn6gSwLs+N8WmnkjdsfxsrwWhkeQFYsIh3omwYiyVD/W+xoj12iw 6EjW/jlk6qgIZYTeBAwB1dq4F6Fw3ecnKrTywHU4uqAjBFSyX6II+LnaMnuSlf+NH7dr y6KqwJFZrNlbLgOvnFhujdI5h2RQYuPBWDfy1cupKg7mZ4onUxIGzWo+9Zd1YDB2NYaM /9NbwhdbAKXb18eFopt8enPxKJzO2gtTMNdydb2DPurReysrZPcobSj1VVKFWYpB/pc6 Wf9aOLMeGII2wLLwcVduEK4Bu6t+MEd4P518wWvJ54ukmzJQShDEek/+vkLoV0EL/VwD 9Efg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CgvSGucE; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z44si6691527edb.418.2019.10.23.10.32.08; Wed, 23 Oct 2019 10:32:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CgvSGucE; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729947AbfJWRcG (ORCPT + 3 others); Wed, 23 Oct 2019 13:32:06 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41484 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729871AbfJWRcF (ORCPT ); Wed, 23 Oct 2019 13:32:05 -0400 Received: by mail-wr1-f66.google.com with SMTP id p4so23019856wrm.8 for ; Wed, 23 Oct 2019 10:32:04 -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:in-reply-to:references; bh=wkSWabqYVL066Xoh2VEh6KAZRi4MksvH/vrykc5mNu8=; b=CgvSGucEXePDgb8HdjupEKmoCsfnrmGoc0SxZhaKnsPQEzyPYUcSQFwcJnbR0krN8q VX72j5JlYGgnGcQm/oQQJ/ljNtlO6cDakEe+QRyytOLgpzuq66qzM+4QvHSzgodKPxwn vVGkk/HhJXGSojQj5WKh3I8K6mofh1N3nPF8TbIIazVdOWWFCjGFBq2MAEwDI7VX52TG N2IiLk5LnzGwvso2360v8V3/W8mMJdOErj2q7OQSLoluHuypaUfiwBhkB02iR8Ipb1Zc hrEcPwSM+UGTS54oreMCu45yPBRz6RpSGxjSJcGrqv3XGl71gi1jOfU76YejZT6qNZO+ z8AA== 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=wkSWabqYVL066Xoh2VEh6KAZRi4MksvH/vrykc5mNu8=; b=gSSf7k6n6OXcI91SQ18cuOjcxELItQJa4AbQxeKAtekZmjbitSad0L5g0Oqalnrt63 6U9mxczJ5sI5jbLQkyvvjmV8JDFJ9xyScawfGPXWl90yqFMOEXiV5Ls9DhgOcmD0UorV lP8MMoRES9Nxksc13eyAKxvT5ub5Y9UyGdg7hVgfbVrdyPNr4wWiuwKY+1QnkhibNvkQ 1pDD1VPkqgxY2v6ZeWqS65nVXK5CK4n1l8wFA0jr8pU0WAnnLBpzEEbfm5WEKNUzu08d VFLdMaIo9R7fZOKz9bmiCYdgvhAQ/BHAu9Z+FCiP1dxcQHL6/P0u5R+fX+/gXEsdgB5i f6UA== X-Gm-Message-State: APjAAAUGxyGANkqASuVasKk4k+gokXHyJ4g8jpL8bDK6ooenJtlqNeb7 ts4wm1m9YgBle019uitWjhgkzIIFQYqkyZPb X-Received: by 2002:adf:ee10:: with SMTP id y16mr9429013wrn.67.1571851923689; Wed, 23 Oct 2019 10:32:03 -0700 (PDT) Received: from e123331-lin.home (lfbn-mar-1-643-104.w90-118.abo.wanadoo.fr. [90.118.215.104]) by smtp.gmail.com with ESMTPSA id f7sm14900374wre.68.2019.10.23.10.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 10:32:02 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Jerry Snitselaar , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 2/5] efi/tpm: return -EINVAL when determining tpm final events log size fails Date: Wed, 23 Oct 2019 19:31:58 +0200 Message-Id: <20191023173201.6607-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023173201.6607-1-ard.biesheuvel@linaro.org> References: <20191023173201.6607-1-ard.biesheuvel@linaro.org> X-ARM-No-Footer: FoSSMail Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Jerry Snitselaar Currently nothing checks the return value of efi_tpm_eventlog_init, but in case that changes in the future make sure an error is returned when it fails to determine the tpm final events log size. Fixes: e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after ...") Reviewed-by: Jarkko Sakkinen Suggested-by: Dan Carpenter Signed-off-by: Jerry Snitselaar Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/tpm.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c index ebd7977653a8..31f9f0e369b9 100644 --- a/drivers/firmware/efi/tpm.c +++ b/drivers/firmware/efi/tpm.c @@ -88,6 +88,7 @@ int __init efi_tpm_eventlog_init(void) if (tbl_size < 0) { pr_err(FW_BUG "Failed to parse event in TPM Final Events Log\n"); + ret = -EINVAL; goto out_calc; } From patchwork Wed Oct 23 17:31:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 177339 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1040310ill; Wed, 23 Oct 2019 10:32:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0ne6g/tMMUY5oHsmt7ex80vaIzz7+QBsj+/0pS+42IYGuG+xwQUuDp3pncI6F9Vq0fPYR X-Received: by 2002:a17:906:6a15:: with SMTP id o21mr33362987ejr.79.1571851929513; Wed, 23 Oct 2019 10:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571851929; cv=none; d=google.com; s=arc-20160816; b=eaQoqAEEzPZeYyM9atzf88FCDcSXSXFwcP3hYq3OXWiDkgU3MxeO7IYoU3hZFkDCjx otsRQNvS340JC+r0T3hrQ5tI3Dcwtkptvm4z7pS2FtJ4XPjDpp6bsPl/IgFcs0YXpd/M E3kxwZbwG34pELahylLr7sOWfeBdKyXsFzR4XoxD5F5gg9eiOEynE7/j/dSuY4DfR+Sa dZTZuct/Mbt0/ofOlgDeo3FCaOgzTvk2pqPcASHPjDTeT0SLOACJhuccKVIOLA9TKu3F onoRPzkTjJ5/yetA2pXqLtLW4YYajc9jtGcbHBPjyOXX14lFDrh7Sg57G4qIo94fIOaO k70A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Mqk9lnQxsCRkESOqxWXPCiFE5tGlzXJcbsR9dSjU8io=; b=oFsn5GsCnAYDMu8yb1oYGC8yKmaBbir/gFClVNDnJHSApz6T4qnbqg4CXH2+J+IYEZ a05ys/nKba15TxemjQ5w3u/XpvW2Ldfw8l/KVEpKGESR5NGGw4+QYPjnOc/KhHWyE8Lp D6w2RFUjSUKP82jF0VYYN4z2EKelewUWS05aSfM9kJcISw+b7iUNtN+aV0D2YaM3NJDI eeIDhEU9l1i3KsH66cUoUtb4ewc4Z52LcgA87aRmxOlk2s6jMA6H1IFCtF+GMhr/dydm qcm4fYkNFH3eKU0NtkTDKEMw2mOv5kWgVPVmw6BXjA8KMQml4pf+JW2wZWrpU6lWYihi FByQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pX1fAvco; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z44si6691527edb.418.2019.10.23.10.32.09; Wed, 23 Oct 2019 10:32:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pX1fAvco; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729963AbfJWRcJ (ORCPT + 3 others); Wed, 23 Oct 2019 13:32:09 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36168 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729112AbfJWRcH (ORCPT ); Wed, 23 Oct 2019 13:32:07 -0400 Received: by mail-wr1-f66.google.com with SMTP id w18so22475200wrt.3 for ; Wed, 23 Oct 2019 10:32:06 -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:in-reply-to:references; bh=Mqk9lnQxsCRkESOqxWXPCiFE5tGlzXJcbsR9dSjU8io=; b=pX1fAvcoTDxwW/VJpbfmFNtdo4fhYGst7dtK6Ws3sqRgZamLy4biv+zY5OdGO4Fq5P uf9m57CdjurB61LX7RzR6sh0KZJakGxXmLfRRkqSIp0oF4V901ZccrxnB4FV+p8xloQn dtI66Q02YRDXTJF5I8+RO4ZkaofmzAW2UHkc6dvK3vANpPOheuq8QSjW9uPMIUh/zFvW ykVzof8CUBheJ32MHr2WwuuTROI3jCVIJHOAF6Z7Tg+0/15AAFv+qwli1hep1yGjiTAq 3hZzC9l/fkR6UJt8edKNrVIiVmIXzK0KtecWks3ioBllug7N5WUqOzt7dWImmP+F1wUr HUQA== 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=Mqk9lnQxsCRkESOqxWXPCiFE5tGlzXJcbsR9dSjU8io=; b=b1WAJF9zkCc4KBy3OhQVwH8MMFHmt5mQY1B7KUi6tINFsl6RP7I1XMA1rPc4Rkeg4K F48tUdwjLSQoixP8gxrgopppMAEGLZz/DLBvFeRdtfYFn/b2kAO4meXqe2gMcLPF+epq V1gaDLulU8o0bajc3q7zfen+ztRsmOspX9JkONPmvoXRoLWcaYlOdO90U2Zm3UVpWeli 4dfG+yGc8xQ1jiVqtrvLRg3cQpjEKVqCOjJ1UqSPGRPRH1lXlRhiYA72b6qdudLR4PUH aikP/aYKdab8Gh7wPcwcYYgOCCk96J8zTXjVgy8Y2tV6IRuN/D1ksK7poUSo/p737sP4 t8Dg== X-Gm-Message-State: APjAAAUYl+xC/iNoSQYg6bixwWzuGA38nt1mLBRXRYp8BxPn7Zz8q+1r 5LGKVkKyVBbGnbD2r1BDr5a1LLrmz6GHk23B X-Received: by 2002:adf:b1d1:: with SMTP id r17mr9509023wra.201.1571851925290; Wed, 23 Oct 2019 10:32:05 -0700 (PDT) Received: from e123331-lin.home (lfbn-mar-1-643-104.w90-118.abo.wanadoo.fr. [90.118.215.104]) by smtp.gmail.com with ESMTPSA id f7sm14900374wre.68.2019.10.23.10.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 10:32:04 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Dominik Brodowski , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 3/5] efi/random: treat EFI_RNG_PROTOCOL output as bootloader randomness Date: Wed, 23 Oct 2019 19:31:59 +0200 Message-Id: <20191023173201.6607-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023173201.6607-1-ard.biesheuvel@linaro.org> References: <20191023173201.6607-1-ard.biesheuvel@linaro.org> X-ARM-No-Footer: FoSSMail Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Dominik Brodowski Commit 428826f5358c ("fdt: add support for rng-seed") introduced add_bootloader_randomness(), permitting randomness provided by the bootloader or firmware to be credited as entropy. However, the fact that the UEFI support code was already wired into the RNG subsystem via a call to add_device_randomness() was overlooked, and so it was not converted at the same time. Note that this UEFI (v2.4 or newer) feature is currently only implemented for EFI stub booting on ARM, and further note that CONFIG_RANDOM_TRUST_BOOTLOADER must be enabled, and this should be done only if there indeed is sufficient trust in the bootloader _and_ its source of randomness. Signed-off-by: Dominik Brodowski [ardb: update commit log] Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 69f00f7453a3..e98bbf8e56d9 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -554,7 +554,7 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, sizeof(*seed) + size); if (seed != NULL) { pr_notice("seeding entropy pool\n"); - add_device_randomness(seed->bits, seed->size); + add_bootloader_randomness(seed->bits, seed->size); early_memunmap(seed, sizeof(*seed) + size); } else { pr_err("Could not map UEFI random seed!\n");