Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1776083rdf; Sun, 5 Nov 2023 13:59:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpnV6F13b+cJxd/zVWsoChJQyKS0oOJ/YQebk7dDPnJuJqp7NIKAZz4eNeO+eiCXaqRLe7 X-Received: by 2002:a05:690c:fcf:b0:5a7:b516:6eab with SMTP id dg15-20020a05690c0fcf00b005a7b5166eabmr11121694ywb.15.1699221590839; Sun, 05 Nov 2023 13:59:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699221590; cv=none; d=google.com; s=arc-20160816; b=u79bKk8WfuWSEu6RalJ8BG4uNnbZbi0u78MKKP95oF/3j9ba3qijquv06OqkryGGY3 kguzGKWDTIRSiJrDCi5Q4A/o+dTT9uV1AuymNccPRV5KeTq9ZknsGL52ScVlVf71ctI5 Y+y4mCrjHK3K9s+DjdE4Wc9Wp18F/xipfQAFTsaOGagN0ZjsVKGsQ64SZsy/yNRF6Rjf 4ZtXAqcK7PzwabMg/9zkjeLCyZ4OsvNtsXg8PJLT+VLRMUQqvhUQ2zLRDmITwKCNEMpp j8s4HhlT1W2PWTbyS8OX94NNGkDl4sUPxqKG4Rv5EAElMtWlxj3nczWD3FF24APLfLxs +JDQ== 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=+fQntMiPTShEdZDkX4ZTyKiQpFcFE2MgFsGVK1Zt3BU=; fh=mmSUuZvwngttj+LkM9CvR+Hp4tnKSoNwmKYRFrxBzbg=; b=l9wLyZ67JpQ41Ozgu/74IqAznkpGLs/QY9KUQuew+tzavLHBpZ1pFmC7H7P9qLhvYc CLG5FKp3BLoN7LnwaGb7W+DFziDgjGq0l1oZVxnyWM52lE63tDMuXkPkiZMvXJjFqEZw IZwrAy+mHbdM2+vyKgQFw5edze9/NCbIUy8X4hEfF0549RD3KtWIxR8JcpqEirkNIG5t kmbSBs4WQn8WjmgFqyK0PL0flic7tXwvyKQiHZ3Hqmq564UdH0bjM5IB1k/6hnR1azR6 TBf54DpBe67mwo8ShYzX2NZ5XcInaVXxgWgIo0pzUDX7V1M5tbM8Be/D6Xr8WiLeOI+0 HbaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PhmAnmpB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l1-20020a056a00140100b0069342cee042si6836417pfu.51.2023.11.05.13.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 13:59:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PhmAnmpB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 3C2FF80AA266; Sun, 5 Nov 2023 13:59:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229811AbjKEV7k (ORCPT + 99 others); Sun, 5 Nov 2023 16:59:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbjKEV7j (ORCPT ); Sun, 5 Nov 2023 16:59:39 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24287BF; Sun, 5 Nov 2023 13:59:36 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E290C433C8; Sun, 5 Nov 2023 21:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699221575; bh=+fQntMiPTShEdZDkX4ZTyKiQpFcFE2MgFsGVK1Zt3BU=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=PhmAnmpBd1TjDjAgEOv940jUoT08+DToVP0RwHaBjYk8E6FRMHsrWRG8u5T398p+5 58PMi6j/zKxtXVk5ma199nnTC5nD+Rko9Y3EwlhywAYUnF0oTrn9vXOfZlAnER6Nn+ 1Rm7muMZU16Jx9F6h8fXTTm2q6jUY+72xO3YeIiG6dXtGcF5bkpcEurDob02EpkBZ5 XOHHSNM9/+LSr80W8KkkZyPJCCWUOKM/G9qrl7isK7Ij2M3EUUvNUy/U4a+Wk8xbQ/ r+IVYIe0Fhr7HtdeE0LE3YWxiPorHnqJDOGZFo02i7Ll5yu8azMVWWqO4E58f63IfS x3GOUCb3VTxEw== Message-ID: <3e69c10c5d03ab2ccf7bda82b7ed9991dbced523.camel@kernel.org> 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: Sun, 05 Nov 2023 23:59:31 +0200 In-Reply-To: References: <20231024011531.442587-1-jarkko@kernel.org> <20231024011531.442587-2-jark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sGjBv9Ojfn2QNzGd3/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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Sun, 05 Nov 2023 13:59:48 -0800 (PST) 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_buf= instance > > > =C2=A0* @pos:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0position= within the buffer > > > =C2=A0* @count:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0the number of byte= s 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. Return= s > > > 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->le= ngth) { > > > =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 c= ase > 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. 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. Returning boolean here does no harm so I thought that this is overally good compromise. BR, Jarkko