Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2024985imm; Thu, 19 Jul 2018 11:48:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeNGxbp+Wclad08Njp4GSyWIHN4Wnd2TYPKhzNbxZTsK7xYOgZly/cKWxUn5X7BE6RnZ9Rg X-Received: by 2002:a17:902:900b:: with SMTP id a11-v6mr11213651plp.143.1532026085721; Thu, 19 Jul 2018 11:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532026085; cv=none; d=google.com; s=arc-20160816; b=pfN5J3lbPhIK5PpYn68Kd56tfd80lwt39pZVooLE6Ly2OT4wbiI2b93q++jeiaVaGZ GV1pJ1WECys5oPYqJcQtrVlpnPuB6Js6ty0s5taxib/d56pUkC5d9VVNk4FqhRdA9at8 8kWqpx52bkVwvN6ASnbdDjVmNZSmDKarRDpKYeFL5d7DVuX2zEmL2wYt9ZCT6GnUXTa2 VCQAnm2k3PT8zRbYO3fv7Pm99mvnrDXa4vpaSCNbhwuWkApXU/2LI1DmIvYLV0dE7pKt uzGc75EbVUJjzQXPMWY5px3OHKdMNqjwMcq2R9uwXGLwJZKY0vjrsQwBSuIaf+G5eP+6 GKzQ== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=DJP0/B/FBCX8L7CPkhHqcwsp9PsWqUoC4ymS93Nx/ew=; b=EB1BXwkAqHyxGmF5gu45PDjxv0vD1FwftPpA3csT/Oh+jaPh/YJWgrB9TKy5lKF7+M 9MVXLhJjHjlRrNwK9tIbJ7TIncZFaPaAsYC0Kj4AuQ99W7zUseTUWMqBQQ9+wfXATNPq MFJ87i56IYkDNG5A5G/8JI8X88rDftiyPKTgBjLuKMk0GHL3OB6agT/ezXEbCxBw6Vj0 kUdKU7sKtDiCoeVTZ9MsPDV09w8Y5Na4A/4+0SHMf+XcI17XqFZ9ppEfSToCAHKOCAry GNArBa+fE6AxWTyUUZGiY/Q7U1E85rWioOd9DjqyQHUrNg0zdV5hgsCNGgnQ/0b/Rv8g Nezw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=cX0QbR7c; 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=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7-v6si5559094pln.145.2018.07.19.11.47.50; Thu, 19 Jul 2018 11:48:05 -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=fail header.i=@hansenpartnership.com header.s=20151216 header.b=cX0QbR7c; 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=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732179AbeGSTbh (ORCPT + 99 others); Thu, 19 Jul 2018 15:31:37 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:42798 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731442AbeGSTbh (ORCPT ); Thu, 19 Jul 2018 15:31:37 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id AE1A68EE1DD; Thu, 19 Jul 2018 11:47:11 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gcNQeCmFeqAB; Thu, 19 Jul 2018 11:47:11 -0700 (PDT) Received: from [153.66.254.194] (unknown [50.35.68.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 0E33B8EE150; Thu, 19 Jul 2018 11:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1532026031; bh=hU8lb7dXSZlurLsahXzblGnnDC7EZS7wB9ff67AqXJk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=cX0QbR7cWDnuNSbenYy3VrtTgypkwaivKolKb2MuT5purM6GMS81+GZutOGKeOo13 b2e9MWbwhzjQwi0VIfk9bA9QB9x53/iSGQpf53sw33VEkLbM8rsZTH9A2fjOb2oyJP 4ZMmRJhX/J+ijZUXGXKVW0KQ2KWXTZNAvY6KK6vk= Message-ID: <1532026030.3198.2.camel@HansenPartnership.com> Subject: Re: [PATCH] tpm: add support for partial reads From: James Bottomley To: Tadeusz Struk , jarkko.sakkinen@linux.intel.com Cc: jgg@ziepe.ca, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 19 Jul 2018 11:47:10 -0700 In-Reply-To: <421c4b75-9e9d-7045-adad-797fd112898a@intel.com> References: <153201555276.20155.1352499992826895966.stgit@tstruk-mobl1.jf.intel.com> <1532020750.5396.4.camel@HansenPartnership.com> <421c4b75-9e9d-7045-adad-797fd112898a@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-07-19 at 10:54 -0700, Tadeusz Struk wrote: > On 07/19/2018 10:19 AM, James Bottomley wrote: > > That's just an implementation, though, what's the use case? > > Hi James, > The use case is described in the TCTI spec [1] in the > "3.2.5.2 receive" section. Well, yes, but I think we've all agreed that the /dev/tpm and /dev/tpmrmX aren't TCTI interfaces, although you can layer TCTI on top of them, so why not simply do fragmentation on top if you need it? The reason for not doing it in the interface is that it alters the ABI. Before this patch we had a hard packet boundary: one packet per read, one per write and a -EFAULT if you fail to provide a correctly sized buffer. Now if you provide a buffer too small but don't know about the fragmentation you're going to misprocess a packet (because you think you got a whole reply but you didn't) and then you get a -EBUSY on your next command which you don't know how to handle. The only way out is to update the applications to handle the new behaviour, which is a no- no in Linux ABI terms. It might be possible to layer the behaviour you want compatibly into the current device structure (say an ioctl to switch to the fragment behaviour) but I've got to ask why we'd go to the complexity without a use case? James