Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1777108rdf; Sun, 5 Nov 2023 14:01:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/2I8oR7js4SD99mwZisVhWLdIE4fhxusv+KhZ1AxNGHSJR5ihoaP/zEj6kd+zWh1NlryQ X-Received: by 2002:a05:6820:1c4b:b0:571:aceb:26c8 with SMTP id cm11-20020a0568201c4b00b00571aceb26c8mr25344816oob.3.1699221711712; Sun, 05 Nov 2023 14:01:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699221711; cv=none; d=google.com; s=arc-20160816; b=vG80leTTjJBs3WGb+4Ph5XI/oVIwrOqJABax06QTvfmFaEUMpIHAOVQemASudu1oXk cJ35WjL7xV7xUlGQd7hTusHFUTGyKJ0yrJywmIgkD6HoCP/0jSRo68rQHiW2VPo39L2R +MhgrXSn3/VsY47hfwfb0XDBhM4rxSFbNRnpJUMZFlCU+IqVsgirOp8K+hPVZHPAm0ux 4GT1PAIkc72UmPIt8TfvHbiXeVnxH80Bc4cWKaPFW7BedJrX1IG0Qm3DWvcEO5dTap+U AXtg10Y5QM+fgO7wSixFJNqJTQmO9llFhGztQQCqqouZkZwh91ynJoUnRU0aSkshUIKi tLWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:autocrypt:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=a/Uth71jCEzTayYhCFi3bUwtVY5RF27O7dzCpUThzuE=; fh=mmSUuZvwngttj+LkM9CvR+Hp4tnKSoNwmKYRFrxBzbg=; b=VYI+ePeG7wqgzB8cx4/iIoXhN42s3ZhUFCxtiVjQ57mA2h68SIh52GkB71q4sor16n pJOgNkNIVnyDnUY3YYwoLkBoOa4OmyFxqzRLWdz+to0Y8AbW5gJOIZ2rQibqs+a8/8m2 WTtwo1E4MDqkP23y28o5nws+f+cnuZBliNyB3K3T0niZzVZOfnXRiEDTnMRtd23s9skE YFe5v0g4aRFwZYH/z+KBNWcMamVcZcp4tA6wOM3lulAcnRXAYmmkgYfPlNEYOUkEeR+F 3OgNISYPIQHpEcsQ/VRRg+xogQbd8DgBrhfGxTfo+kPX5AMURoepWXOazh7k7ImoLipC OcTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="J//Bfgdl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j7-20020a655587000000b005acd3068202si6431452pgs.552.2023.11.05.14.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 14:01:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="J//Bfgdl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 24FE58076162; Sun, 5 Nov 2023 14:01:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbjKEWBj (ORCPT + 99 others); Sun, 5 Nov 2023 17:01:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbjKEWBh (ORCPT ); Sun, 5 Nov 2023 17:01:37 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90256BF; Sun, 5 Nov 2023 14:01:35 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B355C433C7; Sun, 5 Nov 2023 22:01:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699221695; bh=a/Uth71jCEzTayYhCFi3bUwtVY5RF27O7dzCpUThzuE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=J//Bfgdlcc3z29PgLS69TZ0FG31UE2sWkjJqyClgZpFBjM8I1ic5c/1qpmbRcD9E1 9JKIUqN/vob85zr7f95uA9jcP3tSmLGOZe5cR1pQeqSgs0bEfxWFTSdo8W1NHAetwJ f+RkZI1J9PVqkg0BpPC/J5b1XgpixWvHm+IEEMhGOyeXE4US9QsmIks3/+fdFjfQJf 6cbcYKOScU63yzbB6CYNiMOY2FvO3aLoDqp8ydQSIhqat3YhGfnJ+QVmSUk4gyqKyr fAbLzo6Y9Ydiox60XHycBbnGQ1pIGnL1NS5SQeh3VaGT2mEyGNG+08psJCzK92MC+D 2BcfkajCuQo/w== Message-ID: Subject: Re: [PATCH v3 1/6] tpm: Move buffer handling from static inlines to real functions From: Jarkko Sakkinen To: James Bottomley , Jerry Snitselaar Cc: linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, William Roberts , Stefan Berger , David Howells , Jason Gunthorpe , Mimi Zohar , Peter Huewe , Mario Limonciello , Julien Gomes , open list Date: Mon, 06 Nov 2023 00:01:30 +0200 In-Reply-To: <3e69c10c5d03ab2ccf7bda82b7ed9991dbced523.camel@kernel.org> References: <20231024011531.442587-1-jarkko@kernel.org> <20231024011531.442587-2-jarkko@kernel.org> <3e69c10c5d03ab2ccf7bda82b7ed9991db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nlQSsGjBv9Ojfn2QNzGd3/cCrL7xS82PguDXopi6oZycp9LpfKKWL7BWmkQT8lgbSrm+QNY4DzMiNPhcqMb+8Yj+V7kqbBS/yWV/kbl5CrI5P/Iz4ZeqKrh07dKUJaj+RGaifW3cZFx/VCHqLxVfa3DwrHtFwQops4/lewpCqBtfx9UWGHRZIfn2Y9EEEmx94ymhO3nN3bVo0GZHCgfcvSDbFgNEefbakVoCAMq6/oiPZTRN0bxktVC7r36lybcbRdCX+MF6OXZb/jjJ71WzkhThEaA+NXx6uaxOvIhgOU0h1qLFkxPpESEYolyhRSs2urvTtbFG/PqHHGlxrl2vLaRee5YJDfvpar+unOY44lfYVdvqd3udMbXhb7FFfajz0iSsok4VwEkh/6BCZ+x8sMSueroMf1jMFs N1LK7Vr OhxtP1vYUoyv1iQpYsijVlqHhqbA7Va/jVwBJi40tjMFS0E91mK1iRtBzA== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.1-1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 05 Nov 2023 14:01:49 -0800 (PST) On Sun, 2023-11-05 at 23:59 +0200, Jarkko Sakkinen wrote: > On Thu, 2023-10-26 at 13:55 -0400, James Bottomley wrote: > > On Thu, 2023-10-26 at 10:10 -0700, Jerry Snitselaar wrote: > > > On Wed, Oct 25, 2023 at 08:35:55PM +0300, Jarkko Sakkinen wrote: > > > > On Wed Oct 25, 2023 at 12:03 PM EEST, Jerry Snitselaar wrote: > > > > > Reviewed-by: Jerry Snitselaar > > > >=20 > > > > On Wed, 2023-10-25 at 02:03 -0700, Jerry Snitselaar wrote: > > > > > Reviewed-by: Jerry Snitselaar > > > > >=20 > > > >=20 > > > > Thanks I'll add it to the next round. > > > >=20 > > > > For the tpm_buf_read(), I was thinking along the lines of: > > > >=20 > > > > /** > > > > =C2=A0* tpm_buf_read() - Read from a TPM buffer > > > > =C2=A0* @buf:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0&tpm_b= uf instance > > > > =C2=A0* @pos:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0positi= on within the buffer > > > > =C2=A0* @count:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0the number of by= tes to read > > > > =C2=A0* @output:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0the output buffer > > > > =C2=A0* > > > > =C2=A0* Read bytes from a TPM buffer, and update the position. Retu= rns > > > > false when the > > > > =C2=A0* amount of bytes requested would overflow the buffer, which = is > > > > expected to > > > > =C2=A0* only happen in the case of hardware failure. > > > > =C2=A0*/ > > > > static bool tpm_buf_read(const struct tpm_buf *buf, off_t *pos, > > > > size_t count, void *output) > > > > { > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0off_t next =3D *pos= + count; > > > >=20 > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (next >=3D buf->= length) { > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pr_warn("%s: %lu >=3D %lu\n", __func__, next, > > > > *offset); > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return false; > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > > > >=20 > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0memcpy(output, &buf= ->data[*pos], count); > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*offset =3D next; > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return true; > > > > } > > > >=20 > > > > BR, Jarkko > > > >=20 > > >=20 > > > Then the callers will check, and return -EIO? > >=20 > > Really, no, why would we do that? > >=20 > > The initial buffer is a page and no TPM currently can have a command > > that big, so if the buffer overflows, it's likely a programming error > > (failure to terminate loop or something) rather than a runtime one (a > > user actually induced a command that big and wanted it to be sent to > > the TPM).=C2=A0 The only reason you might need to check is the no-alloc= case > > and you passed in a much smaller buffer, but even there, I would guess > > it will come down to a coding fault not a possible runtime error. >=20 >=20 > Yeah, this was my thinking too. So in HMAC case you anyway would not > need to check it because crypto is destined to fail anyway. >=20 > Returning boolean here does no harm so I thought that this is overally > good compromise. Or actually maybe we should go just with void, as it does have even then "return value", as it emits to klog, right? BR, Jarkko