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>] [day] [month] [year] [list]
Date:   Mon, 19 Dec 2022 11:52:03 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Thomas Weißschuh <linux@...ssschuh.net>
Cc:     Josh Poimboeuf <jpoimboe@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/7] objtool: reduce memory usage of struct reloc

On Sun, Dec 18, 2022 at 09:30:07PM +0000, Thomas Weißschuh wrote:
> Use a smaller type for the relocation type and move it to a location in
> the structure where it avoids wasted padding bytes.
> 
> Technically ELF could use up to four bytes for the type.
> But until now only types up to number 43 have been defined.
> 
> Reduce the size of struct reloc on x86_64 from 120 to 112 bytes.
> This structure is allocated a lot and never freed.

Please put in a assertion for this -- I can see this going sideways fast
if we ever get this wrong.

static inline void reloc_set_type(struct reloc *reloc, int type)
{
	if (type > (1U << (8*sizeof(reloc->type))))
		WARN_ELF("reloc->type out of range");

	reloc->type = type;
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ