Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2018-01-03 Thread Arnd Bergmann
On Wed, Jan 3, 2018 at 6:36 PM, Ard Biesheuvel wrote: > On 3 January 2018 at 16:37, Arnd Bergmann wrote: >> On Fri, Dec 22, 2017 at 4:47 PM, Ard Biesheuvel >> wrote: >> >> A minimal patch would be to disable UBSAN specifically for aes-generic.c >> for gcc-7.2+ but not gcc-8 to avoid the potenti

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2018-01-03 Thread Ard Biesheuvel
On 3 January 2018 at 16:37, Arnd Bergmann wrote: > On Fri, Dec 22, 2017 at 4:47 PM, Ard Biesheuvel > wrote: >> On 21 December 2017 at 13:47, PrasannaKumar Muralidharan >> wrote: >>> On 21 December 2017 at 17:52, Ard Biesheuvel >>> wrote: On 21 December 2017 at 10:20, Arnd Bergmann wrote

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2018-01-03 Thread Arnd Bergmann
On Fri, Dec 22, 2017 at 4:47 PM, Ard Biesheuvel wrote: > On 21 December 2017 at 13:47, PrasannaKumar Muralidharan > wrote: >> On 21 December 2017 at 17:52, Ard Biesheuvel >> wrote: >>> On 21 December 2017 at 10:20, Arnd Bergmann wrote: >>> >>> So my vote is to disable UBSAN for all such ciphe

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-22 Thread Ard Biesheuvel
On 21 December 2017 at 13:47, PrasannaKumar Muralidharan wrote: > Hi Ard, > > On 21 December 2017 at 17:52, Ard Biesheuvel > wrote: >> On 21 December 2017 at 10:20, Arnd Bergmann wrote: >>> On Wed, Dec 20, 2017 at 10:46 PM, Jakub Jelinek wrote: On Wed, Dec 20, 2017 at 09:52:05PM +0100, Ar

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-21 Thread PrasannaKumar Muralidharan
Hi Ard, On 21 December 2017 at 17:52, Ard Biesheuvel wrote: > On 21 December 2017 at 10:20, Arnd Bergmann wrote: >> On Wed, Dec 20, 2017 at 10:46 PM, Jakub Jelinek wrote: >>> On Wed, Dec 20, 2017 at 09:52:05PM +0100, Arnd Bergmann wrote: diff --git a/crypto/aes_generic.c b/crypto/aes_gener

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-21 Thread Ard Biesheuvel
On 21 December 2017 at 10:20, Arnd Bergmann wrote: > On Wed, Dec 20, 2017 at 10:46 PM, Jakub Jelinek wrote: >> On Wed, Dec 20, 2017 at 09:52:05PM +0100, Arnd Bergmann wrote: >>> diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c >>> index ca554d57d01e..35f973ba9878 100644 >>> --- a/crypto/a

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-21 Thread Arnd Bergmann
On Wed, Dec 20, 2017 at 10:46 PM, Jakub Jelinek wrote: > On Wed, Dec 20, 2017 at 09:52:05PM +0100, Arnd Bergmann wrote: >> diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c >> index ca554d57d01e..35f973ba9878 100644 >> --- a/crypto/aes_generic.c >> +++ b/crypto/aes_generic.c >> @@ -1331,6 +

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-20 Thread Jakub Jelinek
On Wed, Dec 20, 2017 at 09:52:05PM +0100, Arnd Bergmann wrote: > diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c > index ca554d57d01e..35f973ba9878 100644 > --- a/crypto/aes_generic.c > +++ b/crypto/aes_generic.c > @@ -1331,6 +1331,20 @@ EXPORT_SYMBOL_GPL(crypto_aes_set_key); > f_rl(

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-20 Thread Arnd Bergmann
On Wed, Dec 20, 2017 at 10:14 PM, Ard Biesheuvel wrote: > On 20 December 2017 at 20:52, Arnd Bergmann wrote: > > You can use the tcrypt.ko module to benchmark AES. > > modprobe tcrypt mode=200 sec=1 Ok, that's what I was looking for. I don't think I'll have time to analyze this before my Christm

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-20 Thread Ard Biesheuvel
On 20 December 2017 at 20:52, Arnd Bergmann wrote: > While testing other changes, I discovered that gcc-7.2.1 produces badly > optimized code for aes_encrypt/aes_decrypt. This is especially true when > CONFIG_UBSAN_SANITIZE_ALL is enabled, where it leads to extremely > large stack usage that in tu

[PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-20 Thread Arnd Bergmann
While testing other changes, I discovered that gcc-7.2.1 produces badly optimized code for aes_encrypt/aes_decrypt. This is especially true when CONFIG_UBSAN_SANITIZE_ALL is enabled, where it leads to extremely large stack usage that in turn might cause kernel stack overflows: crypto/aes_generic.c