Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1822006ybn; Thu, 26 Sep 2019 02:45:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzC2gOFyAKj74m6lA+gpftydwD0LamGSFpxN8Jb6bWAdQ1cur+8XrwmwaoR7d7SUMoJSsQ X-Received: by 2002:a17:906:c47:: with SMTP id t7mr2190584ejf.133.1569491118804; Thu, 26 Sep 2019 02:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569491118; cv=none; d=google.com; s=arc-20160816; b=uSNHUAdawV/3iVEGwgDJt4gJG2hyoT0BBWfxs9bwUpEia+1gsQDrXlmuYjzJOsQsE9 BZeo/JyLLwzjIEUIMirfgLYPcVS7sv0U1no3xa2lSYt/BUJiyf3fgLvThoxGSBjpFm5I 0rV6QdPet5YUWOVOPVqTOpfxXTrgIolBwVtpqfwaoTMuw+29azGAmlkjVOkJUOhXTssI UE3crpTSNwG6vpxUMes7+a8AeiL2YKCkvdZzqOHlvfQ0wv/mkdnN7CPIr+xJ8IzUPGdB qv7mzWPfK/KOTBeJDhwGDr0qE7gcOr4YWmiY1INVvR8mHH5GrnPalODuePuPnMm0qNjp giEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:to:from:date; bh=zugf//ewV+Jw24YzObP86wfqOVJcB6V6OI1o/yrHlEY=; b=kcos5id3qSd4uJ/wE08NxAamiE9UFfKV3JhCfU13I29fEG5hv2jeW+RpfzO0p//qQW Gota5szxsrhA57w6KuV5M4+j5bOGAzZ30xg19yFOR7e2vBfx0oRTQfyzIahY4Jt++pxU v9Fdpp3pHPg/eC26jRim3o9YgLBwFY9wM2YacWIjr9Rh/AjhWKkDeVi4yaCOwzy+t4mN TeNXWEFCaqwgIsHEv5Y0hBFJzTe8hDw+Z3JSj0d4mjlnUh0I3iD2sjldh9N6Typ58NM8 gp/LGX2SIg30ZNQ4OeOlsIQ0I3fw5sEYYIRn0Sq+QoW+Bq5fd8LanhBUb9YOedFb3/o8 g/OQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x51si973800eda.272.2019.09.26.02.44.56; Thu, 26 Sep 2019 02:45:18 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391907AbfIYQlw (ORCPT + 99 others); Wed, 25 Sep 2019 12:41:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51187 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391884AbfIYQlw (ORCPT ); Wed, 25 Sep 2019 12:41:52 -0400 Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CE4023295 for ; Wed, 25 Sep 2019 16:41:51 +0000 (UTC) Received: by mail-io1-f72.google.com with SMTP id w8so336414iod.21 for ; Wed, 25 Sep 2019 09:41:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:reply-to :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=zugf//ewV+Jw24YzObP86wfqOVJcB6V6OI1o/yrHlEY=; b=U0DRJRZj0OI8/ti5nMGwCXC27i/WhQdYG70IQknuhltcb8WnAGGo0eVBG7jcP5tc9t vbYYm+JOWd8Uu1nlYGj1QxGmpN7+p0Rkh2g+Xpz74YYsWWST/vtTU09gn7ZdsETC9zdh jHpSZXHLsuzx4BZXBIHXxiTuKnkytctp+BiJxvsezpJvOtnW939rn97beUG+SuLCQrPV MzexOM3ooFnP1DF1deiGmo6dO3h7CAxyH3VYkPYbRDrHpWDAxeFUePyz5OoO+Pos8YZw 3nrgOnN4hdrW7RrT1qAT7Fyco5bdDCW4FrB8Hv2zs1G0vgo+MSIxmFmHuLQgD9+RnDYO OCpg== X-Gm-Message-State: APjAAAU/yqVc+Yty4hF3OteSvuc6wCbuuzCWsPegrLbFZGV85gHHiu/S /Iq+L2jSbiZy5k3fyUmEWfAm+qC5bogMVob2x1pZLpfhm/OJbti4Bb/g5lEGmXIf6dCE7RNeRSX 7HkjhgE36qTechMkRXiM7Ro6r X-Received: by 2002:a92:4648:: with SMTP id t69mr1134276ila.282.1569429710867; Wed, 25 Sep 2019 09:41:50 -0700 (PDT) X-Received: by 2002:a92:4648:: with SMTP id t69mr1134255ila.282.1569429710588; Wed, 25 Sep 2019 09:41:50 -0700 (PDT) Received: from localhost (ip70-163-223-149.ph.ph.cox.net. [70.163.223.149]) by smtp.gmail.com with ESMTPSA id c6sm52396iom.34.2019.09.25.09.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 09:41:49 -0700 (PDT) Date: Wed, 25 Sep 2019 09:41:33 -0700 From: Jerry Snitselaar To: Jarkko Sakkinen , Ard Biesheuvel , linux-integrity , Peter Jones , linux-efi , stable , Lyude Paul , Matthew Garrett , Roberto Sassu , Bartosz Szczepanek , open list Subject: Re: [PATCH v2 1/2] efi+tpm: Don't access event->count when it isn't mapped. Message-ID: <20190925164133.nmzzhwgagpqvwclu@cantor> Reply-To: Jerry Snitselaar Mail-Followup-To: Jarkko Sakkinen , Ard Biesheuvel , linux-integrity , Peter Jones , linux-efi , stable , Lyude Paul , Matthew Garrett , Roberto Sassu , Bartosz Szczepanek , open list References: <20190925101622.31457-1-jarkko.sakkinen@linux.intel.com> <20190925145011.GC23867@linux.intel.com> <20190925151616.3glkehdrmuwtosn3@cantor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190925151616.3glkehdrmuwtosn3@cantor> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed Sep 25 19, Jerry Snitselaar wrote: >On Wed Sep 25 19, Jarkko Sakkinen wrote: >>On Wed, Sep 25, 2019 at 12:25:05PM +0200, Ard Biesheuvel wrote: >>>On Wed, 25 Sep 2019 at 12:16, Jarkko Sakkinen >>> wrote: >>>> >>>> From: Peter Jones >>>> >>>> Some machines generate a lot of event log entries. When we're >>>> iterating over them, the code removes the old mapping and adds a >>>> new one, so once we cross the page boundary we're unmapping the page >>>> with the count on it. Hilarity ensues. >>>> >>>> This patch keeps the info from the header in local variables so we don't >>>> need to access that page again or keep track of if it's mapped. >>>> >>>> Fixes: 44038bc514a2 ("tpm: Abstract crypto agile event size calculations") >>>> Cc: linux-efi@vger.kernel.org >>>> Cc: linux-integrity@vger.kernel.org >>>> Cc: stable@vger.kernel.org >>>> Signed-off-by: Peter Jones >>>> Tested-by: Lyude Paul >>>> Reviewed-by: Jarkko Sakkinen >>>> Acked-by: Matthew Garrett >>>> Acked-by: Ard Biesheuvel >>>> Signed-off-by: Jarkko Sakkinen >>> >>>Thanks Jarkko. >>> >>>Shall I take these through the EFI tree? >> >>Would be great, if you could because I already sent one PR with fixes for >>v5.4-rc1 yesterday. >> >>/Jarkko > >My patch collides with this, so I will submit a v3 that applies on top of >these once I've run a test with all 3 applied on this t480s. Tested with Peter's patches, and that was the root cause on this 480s. I think there should still be a check for tbl_size to make sure we aren't sticking -1 into efi_tpm_final_log_size though, which will be the case right now if it fails to parse an event.