Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp961923imd; Thu, 1 Nov 2018 08:12:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5cwhDqyZi3CuuAKoKRXSmueztdPT8Q54AiQdBe+hYUMZU1bh1JpEijXG4JTSINqh0WqmLHd X-Received: by 2002:a65:5103:: with SMTP id f3-v6mr7532612pgq.54.1541085168104; Thu, 01 Nov 2018 08:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541085168; cv=none; d=google.com; s=arc-20160816; b=trYmzdVEfpdM+hi7LgCo+ch+8mO2lyDbDTpgp3o31V05141lDqpQOwsRw33stWKald CWC2BToWs7d5l+8XzBWMPnCMRRSJZCv0/6cm1icLA1XQ3Ow1WRVCUBlZxjs1SxmrAbnr b7cuMiIxxFf1Q2VpynASeiQjEmFBv94BZQQdWct0oTF6py7rFby+hGqBeE+zm/HCvKba of23V2gSG/cEBhvCMlURshtNMbO/wTilsOwuUL1lQQKQuEn7xbKqz9NPRhmIFueLSyRD +X8BS5XnUiIIzatt74xA3C6XXj9p8MFpj1rdsRM4h/hP+2VSeTf84mQWry9td+6HaVm8 S5Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=Fa+jpQuhCM2671ZEGuWoCa4pqEHXk+qtJdoM5aHZo+E=; b=t3sY1l0abZXmpE2hIrPv1dea4rKtXa5jFljRANR3BvF8gKx5iuodPKfAZTsbJnPeZo m2hZGGYMjF7VeibRr4WdBo4KxMTn9PwNcCX/0D3AxAFwhvO3DPVq+E3YZmVgnWJ1pJHW HKg7/4J6NZmSAoyjQUi3E2I2/7IXP2h/R9iRK8BRbRLHVRhNWOD51f64hb3FrD6Z2Cje 1RVIVORQhi53mIRnEf5ughg0PVrsXIjNNoYgLGi/4iR9W/6DqjEdagenDd7zkSko2qwk ITtze54FpTy2eIHxTvamkl8wG3SnWmbPBjOV8wIDrrsmYdycJG1rWvGg//S1rQ+qp5tJ VwDA== 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 h80-v6si33547670pfj.120.2018.11.01.08.12.30; Thu, 01 Nov 2018 08:12:48 -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 S1728780AbeKAXgF (ORCPT + 99 others); Thu, 1 Nov 2018 19:36:05 -0400 Received: from mga01.intel.com ([192.55.52.88]:44835 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728436AbeKAXgF (ORCPT ); Thu, 1 Nov 2018 19:36:05 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2018 07:32:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,452,1534834800"; d="scan'208";a="105118268" Received: from jsakkine-mobl1.tm.intel.com ([10.237.50.155]) by orsmga002.jf.intel.com with ESMTP; 01 Nov 2018 07:32:50 -0700 Date: Thu, 1 Nov 2018 16:32:48 +0200 (EET) From: Jarkko Sakkinen X-X-Sender: jsakkine@jsakkine-mobl1 To: Roberto Sassu cc: Jarkko Sakkinen , zohar@linux.ibm.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com Subject: Re: [PATCH v3 5/5] tpm: ensure that output of PCR read contains the correct digest size In-Reply-To: <7adca046-ae80-7453-9fee-a802b46ceb86@huawei.com> Message-ID: References: <20181030154711.2782-1-roberto.sassu@huawei.com> <20181030154711.2782-6-roberto.sassu@huawei.com> <7adca046-ae80-7453-9fee-a802b46ceb86@huawei.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 31 Oct 2018, Roberto Sassu wrote: > On 10/30/2018 8:52 PM, Jarkko Sakkinen wrote: >> On Tue, 30 Oct 2018, Roberto Sassu wrote: >>> This patch ensures that the digest size returned by the TPM during a PCR >>> read matches the size of the algorithm passed as argument to >>> tpm2_pcr_read(). The check is performed after information about the PCR >>> banks has been retrieved. >>> >>> Signed-off-by: Roberto Sassu >> >> What is the scenarion when this can happen (should be explained in >> the commit message)? > > Without an HMAC session, the request/response payload can be modified. > This patch ensures that the digest size in the payload is equal to the > size of the algorithm specified by the caller. i.e. it protect against memory corruption that could happen in the bus? Please state this. > For me it is ok to remove this patch from the set. It was requested by > Mimi. For me it is not ok remove this patch :-) I just want that note to the commit message in order to have it documented. /Jarkko