Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6785335ybi; Mon, 8 Jul 2019 08:38:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxns/iE4mniSLp7sH1tOkYES3GTqpQo+LSPc29AhtwXUTgdrRr/WBEQ+nLnZGCQv0cWoO6a X-Received: by 2002:a17:90a:37e9:: with SMTP id v96mr26071094pjb.10.1562600301329; Mon, 08 Jul 2019 08:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562600301; cv=none; d=google.com; s=arc-20160816; b=as8dnFoqeP0XJ/1rSMf79RkEsL2QfKE0tLwM4hYUuXQHK6Nx3HY/wx0UM1fC8sRJ9z d/Bdeajt1zqfkbPVoVPK0OV/yuNDV97VAodVVyMH2jzXt+XdIleRb1YvKne+Xnb8y4BK kZz/0THAReCFwn2kh1RHOXOEQQw7Wy1ezJGOwEQ1TYHttNTQIAKVuyPWfpKt6TyJndLD /Ongcw47v6kZb9xb0VCwAx+o9KVLRwHkodpYhdMoYNI4ZIydjQgmSB5QZMI/0ScRA1c0 8mAzm6ARA4mGSOo/maDIHDEdWgr6Jkb9iZSRsXj5P+6jb4ezfvwBV4fOrvBBNeUmKDza nzVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=npqySXxQJqr1J3/GZRe6O8hTCPlMMiJyiSs1T8dWZoE=; b=y9HsDxaelv/qvW7VH00dv2uZsqGzKsFIFFOOTHymZY3Pl2ejemwpD30BA94leSslIL 79L2UYKSc/Rq3UGpde4v6nhZT6q0JciXdaLTdoB0gd89BtqRCrrU15rFVwaLgoQhcqc8 gb7hHNpqcVGeZJ8vzDCGIIjZW66KuTSGYf+qOXWLxxwpFpQ8JIOQBB8oGqoaycTmQZSK 1P8zudfKaIHVTRZq237SBEavA1UKBXOSh8ot1TRJCdOR1cilzSVpcEOFHIpUWhjIkMdG d//aa5fgDEZ1010LlFf4Jq/aD2b/vB+BiaBpm2MQ4DQQNAjbxKQwFh0oMvuactH6JbU0 BiGA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id em9si8610879pjb.37.2019.07.08.08.38.05; Mon, 08 Jul 2019 08:38:21 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388663AbfGHPZp (ORCPT + 99 others); Mon, 8 Jul 2019 11:25:45 -0400 Received: from mga07.intel.com ([134.134.136.100]:18169 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388641AbfGHPZj (ORCPT ); Mon, 8 Jul 2019 11:25:39 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jul 2019 08:25:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,466,1557212400"; d="scan'208";a="363835132" Received: from jsakkine-mobl1.tm.intel.com ([10.237.50.189]) by fmsmga005.fm.intel.com with ESMTP; 08 Jul 2019 08:25:35 -0700 Message-ID: <846cacae8cede764a2e84f628f539d94582fdbe0.camel@linux.intel.com> Subject: Re: [PATCH] tpm: Document UEFI event log quirks From: Jarkko Sakkinen To: Randy Dunlap , linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org Cc: tweek@google.com, matthewgarrett@google.com, Jonathan Corbet Date: Mon, 08 Jul 2019 18:25:38 +0300 In-Reply-To: References: <20190703161109.22935-1-jarkko.sakkinen@linux.intel.com> <6acf78df-b168-14d3-fea4-9a9d2945e77f@infradead.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2019-07-07 at 12:33 -0700, Randy Dunlap wrote: > On 7/5/19 3:15 AM, Jarkko Sakkinen wrote: > > On Wed, 2019-07-03 at 09:45 -0700, Randy Dunlap wrote: > > > > +This introduces another problem: nothing guarantees that it is not > > > > +called before the stub gets to run. Thus, it needs to copy the final > > > > +events table preboot size to the custom configuration table so that > > > > +kernel offset it later on. > > (so that) > the kernel can use that final table preboot size as an events table > offset later on. > > > > ? kernel can offset it later on. > > > > EFI stub calculates the total size of the events in the final events > > table at the time. > > > > Later on, TPM driver uses this offset to copy only the events that > > were actually generated after ExitBootServices(): > > > > /* > > * Copy any of the final events log that didn't also end up in the > > * main log. Events can be logged in both if events are generated > > * between GetEventLog() and ExitBootServices(). > > */ > > memcpy((void *)log->bios_event_log + log_size, > > final_tbl->events + log_tbl->final_events_preboot_size, > > efi_tpm_final_log_size); > > > > What would be a better way to describe this? > > Yeah, I think I see what it's doing, how it's using that. > See above. > > OK? Your propsal looks legit, thank you. I'll send an update that tries to address yours and Jordan's feedback. /Jarkko