From: Jarkko Sakkinen <jarkko@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: keyrings@vger.kernel.org,
Jarkko Sakkinen <jarkko.sakkinen@opinsys.com>,
Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
Mimi Zohar <zohar@linux.ibm.com>,
David Howells <dhowells@redhat.com>,
Paul Moore <paul@paul-moore.com>,
James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
"open list:TPM DEVICE DRIVER" <linux-integrity@vger.kernel.org>,
"open list:SECURITY SUBSYSTEM"
<linux-security-module@vger.kernel.org>
Subject: Re: [PATCH v3] tpm: Repeal and replace tpm_buf_init*() and tpm_buf_destroy()
Date: Tue, 1 Jul 2025 03:26:50 +0300 [thread overview]
Message-ID: <aGMrSqY9mojJrPja@kernel.org> (raw)
In-Reply-To: <20250701001153.769030-1-jarkko@kernel.org>
On Tue, Jul 01, 2025 at 03:11:51AM +0300, Jarkko Sakkinen wrote:
> From: Jarkko Sakkinen <jarkko.sakkinen@opinsys.com>
>
> Repeal and replace tpm_buf_init() and tpm_buf_init_sized() with
> tpm_buf_alloc(), which returns PAGE_SIZE of memory with the struct tpm_buf
> header in the beginning of the returned buffer. This leaves 4088 bytes of
> free space for data.
A minor error: it is now 4090 bytes:
struct tpm_buf {
u16 flags;
u16 length;
u16 handles;
u8 data[];
};
I guess this should be changed into:
struct tpm_buf {
u8 flags;
u8 handles;
u16 length;
u8 data[];
}
It's not strictly necessary given that we are already "above the
hardware spec" but it neither makes much sense to keep `handles`
or `flags` 16-bit words with MSB always empty in both of the
words.
BR, Jarkko
prev parent reply other threads:[~2025-07-01 0:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 0:11 [PATCH v3] tpm: Repeal and replace tpm_buf_init*() and tpm_buf_destroy() Jarkko Sakkinen
2025-07-01 0:26 ` Jarkko Sakkinen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aGMrSqY9mojJrPja@kernel.org \
--to=jarkko@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=dhowells@redhat.com \
--cc=jarkko.sakkinen@opinsys.com \
--cc=jgg@ziepe.ca \
--cc=jmorris@namei.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=peterhuewe@gmx.de \
--cc=serge@hallyn.com \
--cc=zohar@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).