Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6263779imm; Mon, 23 Jul 2018 14:39:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcOE/NWK3/z28mtg7L0qA8Eko6grecGaBYr/QbbjyRG3wyb5WCTtnNQzx5NcDT5iwxjmpkE X-Received: by 2002:a63:fa18:: with SMTP id y24-v6mr2389073pgh.362.1532381953656; Mon, 23 Jul 2018 14:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532381953; cv=none; d=google.com; s=arc-20160816; b=Bw5dyLCL/HBnj7VCXDnCSowvnpcg32toGQlyCGP6hnZRAZZ2qPCH7izF/SX8Js3voZ IMuuuTvznTppihnVRtAqJ75kD3lruTqo5h1aSRrOfToU3lCRuqv70Cx30O71Ay1IcG54 SlO9D3HKpc3iQbfFnNwRiBKCW1+rGyAYMRljUqHcEIO80zHEN1TAYXj4yZKy4Gs2/u+N BIxCkw+oxPADuwd003O2llvhktWaKM1rLuBO/9JjSIb8TCAGeCPf9jNUiu14BN7dBYrZ iWseiOUkI60lTMoo80QtKcn7L4X/zrMfOSQp6BNMaz3e04wKCYBY7ozUapFm0sKjHxgr 7x2w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :arc-authentication-results; bh=YfAV3YGRb2poy6jvWAlmkq4ARiYbvPzkdgTKYUJn2uM=; b=OWBi0UH6UNyrQYiKPqFBZDRqZa4r+1+LOJljQAdrw7HcMkeJSTILPtZ5Oo9+v8aI2X mkZJx3hQHQjrPTLD4FuYpT8q4ena5DE0cl2StSY5USTEDTU+sziAzp4WAhBODXRu4EZ8 a64OevYp35DAY/yWLc2SwVlenh3zkNUWowtw1WvzkOtQ7ggV/zHs69iGagRXol4IE8uj hrluCMn65pjd54DRX+6xSFKgDPXVM/XXdV2zhez0AjFJSzcOhaXR4IM+adBwVUhx6CPc IkgaJ4cikSmt56oybaWD8fiWuOBEP6DxLIPrm+Yhu3ZQi+FkUP9McXoY0h5HiF28RPvz w8Kg== 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 n59-v6si8696380plb.198.2018.07.23.14.38.58; Mon, 23 Jul 2018 14:39:13 -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 S2388177AbeGWWlR (ORCPT + 99 others); Mon, 23 Jul 2018 18:41:17 -0400 Received: from mga06.intel.com ([134.134.136.31]:27112 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388088AbeGWWlR (ORCPT ); Mon, 23 Jul 2018 18:41:17 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jul 2018 14:38:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,394,1526367600"; d="scan'208";a="242668947" Received: from tstruk-mobl1.jf.intel.com ([10.7.196.153]) by orsmga005.jf.intel.com with ESMTP; 23 Jul 2018 14:38:08 -0700 Subject: Re: [PATCH] tpm: add support for partial reads To: James Bottomley , Jarkko Sakkinen Cc: jgg@ziepe.ca, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org References: <153201555276.20155.1352499992826895966.stgit@tstruk-mobl1.jf.intel.com> <20180723201956.GB26824@linux.intel.com> <1532380412.4112.22.camel@HansenPartnership.com> From: Tadeusz Struk Openpgp: preference=signencrypt Autocrypt: addr=tadeusz.struk@intel.com; prefer-encrypt=mutual; keydata= xsDiBEiLICMRBADteQacQxypsuFvAw6IwYzbD8pgQi+kLYBcqfGgVAUN/cO+sLl6u1lVdaDB fhAArdbV9lpoqcWnmhQFTb4A+W569EpydBr6nuatWkEB+fmmx8YoUtuZfXt7v+1l1rc09kaW LY+TkwQkvFCeuvdasgmBLnmRWymEGWi1E12hUgTw/wCgtK24geC7XkiuANMv0gpr+raOgQMD /2yJZ0SeXQApWyTRaeIYN8GgYHZTWuBp/ofN+viEkhrDxahcaGPP5B/Nv6VS1+M0e5m8OzHj qPUbgfyOeJcslC5aoZdqqqzVWVLaA/+Jy+O+6T3k3R/IryVVATldBlwnGFDhET0mKQsd15zt cIdQBBbfSFR5VlugZuWV5q442IpPA/4g7nen9FFPxh45Te8D54hAsOCywjm6xUE0UJGYHeJ/ MXCPtuXfVCbYcOxZVH7kUS2Vtk5d3bF40IE2WnVq1ZScNANF4ZjikxYhYGfNWX3HXak1gSoj UrY87rMSjPIAry4L0BoIx2qgL/k4iV/3QcXL4t5wosU0iw++suf1zGGcKM0gVGFkZXVzeiBT dHJ1ayA8dHN0cnVrQGdtYWlsLmNvbT7CYwQTEQIAIwIbAwYLCQgHAwIEFQIIAwQWAgMBAh4B AheABQJQTjJTAhkBAAoJEDFswfskq9xyqvcAoI2nsaUCX8ZGbu+Jhq+++qlBFJ2rAJ983RoO R2ofHhn3g3Qi4K34tw0l087BTQRauzUlARAAqkWRL/InEPnoGMg/gw/CRaDBaIBgMsvIcghI 7xevIzpleXt6jKHghSBooH+zaT7qi4u2gkgPn4odsER3Rm94XgrZJgoqls6EpKMWpJNGP4HT eYgykhfsZOLX8ijUbjTM/Sm/dZVo6aYoBL2+ciJwyl+Zt3Mp6un3/GWu6cA9005V50pRqO7j PTlVCHi2bedcEEf5DDsYJv/3Oz8/4LpSf6BL6BltjeZVa2y03dTMmD031JTH+OuyJm1yh72Z HWxhlYNXOv6uFJJVr+paQjrAsBVIYKhK24bD+uGJxLm8AN9i7/Si+2YeSsXvKUhk9mIoFBnU VFo63cziRTcpRu/kXgDAbujwN88qytEcvhEZHS6B9vdws+lhTpolEjkLCkz0Y59z4Fs9srKy QkRN+wtdiLgrwyDW3ryAKxcDmOumGWebDxpaOI/pBhrlS93HmDlvj7JmgTUU4a/NhwI3dXh5 pn8FZzZyVXe3Kc3bu5T3UAC7uztinsAvCJQS6jGZWrXmXkqYkaLXQOw61eInWjr01zE/zDbE mdJPM0+va/gtZx9TtGxr4PpjbqswqCiubLDZXZHh5uqArPv/i+E8aXIsNSTN6Rrqs1j9YgDN ALksibv6+tXH3sOlCUgjuZgJH3+s/mnaAtiV2rZ/WlH15d6nd0uiDSZrKhlR+g4NHMh1ztEA EQEAAcJPBBgRAgAPBQJauzUlAhsMBQkJZgGAAAoJEDFswfskq9xyfv8AoI8aPrJCoM0h5WOP kKxMmPEPHzUNAJ9jBBYXhX1CWg+IhI7i/fLlI0vwCA== Message-ID: <7441b5ef-18d8-13aa-ef4d-40fe684c9218@intel.com> Date: Mon, 23 Jul 2018 14:38:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1532380412.4112.22.camel@HansenPartnership.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/23/2018 02:13 PM, James Bottomley wrote: > The current patch does, you even provided a use case in your last email > (it's do command to get sizing followed by do command with correctly > sized buffer). The example I provided was: #1 send a command, #2 read the response header (10 bytes), get the actual response size from the header and then #3 read the full response (response size - size of the header bytes). > > However, if you tie it to O_NONBLOCK, it won't because no-one currently > opens the TPM device non blocking so it's an ABI conformant > discriminator of the uses. Tying to O_NONBLOCK should be simple > because it's in file->f_flags. I think that it might be an option. Especially that I have this on top of the async patch. Let's discuss this when Jarkko is back. Thanks, -- Tadeusz