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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4c6954a2-5142-41bf-bda2-9de76c380d09@notapiano>
Date: Tue, 6 Feb 2024 15:53:41 -0500
From: Nícolas F. R. A. Prado <nfraprado@...labora.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Brian Norris <briannorris@...omium.org>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Tzung-Bi Shih <tzungbi@...nel.org>, kernel@...labora.com,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	chrome-platform@...ts.linux.dev,
	Abhijit Gangurde <abhijit.gangurde@....com>,
	Masahiro Yamada <masahiroy@...nel.org>,
	Nathan Chancellor <nathan@...nel.org>,
	Nicolas Schier <nicolas@...sle.eu>,
	Nipun Gupta <nipun.gupta@....com>,
	Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@....com>,
	Umang Jain <umang.jain@...asonboard.com>,
	linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/7] firmware: coreboot: Generate aliases for coreboot
 modules

On Thu, Feb 01, 2024 at 06:21:03PM -0800, Greg Kroah-Hartman wrote:
> On Thu, Feb 01, 2024 at 05:45:19PM -0500, Nícolas F. R. A. Prado wrote:
> > On Tue, Jan 30, 2024 at 04:23:02PM -0800, Greg Kroah-Hartman wrote:
> > > On Tue, Jan 30, 2024 at 04:01:57PM -0800, Brian Norris wrote:
> > > > On Tue, Jan 30, 2024 at 3:51 PM Greg Kroah-Hartman
> > > > <gregkh@...uxfoundation.org> wrote:
> > > > > On Tue, Jan 23, 2024 at 02:06:14PM -0800, Brian Norris wrote:
> > > > > > "Don't you want to have a driver data or so associated with this?"
> > > > ...
> > > > > But why limit yourself to 32bits now?  Why not make it 64?  It is going
> > > > > to be sent to userspace, so you have to be very careful about it.
> > > > 
> > > > Is that question related to the question I pasted/replied to, about
> > > > driver data? Or a new topic? Sorry if I'm misunderstanding.
> > > 
> > > Same question, driver data, you make it 32 bits.
> > > 
> > > > Anyway, for the size of the tag field: I don't have a strong opinion.
> > > > But FWIW, they're coming from this project:
> > > > 
> > > > https://review.coreboot.org/plugins/gitiles/coreboot/+/269b23280f928510bcadd23182294e5b9dad11ec/payloads/libpayload/include/coreboot_tables.h#36
> > > > 
> > > > As you can see there, we're extremely far from exhausting 16 bits, let alone 32.
> > > 
> > > We've run into running out of bits in other subsystems before, it's
> > > "free" now, just be safe and make it 64 like I think Andy is suggesting.
> > 
> > Either you and Andy are suggesting different things, or I still don't quite get
> > what you mean.
> > 
> > Andy was suggesting we added a driver_data field, that is:
> > 
> > struct coreboot_device_id {
> > 	__u32 tag;
> > 	kernel_ulong_t driver_data;
> > };
> > 
> > You're suggesting we make the tag 64 bits long:
> > 
> > struct coreboot_device_id {
> > 	__u64 tag;
> > };
> 
> Yeah, I'm confused, sorry.
> 
> Yes, add some driver_data, and if you are SURE your tag will NEVER be
> larger than 32 bits, stick with that, but really, you are using the
> space in empty padding anyway, so just make it 64bits please.

Ok, after giving it a closer look, I've decided we really should just stick with
32 bits.

More fundamental than the previous argument that we aren't close to exhausting
32 bits for the tag in coreboot, is the fact that tags are literally defined as
32 bits long for the table entries [1]. Meaning, a tag being 32 bits long is
part of the coreboot ABI. We have to parse it as 32bits from memory.
Representing it as 64 bits internally and exposing it as 64 bits to userspace
would not only be unecessarily complicating things, but also misrepresenting the
data that we're getting from the firmware.

I can add driver_data for v4 no problem, as we can simply not use it while we
don't need it, but having tags be 64 bits actively complicates things for no
real gain, so it's a no-go.

Thanks,
Nícolas

[1] https://review.coreboot.org/plugins/gitiles/coreboot/+/refs/heads/main/src/commonlib/include/commonlib/coreboot_tables.h#128

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ