From patchwork Fri Jun 22 06:42:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 139574 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp509045lji; Thu, 21 Jun 2018 23:42:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ8jyVRwG+gSG0fPUR4FI/W3sGpbg+2Jn7MuEkQ/CpdEERVozhFbomateDDGwzzEAuqafHV X-Received: by 2002:a17:902:6a89:: with SMTP id n9-v6mr349760plk.302.1529649761681; Thu, 21 Jun 2018 23:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529649761; cv=none; d=google.com; s=arc-20160816; b=U+/kVUTCm15tqh03949Dk1KLrmpSMptwSl+2FhrEDSkhbVEuuE4HyviEY/FjdJ7rR0 xgXWgXcjvPgHm7/CEDWckQEx4dHjlRrrFdNFh6ta0cmPVCxCVXumpR9DY/kMobYLfQxC TCDsyMWinuOj99BOaduHXSMbqVM2zqLMQa2ftwo4kfg5fw9pPef6zyYr2LKC/zhesUzf iOybX4hUP00TYnEHqNBBGObJWoc6xWw7+82bk7sexff/jp7G7eve1r1c8n4lYHFLA7Bm SMMWfS7VLKuDY9IBw679Q14sMfi120OKJOGrbeMrhyQkd96K+5NExo97yNQsMxNIAW8I SmWg== 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:arc-authentication-results; bh=tDTb5yk+4TsWEinOG+0J6Iq/28XF3bjoltFznxl48IM=; b=fK69N/qW1lEbAQxM9nbjkkyyOQ/EJSiwkU4ARx2TKzS4zBBUXiLXYXrJaV7qqUWjvz zkK4mPQ1tzCgyUjp7CbC7C7g9QZVLEBNnp602sQP3rNLPumpsD08VkR6bndDm0oNvGFt NUV1Sw3tKvqzrGHynBBZbD3Vp40oo0Nm6llXMe6jEfrBYAKloj3JrLX/EmjI/hkd47BO RClNjb5KE7MEuvDE7z2ZCXQYiHmkWTivMAMsPHrJHvlTQPqjZGRu/mTNtE+CKCi6Ff+0 ATXNiLniZKkJuibu6qLwUZubEYLfxoapnBC3GRM8RvB/6T/EinLDkitcoea5B2plHZBF uTGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bjSerDqm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 q14-v6si6638640pll.324.2018.06.21.23.42.41; Thu, 21 Jun 2018 23:42:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=bjSerDqm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1751352AbeFVGmj (ORCPT + 30 others); Fri, 22 Jun 2018 02:42:39 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:43947 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751243AbeFVGm3 (ORCPT ); Fri, 22 Jun 2018 02:42:29 -0400 Received: by mail-wr0-f195.google.com with SMTP id d2-v6so5473760wrm.10 for ; Thu, 21 Jun 2018 23:42:29 -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=tDTb5yk+4TsWEinOG+0J6Iq/28XF3bjoltFznxl48IM=; b=bjSerDqmNKX/RtJeZQhuVJD83kvhkAXC7bd5eJMnAhwqWmqyFbY3Y7DVSa6eXBdJRz 8TVxWWECjk/srRmhh9fIE8L8/BTSRjNWdgOEOwe0UA0ATdwRaHTPoQYiMjE/1UuRsmG2 GdZsqmahCiBZAKBHIv+iEy/c7wpktt0gOihfk= 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=tDTb5yk+4TsWEinOG+0J6Iq/28XF3bjoltFznxl48IM=; b=OHyKv8qoGLB9AeqsOKxxs3Z8safRCckhDKfJsFMCKZkcJuqWRDp4vlFbc9b3hK5zCz 3Lc4QD9fk0H02tqoLSgnPtmjSwtl/EHGsqLURzNz9lxOGf67FVucOnXKruTWwJ3qGiL5 mPeSWJoGTPuHy2XzymjThS2uIFfmcDsxYN+iVo+oDi18w1mnuuPSHhYOgJlOOVpsYJ+e X6s0w5XSSV0y7fDd2dn+TlxoNcNjk2U3o56bx3ioEFlXcjsDUA8lErj6i3evSV4JCjt/ bJln5w/Um5igyZEPDNrdc9mz/6PLXdyNqyYgVO+ToLVqMP3HXsy20UCjHlfz+niL3Gbu rWtA== X-Gm-Message-State: APt69E0xyXCBOo0FbbVPREJVcVAwnPZNDcEvmCWfhNrxQl35lcEoizBm 0tFcWif0zDUBDzj9pHAbS2MISg== X-Received: by 2002:adf:a645:: with SMTP id k63-v6mr396461wrc.231.1529649748569; Thu, 21 Jun 2018 23:42:28 -0700 (PDT) Received: from dogfood.home ([2a01:cb1d:112:6f00:d0d9:3abb:8cc4:581c]) by smtp.gmail.com with ESMTPSA id h77-v6sm1627156wmd.9.2018.06.21.23.42.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jun 2018 23:42:27 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: ard.biesheuvel@linaro.org, Hans de Goede , linux-kernel@vger.kernel.org Subject: [PATCH 1/1] efi/libstub/tpm: Initialize efi_physical_addr_t vars to zero for mixed mode Date: Fri, 22 Jun 2018 08:42:22 +0200 Message-Id: <20180622064222.11633-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180622064222.11633-1-ard.biesheuvel@linaro.org> References: <20180622064222.11633-1-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede Commit 79832f0b5f71 ("efi/libstub/tpm: Initialize pointer variables to zero for mixed mode") fixes a problem with the tpm code on mixed mode (64 bit kernel on 32 bit UEFI), where 64-bit pointer variables are not fully initialized by the 32-bit EFI code. A similar problem applies to the efi_physical_addr_t variables which are written by the get_event_log EFI call. Even though efi_physical_addr_t is 64 bit everywhere it seems that some 32 bit UEFI implementations only fill in the lower 32 bits when passed a pointer to an efi_physical_addr_t to fill. This commit initializes these to 0 to, to ensure the upper 32 bits are 0 in mixed mode. This fixes recent kernels sometimes hanging during early boot on mixed mode UEFI systems. Cc: # v4.16+ Signed-off-by: Hans de Goede Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/firmware/efi/libstub/tpm.c b/drivers/firmware/efi/libstub/tpm.c index caa37a6dd9d4..a90b0b8fc69a 100644 --- a/drivers/firmware/efi/libstub/tpm.c +++ b/drivers/firmware/efi/libstub/tpm.c @@ -64,7 +64,7 @@ static void efi_retrieve_tpm2_eventlog_1_2(efi_system_table_t *sys_table_arg) efi_guid_t tcg2_guid = EFI_TCG2_PROTOCOL_GUID; efi_guid_t linux_eventlog_guid = LINUX_EFI_TPM_EVENT_LOG_GUID; efi_status_t status; - efi_physical_addr_t log_location, log_last_entry; + efi_physical_addr_t log_location = 0, log_last_entry = 0; struct linux_efi_tpm_eventlog *log_tbl = NULL; unsigned long first_entry_addr, last_entry_addr; size_t log_size, last_entry_size;