Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-30 Thread Michael Ellerman
Segher Boessenkool writes: > On Thu, Aug 29, 2024 at 07:36:38PM +0200, Christophe Leroy wrote: >> >> >> Le 28/08/2024 à 19:25, Segher Boessenkool a écrit : >> > >> >>Not sure about static binaries, though: do those even use the VDSO? >> > >> >With "static binary" people usually mean "a binary no

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-29 Thread Christophe Leroy
Le 29/08/2024 à 20:02, Segher Boessenkool a écrit : On Thu, Aug 29, 2024 at 07:36:38PM +0200, Christophe Leroy wrote: Le 28/08/2024 à 19:25, Segher Boessenkool a écrit : Not sure about static binaries, though: do those even use the VDSO? With "static binary" people usually mean "a bina

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-29 Thread Segher Boessenkool
On Thu, Aug 29, 2024 at 07:36:38PM +0200, Christophe Leroy wrote: > > > Le 28/08/2024 à 19:25, Segher Boessenkool a écrit : > > > >>Not sure about static binaries, though: do those even use the VDSO? > > > >With "static binary" people usually mean "a binary not using any DSOs", > >I think the VDS

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-29 Thread Christophe Leroy
Le 28/08/2024 à 19:25, Segher Boessenkool a écrit : Not sure about static binaries, though: do those even use the VDSO? With "static binary" people usually mean "a binary not using any DSOs", I think the VDSO is a DSO, also in this respect? As always, -static builds are *way* less problem

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Segher Boessenkool
On Wed, Aug 28, 2024 at 07:12:55PM +0200, Ard Biesheuvel wrote: > On Wed, 28 Aug 2024 at 18:24, Segher Boessenkool > wrote: > > > In my experience, this is likely to do the opposite: it causes the > > > compiler to 'forget' the semantics of memcpy() and memset(), so that > > > explicit trivial cal

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Ard Biesheuvel
On Wed, 28 Aug 2024 at 18:24, Segher Boessenkool wrote: > > Hi! > > On Wed, Aug 28, 2024 at 05:40:23PM +0200, Ard Biesheuvel wrote: > > On Wed, 28 Aug 2024 at 14:57, Segher Boessenkool > > wrote: > > > > > > On Wed, Aug 28, 2024 at 12:24:12PM +, Arnd Bergmann wrote: > > > > On Wed, Aug 28, 20

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Segher Boessenkool
Hi! On Wed, Aug 28, 2024 at 05:40:23PM +0200, Ard Biesheuvel wrote: > On Wed, 28 Aug 2024 at 14:57, Segher Boessenkool > wrote: > > > > On Wed, Aug 28, 2024 at 12:24:12PM +, Arnd Bergmann wrote: > > > On Wed, Aug 28, 2024, at 11:18, Jason A. Donenfeld wrote: > > > > On Tue, Aug 27, 2024 at 05

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Ard Biesheuvel
On Wed, 28 Aug 2024 at 14:57, Segher Boessenkool wrote: > > On Wed, Aug 28, 2024 at 12:24:12PM +, Arnd Bergmann wrote: > > On Wed, Aug 28, 2024, at 11:18, Jason A. Donenfeld wrote: > > > On Tue, Aug 27, 2024 at 05:53:30PM -0500, Segher Boessenkool wrote: > > >> On Tue, Aug 27, 2024 at 11:08:19

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Segher Boessenkool
On Wed, Aug 28, 2024 at 02:26:08PM +0200, Jason A. Donenfeld wrote: > On Wed, Aug 28, 2024 at 2:24 PM Arnd Bergmann wrote: > > > > On Wed, Aug 28, 2024, at 11:18, Jason A. Donenfeld wrote: > > > On Tue, Aug 27, 2024 at 05:53:30PM -0500, Segher Boessenkool wrote: > > >> On Tue, Aug 27, 2024 at 11:0

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Segher Boessenkool
On Wed, Aug 28, 2024 at 12:24:12PM +, Arnd Bergmann wrote: > On Wed, Aug 28, 2024, at 11:18, Jason A. Donenfeld wrote: > > On Tue, Aug 27, 2024 at 05:53:30PM -0500, Segher Boessenkool wrote: > >> On Tue, Aug 27, 2024 at 11:08:19AM -0700, Eric Biggers wrote: > >> > > >> > Is there a compiler fl

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Jason A. Donenfeld
On Wed, Aug 28, 2024 at 07:33:13AM -0500, Segher Boessenkool wrote: > On Wed, Aug 28, 2024 at 01:18:34PM +0200, Jason A. Donenfeld wrote: > > On Tue, Aug 27, 2024 at 05:53:30PM -0500, Segher Boessenkool wrote: > > > On Tue, Aug 27, 2024 at 11:08:19AM -0700, Eric Biggers wrote: > > > > > +

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Segher Boessenkool
On Wed, Aug 28, 2024 at 01:18:34PM +0200, Jason A. Donenfeld wrote: > On Tue, Aug 27, 2024 at 05:53:30PM -0500, Segher Boessenkool wrote: > > On Tue, Aug 27, 2024 at 11:08:19AM -0700, Eric Biggers wrote: > > > > + for (i = 0; i < ARRAY_SIZE(params->reserved); i++) > > > > +

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Jason A. Donenfeld
On Wed, Aug 28, 2024 at 2:24 PM Arnd Bergmann wrote: > > On Wed, Aug 28, 2024, at 11:18, Jason A. Donenfeld wrote: > > On Tue, Aug 27, 2024 at 05:53:30PM -0500, Segher Boessenkool wrote: > >> On Tue, Aug 27, 2024 at 11:08:19AM -0700, Eric Biggers wrote: > >> > > >> > Is there a compiler flag that

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Arnd Bergmann
On Wed, Aug 28, 2024, at 11:18, Jason A. Donenfeld wrote: > On Tue, Aug 27, 2024 at 05:53:30PM -0500, Segher Boessenkool wrote: >> On Tue, Aug 27, 2024 at 11:08:19AM -0700, Eric Biggers wrote: >> > >> > Is there a compiler flag that could be used to disable the generation of >> > calls >> > to me

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-28 Thread Jason A. Donenfeld
On Tue, Aug 27, 2024 at 05:53:30PM -0500, Segher Boessenkool wrote: > On Tue, Aug 27, 2024 at 11:08:19AM -0700, Eric Biggers wrote: > > On Thu, Aug 22, 2024 at 09:13:13AM +0200, Christophe Leroy wrote: > > > With the current implementation, __cvdso_getrandom_data() calls > > > memset(), which is un

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-27 Thread Segher Boessenkool
On Tue, Aug 27, 2024 at 11:08:19AM -0700, Eric Biggers wrote: > On Thu, Aug 22, 2024 at 09:13:13AM +0200, Christophe Leroy wrote: > > With the current implementation, __cvdso_getrandom_data() calls > > memset(), which is unexpected in the VDSO. > > > > Rewrite opaque data initialisation to avoid m

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-27 Thread Jason A. Donenfeld
On Tue, Aug 27, 2024 at 11:08:19AM -0700, Eric Biggers wrote: > On Thu, Aug 22, 2024 at 09:13:13AM +0200, Christophe Leroy wrote: > > With the current implementation, __cvdso_getrandom_data() calls > > memset(), which is unexpected in the VDSO. > > > > Rewrite opaque data initialisation to avoid m

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-27 Thread Eric Biggers
On Thu, Aug 22, 2024 at 09:13:13AM +0200, Christophe Leroy wrote: > With the current implementation, __cvdso_getrandom_data() calls > memset(), which is unexpected in the VDSO. > > Rewrite opaque data initialisation to avoid memset(). > > Signed-off-by: Christophe Leroy > --- > lib/vdso/getrand

Re: [PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-26 Thread Jason A. Donenfeld
On Thu, Aug 22, 2024 at 09:13:13AM +0200, Christophe Leroy wrote: > With the current implementation, __cvdso_getrandom_data() calls > memset(), which is unexpected in the VDSO. > > Rewrite opaque data initialisation to avoid memset(). I think of the various ways I've seen of fixing this -- e.g. a

[PATCH v2 05/17] vdso: Avoid call to memset() by getrandom

2024-08-22 Thread Christophe Leroy
With the current implementation, __cvdso_getrandom_data() calls memset(), which is unexpected in the VDSO. Rewrite opaque data initialisation to avoid memset(). Signed-off-by: Christophe Leroy --- lib/vdso/getrandom.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff