Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7512647yba; Thu, 2 May 2019 11:09:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzP1hSB+9CZRQ3xImNDpmOmI2q8Eu8WE9lK+TgDVWfUiSpNUKD0pk7xtCRoQm8SIbZ+U/Hk X-Received: by 2002:a63:e406:: with SMTP id a6mr5546431pgi.132.1556820567010; Thu, 02 May 2019 11:09:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556820566; cv=none; d=google.com; s=arc-20160816; b=matB7lXmMN1JJZP2fVa4sknOB7Yy5Nmv5QWWgO3rZ1LQMzUBg3Lp56MNvC4e40nUN7 YX3NphyewMDuTCdaII0oSltcW5xjVH2klQ9Zn+2yfMyTTSxJIX/vEZYTyTsEaOdLsmix rAdkvchH1xKFo0yjqk5bgQbJStg7bV3zDaHfM6Umg2oiyUAw+S76hjT0G+zfAvBmnU9z +a9aMmLhRWmzqOCsoyrE5eOxb9v/scXCVNLbzW/z38Rb3p9CY+H5f31hlW9Ry/Cl56Gx 1H3jxst0DM8Jzyd+9kztQO1gXbs0a3H+t8Gi7ng8eSHanbJhJkwKdveK9g3J3diQvZjg PbjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GYG9gid407fSTqcR1sS3MZsK+2t2f3wkYcvKU9idh/0=; b=j92btLC2qH4sp3rgIpiGGR6MelGu5eywPfSTUdNdMWEiVLySxqUEetKaBN0njKe0HO w6sBZPxWV8ln86rqzY1mQiswxeCr89TxApm5cqtRlG8KTvbbLdy4eGjsyqSZSt3IjP08 QDYOdlaLVBYlifZYTrzaUCjQEXFqWtyQ9oLOH8Rp7uJs4m/4+mLCW9ulmmX45emz8ZUw hNyKux3tS2tgbk4lxtzXC/3cQTmYIqZAojOdlviXfMU4957DzTTv1iBZypauuE3+WmR7 G4WvM/3URvq7B1GQWLyc6VVopnWhMUpN81+4HM/K0PwE2QRi7q0B/t4vwqqgWbwA2gPY kN6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=A+QWwBsz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d20si6026852pgj.43.2019.05.02.11.09.11; Thu, 02 May 2019 11:09:26 -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=@google.com header.s=20161025 header.b=A+QWwBsz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726434AbfEBSHz (ORCPT + 99 others); Thu, 2 May 2019 14:07:55 -0400 Received: from mail-io1-f46.google.com ([209.85.166.46]:41262 "EHLO mail-io1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbfEBSHz (ORCPT ); Thu, 2 May 2019 14:07:55 -0400 Received: by mail-io1-f46.google.com with SMTP id r10so2993912ioc.8 for ; Thu, 02 May 2019 11:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GYG9gid407fSTqcR1sS3MZsK+2t2f3wkYcvKU9idh/0=; b=A+QWwBszn7IF2LsKKt3bA3qQRVC/8fct9y1/eeeTerQbYsFvHI5zMXlu0aXk0vVrOn naL1Cr/tW58pQnINfGsDF0f4zD6E+P9VbbGdX8UWDESHru5uUOisJRcRKRD6lm5isO0W Pr5sUw6blHQXdjdhrkIHtdlPx1Jn+jxWk3VK77O9RL8eMM0dZlB7cqt9QqRV5rp4pfPR Hji3D//QPGXHr1OE9zBRF8CRHbw3l+50PAGEC01dnKXD2BIsOMb/eLhiaOizBOuW8AX6 FUoYZXIFvT9DDpNoK4pm9QYPumEx0ejBOAlENzXSBV4o7Uruy2SZoW1w3oN+GxjGtNKk YqLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GYG9gid407fSTqcR1sS3MZsK+2t2f3wkYcvKU9idh/0=; b=OlxZbZe4FTQfgDorTHHfw8f6GOE6yzHuaP+TQGpmcVRuJyufCmKOgI2iHMYXR0/cSQ 4oAxwX6amTtjxGh7YUsFOwrBR+0U/bvUXNpcNiWwYBvciAZDO4LN+NUjTctjzrM9cVQl Q2sBcLtui04grlasgQUr02gFB+4+S8tljFNOi/1FCHxSQAsNLPyr0zxNBzwPex7ajrH4 wbfoLO25hQjkqatVoc0rcS+OjhYqM58oewJR7gXFcKj5hurHTLkEVfAn1V8HUGfqRmAh CeCqyIotpLvPy0CKt/ankz838Zx7HOVQlVX9rZvPJQgvKTB7iRZXoQNApeT7OoSGnv7I nkhw== X-Gm-Message-State: APjAAAW4c1cmehFgZeSzkU7FbJrBbHdO9AnKClYlu3D3Lr7s05zy0cSU 2qGeqBEQSv4bMVjCKWKtUVjL3uzdNMmkzZJJ2gw4sg== X-Received: by 2002:a6b:e20e:: with SMTP id z14mr3597345ioc.169.1556820473380; Thu, 02 May 2019 11:07:53 -0700 (PDT) MIME-Version: 1.0 References: <20190227202658.197113-1-matthewgarrett@google.com> <20190227202658.197113-3-matthewgarrett@google.com> In-Reply-To: From: Matthew Garrett Date: Thu, 2 May 2019 11:07:42 -0700 Message-ID: Subject: Re: [PATCH V5 2/4] tpm: Reserve the TPM final events table To: Bartosz Szczepanek Cc: linux-integrity , Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe , Roberto Sassu , linux-efi , LSM List , Linux Kernel Mailing List , =?UTF-8?Q?Thi=C3=A9baud_Weksteen?= Content-Type: multipart/mixed; boundary="0000000000004c18a80587eb8349" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000004c18a80587eb8349 Content-Type: text/plain; charset="UTF-8" Sorry, how about this one? I was confused by why I wasn't hitting this, but on closer examination it turns out that my system populates the final event log with 0 events which means we never hit this codepath :( --0000000000004c18a80587eb8349 Content-Type: text/x-patch; charset="US-ASCII"; name="fix_log.diff" Content-Disposition: attachment; filename="fix_log.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jv6yoxc70 ZGlmZiAtLWdpdCBhL2RyaXZlcnMvZmlybXdhcmUvZWZpL3RwbS5jIGIvZHJpdmVycy9maXJtd2Fy ZS9lZmkvdHBtLmMKaW5kZXggMmNjYWE2NjYxYWFmLi5kYjBmZGFhOWM2NjYgMTAwNjQ0Ci0tLSBh L2RyaXZlcnMvZmlybXdhcmUvZWZpL3RwbS5jCisrKyBiL2RyaXZlcnMvZmlybXdhcmUvZWZpL3Rw bS5jCkBAIC0yOCw2ICsyOCw3IEBAIHN0YXRpYyBpbnQgdHBtMl9jYWxjX2V2ZW50X2xvZ19zaXpl KHZvaWQgKmRhdGEsIGludCBjb3VudCwgdm9pZCAqc2l6ZV9pbmZvKQogCQlpZiAoZXZlbnRfc2l6 ZSA9PSAwKQogCQkJcmV0dXJuIC0xOwogCQlzaXplICs9IGV2ZW50X3NpemU7CisJCWNvdW50LS07 CiAJfQogCiAJcmV0dXJuIHNpemU7CkBAIC00MSw2ICs0Miw3IEBAIGludCBfX2luaXQgZWZpX3Rw bV9ldmVudGxvZ19pbml0KHZvaWQpCiAJc3RydWN0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