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] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 6 Feb 2022 18:53:56 -0500 (EST)
From:   Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        paulmck <paulmck@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
        "H. Peter Anvin" <hpa@...or.com>, Paul Turner <pjt@...gle.com>,
        linux-api <linux-api@...r.kernel.org>,
        Christian Brauner <christian.brauner@...ntu.com>,
        Florian Weimer <fw@...eb.enyo.de>,
        David Laight <David.Laight@...lab.com>,
        carlos <carlos@...hat.com>, Peter Oskolkov <posk@...k.io>,
        libc-coord@...ts.openwall.com
Subject: Re: [RFC PATCH 1/3] rseq: Introduce feature size and alignment ELF
 auxiliary vector entries

----- On Feb 6, 2022, at 4:49 PM, Peter Zijlstra peterz@...radead.org wrote:

> On Thu, Feb 03, 2022 at 02:38:51PM -0500, Mathieu Desnoyers wrote:
> 
>> @@ -286,6 +287,10 @@ create_elf_tables(struct linux_binprm *bprm, const struct
>> elfhdr *exec,
>>  	if (bprm->have_execfd) {
>>  		NEW_AUX_ENT(AT_EXECFD, bprm->execfd);
>>  	}
>> +#ifdef CONFIG_RSEQ
>> +	NEW_AUX_ENT(AT_RSEQ_FEATURE_SIZE, offsetof(struct rseq, end));
> 
> I've gotta ask, what's up with offsetof(, end) vs sizeof() ?

sizeof() includes the 12 bytes of padding at the end of struct rseq, for a
total of 32 bytes (currently). offsetof(, end) is currently 20 bytes, which
is the offset exactly after the last field.

For the "feature size" (meaning the populated fields), we really want a size
that excludes padding.

Thanks,

Mathieu

> 
>> +	NEW_AUX_ENT(AT_RSEQ_ALIGN, __alignof__(struct rseq));
> > +#endif

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ