lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aGMrSqY9mojJrPja@kernel.org>
Date: Tue, 1 Jul 2025 03:26:50 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: keyrings@...r.kernel.org, Jarkko Sakkinen <jarkko.sakkinen@...nsys.com>,
	Peter Huewe <peterhuewe@....de>, Jason Gunthorpe <jgg@...pe.ca>,
	James Bottomley <James.Bottomley@...senpartnership.com>,
	Mimi Zohar <zohar@...ux.ibm.com>,
	David Howells <dhowells@...hat.com>,
	Paul Moore <paul@...l-moore.com>, James Morris <jmorris@...ei.org>,
	"Serge E. Hallyn" <serge@...lyn.com>,
	"open list:TPM DEVICE DRIVER" <linux-integrity@...r.kernel.org>,
	"open list:SECURITY SUBSYSTEM" <linux-security-module@...r.kernel.org>
Subject: Re: [PATCH v3] tpm: Repeal and replace tpm_buf_init*() and
 tpm_buf_destroy()

On Tue, Jul 01, 2025 at 03:11:51AM +0300, Jarkko Sakkinen wrote:
> From: Jarkko Sakkinen <jarkko.sakkinen@...nsys.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ