Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp118644ima; Fri, 1 Feb 2019 00:14:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IaX3rgNVgh+4JwYHuJxSXgY2HyhGj0YdcLAAkak+hD+bAhy+u2z0AYMv5JTTWkOBCyptknW X-Received: by 2002:a63:da14:: with SMTP id c20mr1259607pgh.233.1549008845300; Fri, 01 Feb 2019 00:14:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549008845; cv=none; d=google.com; s=arc-20160816; b=CIzfFlzYArR8ux0uHsZeApMuYdXBZponYwsQxTHzB+ofZ0o3ulDe0LvBPP4ORzQ/kt UqPR4IRJyERfGsJsk77Q1J4FfnxX6o9J/FgRnUtIFDzimafKS/28TQ2CQ46xT3bHlaMh TAdPlHKOWGIPyyzP1+uSOVe6nx+/sjEDJmxh+waHP9ysAkE8RoHJ37eNvu1uktKyUz3G FyI6zLPrqv0tPmtHGfHp0jmvuv2h61jyN/OA9tZ5f1C/jWY7/Ip4Cobw9aEPoE9GbafV dAyVPGP6/AcMBDm8sD8aKZNcLxi+sstz/ycKQu9+uXw8Mswt///hdsgl00eXdJYQDL95 MRsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QYyv1ATO+cHwKltHNd5/N5imw3RWBbE3ObGHs6IVY6g=; b=0bLPnG2uCRrzwacv/BM62k+nME4nYlc6cbTW3WHmGkePL2oSig0jIDrCEflMqO12l9 /G0wwPihxnF+ui+IlBQRyj0ds7usEelSQtg4Na7HRDTiVrzxoyXrkMMwFZlYM5bdpTRd xtYQypelUN1l9PakPLx0OGtbNSbDPyemPKqejy5MdrDtE3JJKQBLDbFtkkirUgw3uT53 +KgDhflJvClJVuyPPov2yIM9swarcqz4WW+JX0zKtsx1KKrN2OB11/+7B9+XEL3plrvD O5iNml/cGQYh1l4g+i9HFuyrLl10P0X2poQcjYJReTKTQbfKfufFkCtd8xojGiL0Z2ov HI9w== 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 k72si6128459pge.310.2019.02.01.00.13.49; Fri, 01 Feb 2019 00:14:05 -0800 (PST) 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 S1727077AbfBAIMu (ORCPT + 99 others); Fri, 1 Feb 2019 03:12:50 -0500 Received: from mga01.intel.com ([192.55.52.88]:32439 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726110AbfBAIMt (ORCPT ); Fri, 1 Feb 2019 03:12:49 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2019 00:12:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,547,1539673200"; d="scan'208";a="296428940" Received: from jsakkine-mobl1.tm.intel.com (HELO localhost) ([10.237.50.172]) by orsmga005.jf.intel.com with ESMTP; 01 Feb 2019 00:12:46 -0800 Date: Fri, 1 Feb 2019 10:12:46 +0200 From: Jarkko Sakkinen To: "Winkler, Tomas" Cc: Linus Torvalds , Jason Gunthorpe , James Bottomley , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , Linux List Kernel Mailing Subject: Re: Getting weird TPM error after rebasing my tree to security/next-general Message-ID: <20190201081246.GA5728@linux.intel.com> References: <20190129132016.GA1602@linux.intel.com> <20190131122606.GA12470@linux.intel.com> <20190131160437.GA5629@linux.intel.com> <20190131170603.GA18349@linux.intel.com> <20190131183530.GA27112@linux.intel.com> <5B8DA87D05A7694D9FA63FD143655C1B9DA8DA75@hasmsx108.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B9DA8DA75@hasmsx108.ger.corp.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 31, 2019 at 07:47:19PM +0000, Winkler, Tomas wrote: > > > > > On Thu, Jan 31, 2019 at 10:52 AM Linus Torvalds > foundation.org> wrote: > > > > > > I think what I should do is to just make "memcpy_*io()" do the "align > > > naturally" thing. > > > > > > Let me cook up a patch for you to test. > > > > Does this work for you? > > > > I haven't tested it at all, but I verified that the generated code seems to make > > at least some amount of sense. > > > > Linus > > So dig into the spec and I think this is a bit relevant. > > TPM TCG according the spec requires that all buffer access is done > sequentially from the start to end of the payload, Simply In case of > skipping or going back the transaction is aborted. The write > transactions should be 1 or power of 2. So in general 6 byte read > should not work. But I'm sure our hw really obey this restriction. We could easily read the first 8 bytes instead of 6, and then check the length. The benefit in doing that would be to be able to backport the patch to stable kernels. I'm fine with either solution. Applying Linus' fix might anyway a good idea since given that tpm_crb broke down, there is a finite probability that there might be some other drivers that break down for similar reasons, but no one has noticed so far. Thus, I might even propose doing both... /Jarkko