Re: [PATCH v4 1/2] powerpc/32: add stack protector support

2018-09-28 Thread Segher Boessenkool
On Fri, Sep 28, 2018 at 10:56:07PM +1000, Michael Ellerman wrote: > The problem of low entropy at boot on systems without a good hardware > source is sort of unsolvable. > > As you say it's up to the core kernel/random code, we shouldn't be > trying to do anything tricky in the arch code. > > You

Re: [PATCH v4 1/2] powerpc/32: add stack protector support

2018-09-28 Thread Michael Ellerman
Christophe LEROY writes: > Le 27/09/2018 à 09:45, Segher Boessenkool a écrit : >> On Thu, Sep 27, 2018 at 08:20:00AM +0200, Christophe LEROY wrote: ... >> >>> However this is the canary for initial startup only. Only idle() still >>> uses this canary once the system is running. A new canary is se

Re: [PATCH v4 1/2] powerpc/32: add stack protector support

2018-09-27 Thread Christophe LEROY
Le 27/09/2018 à 09:45, Segher Boessenkool a écrit : On Thu, Sep 27, 2018 at 08:20:00AM +0200, Christophe LEROY wrote: Le 26/09/2018 à 21:16, Segher Boessenkool a écrit : On Wed, Sep 26, 2018 at 11:40:38AM +, Christophe Leroy wrote: +static __always_inline void boot_init_stack_canary(voi

Re: [PATCH v4 1/2] powerpc/32: add stack protector support

2018-09-27 Thread Segher Boessenkool
On Thu, Sep 27, 2018 at 08:20:00AM +0200, Christophe LEROY wrote: > Le 26/09/2018 à 21:16, Segher Boessenkool a écrit : > >On Wed, Sep 26, 2018 at 11:40:38AM +, Christophe Leroy wrote: > >>+static __always_inline void boot_init_stack_canary(void) > >>+{ > >>+ unsigned long canary; > >>+ > >>+

Re: [PATCH v4 1/2] powerpc/32: add stack protector support

2018-09-26 Thread Christophe LEROY
Le 26/09/2018 à 21:16, Segher Boessenkool a écrit : On Wed, Sep 26, 2018 at 11:40:38AM +, Christophe Leroy wrote: +static __always_inline void boot_init_stack_canary(void) +{ + unsigned long canary; + + /* Try to get a semi random initial value. */ + get_random_bytes(&ca

Re: [PATCH v4 1/2] powerpc/32: add stack protector support

2018-09-26 Thread Segher Boessenkool
On Wed, Sep 26, 2018 at 11:40:38AM +, Christophe Leroy wrote: > +static __always_inline void boot_init_stack_canary(void) > +{ > + unsigned long canary; > + > + /* Try to get a semi random initial value. */ > + get_random_bytes(&canary, sizeof(canary)); > + canary ^= mftb(); > +