Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1775675rdf; Sun, 5 Nov 2023 13:58:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IExgBg6vE4FBV7+T1Jd/F0OQ2FoPn4A6xjikLaigtYleO2ef/uBd2qCY1IffegUHantBsFt X-Received: by 2002:a05:6808:148b:b0:3a7:5611:a53b with SMTP id e11-20020a056808148b00b003a75611a53bmr35929628oiw.0.1699221495245; Sun, 05 Nov 2023 13:58:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699221495; cv=none; d=google.com; s=arc-20160816; b=IY9sN6m6ns9TB9gQeu3XAUqZzZQJlmfPXqSFoxg08hyBl+dMRKLV3OO84pQcdd3w3j t9Y8oN54DP2d8JcvZmkggj6VUkYDzpSAK1iAxZlpF24KrVwsZk005uzqXwzCGYtsBX4F RmPo9DxsiDYVp+SCAdj0lKW3SQD0C8FnkjTG7b8t79nfQ1B4OLMg7m0ODaRoN42sLBzx wk0bX0sWYkxofcRn0wx72Tw+n9mWLG5HM+qdjXJzftZoafULSZMKx6moppTJahVGuTA/ YuSKfsIsfK+FrIh+F0J852CpcHdr9LmMbU4pfmbYKGfc6o3mApeezGXs71VwuYp9Hake basw== 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=n34n91FMUrksdk+c27jo66gRnU2yKoyb5esJtMxTQLE=; fh=K1QrwHmXB6Je6/j8A8jF2YQtRaWAVwdQavGwiOHxzSs=; b=XGR/U6dEc3wZbiFYUKxUcmK3HQ19pbp6Q1UWsaWuLWlvVx3qTe0j88jPi1LxxWon17 wrMcA2Cui9+EXPSe986oL1/9cX9J8NcBGKJ4iwIRi9P56c5w4GYgrpLEVOI5wmAVT1gK 3mInLVNvuVHE0LvfAQuA2c+luw470uud+FKq60bRKHUpUmVEt16jUf+VZjTm//p6FpdJ vHPA/Y5G63SreZE+tdpGdbl2fdSxXaMPWYlQjoKoOheypkq8gGJgOW5CRB56AXke0J3+ J1RO8NrERpMQ9bvepbUWZEyCEQNFi8JV4x88WRee523Xw6YrYmPynAPO7ToXQe2aQ0c9 djdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HEkEgeT4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id a4-20020a656404000000b005aba9cdf091si6670146pgv.579.2023.11.05.13.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 13:58:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HEkEgeT4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 3257F809CCA5; Sun, 5 Nov 2023 13:58:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbjKEV6C (ORCPT + 99 others); Sun, 5 Nov 2023 16:58:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjKEV6B (ORCPT ); Sun, 5 Nov 2023 16:58:01 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E46BEBF; Sun, 5 Nov 2023 13:57:58 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5716C433C7; Sun, 5 Nov 2023 21:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699221478; bh=n34n91FMUrksdk+c27jo66gRnU2yKoyb5esJtMxTQLE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=HEkEgeT4essBePRujfHGNBM9f/URbJywdVYzzlnohAwNCij4XsiB0gQG9m1MlqdX7 nJ77QX28EA41SDj9hvnw510+WC/ikrpXJYyMiRv1w4SDn76eVCF84JGo3/6VHRd022 T4GEOmB/vIdvpoiWre08WIbzGa1oIoPdw5k9aJaQg0DIduAfpDYbGFXvDF+ueRmc6r /c4OiPIqIu/JbnIHwTbP0LAvBQ21alqsCdBH/e/H29j4hd4LxUc9xOzd0Ya9pJG3og 6pz27VimAftyuw6e+6msxAw8y6uRSjyKYHJxjFRkf6vjE7cV+D9vTevSLP4+TObyko Jt9mpfnQEc8Pg== Message-ID: <0fc4ef0992e0bc4b824b5f395c00a2a4e143b10f.camel@kernel.org> Subject: Re: [PATCH v3 1/6] tpm: Move buffer handling from static inlines to real functions From: Jarkko Sakkinen To: Jerry Snitselaar Cc: linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, James Bottomley , William Roberts , Stefan Berger , David Howells , Jason Gunthorpe , Mimi Zohar , Peter Huewe , Mario Limonciello , Julien Gomes , open list Date: Sun, 05 Nov 2023 23:57:28 +0200 In-Reply-To: References: <20231024011531.442587-1-jarkko@kernel.org> <20231024011531.442587-2-jarkko@kernel.org> Autocrypt: addr=jarkko@kernel.org; prefer-encrypt=mutual; keydata=mQINBF0RXVoBEACq7dxNqGliHRIUjKeA0Ajj8R0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7kqbBS/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 fry.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 (fry.vger.email [0.0.0.0]); Sun, 05 Nov 2023 13:58:12 -0800 (PST) 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: &tpm_buf instance > > =C2=A0* @pos: position within the buffer > > =C2=A0* @count: the number of bytes to read > > =C2=A0* @output: the output buffer > > =C2=A0* > > =C2=A0* Read bytes from a TPM buffer, and update the position. Returns = false when the > > =C2=A0* amount of bytes requested would overflow the buffer, which is e= xpected 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=A0off_t next =3D *pos + count; > >=20 > > =C2=A0if (next >=3D buf->length) { > > =C2=A0pr_warn("%s: %lu >=3D %lu\n", __func__, next, *offset); > > =C2=A0return false; > > =C2=A0} > >=20 > > =C2=A0memcpy(output, &buf->data[*pos], count); > > =C2=A0*offset =3D next; > > =C2=A0return true; > > } > >=20 > > BR, Jarkko > >=20 >=20 > Then the callers will check, and return -EIO? Most likely. My thinking with boolean was that this way it sort of documents that this function can have only single possible error state. If it was int there could be possibly some other error codes to handle... Just would prefer this based on my experience calling other in-kernel functions. I often need to use lxr a lot just to get full understanding of all possible POSIX codes... BR, Jarkko