2018-04-20 18:51 GMT+02:00 Herbert Xu :
> On Mon, Apr 09, 2018 at 03:54:45PM +0200, Salvatore Mesoraca wrote:
>> v2:
>> As suggested by Herbert Xu, the blocksize and alignmask checks
>> have been moved to crypto_check_alg.
>> So, now, all the ot
2018-04-09 16:35 GMT+02:00 David Laight :
> From: Salvatore Mesoraca
>> Sent: 09 April 2018 14:55
>>
>> v2:
>> As suggested by Herbert Xu, the blocksize and alignmask checks
>> have been moved to crypto_check_alg.
>> So, now, all the
Please ignore this thread, I sent the old patch-set again by mistake :(
I'm sorry for the noise.
Salvatore
://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com
Signed-off-by: Salvatore Mesoraca
---
crypto/internal.h | 8
1 file changed, 8 insertions(+)
diff --git a/crypto/internal.h b/crypto/internal.h
index 9a3f399..89ae41e 100644
--- a/crypto/internal.h
+++ b/crypto
aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com
Signed-off-by: Salvatore Mesoraca
---
crypto/cfb.c | 14 ++
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/crypto/cfb.c b/crypto/cfb.c
index 94ee39b..f500816 100644
--- a/crypto/cfb.c
+++ b/crypto/cfb.c
@@
ff-by: Salvatore Mesoraca
---
crypto/pcbc.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/crypto/pcbc.c b/crypto/pcbc.c
index d9e45a9..797da2f 100644
--- a/crypto/pcbc.c
+++ b/crypto/pcbc.c
@@ -21,6 +21,7 @@
#include
#include
#include
+#include "
d-off-by: Salvatore Mesoraca
---
crypto/cts.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/crypto/cts.c b/crypto/cts.c
index 4773c18..12e6bd3 100644
--- a/crypto/cts.c
+++ b/crypto/cts.c
@@ -50,6 +50,7 @@
#include
#include
#include
+#include "internal.h&
cu1rq...@mail.gmail.com
Signed-off-by: Salvatore Mesoraca
---
crypto/cipher.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/crypto/cipher.c b/crypto/cipher.c
index 94fa355..9cedf23 100644
--- a/crypto/cipher.c
+++ b/crypto/cipher.c
@@ -67,7 +67,7 @@ static void cipher_crypt_unaligned
crypto_check_alg when a new
cipher is registered.
[1]
http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com
Signed-off-by: Salvatore Mesoraca
---
crypto/algapi.c | 10 ++
include/crypto/algapi.h | 8
2 files changed, 18 insertions(+)
diff
-dd95-2d4286913...@redhat.com
Salvatore Mesoraca (2):
crypto: api - laying defines and checks for statically allocated
buffers
crypto: remove several VLAs
crypto/algapi.c | 10 ++
crypto/cfb.c| 7 +++
crypto/cipher.c | 3 ++-
crypto/ctr.c
We avoid various VLAs[1] by using constant expressions for block size
and alignment mask.
[1]
http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com
Signed-off-by: Salvatore Mesoraca
---
crypto/cfb.c| 7 +++
crypto/cipher.c | 3 ++-
crypto/ctr.c
cu1rq...@mail.gmail.com
Signed-off-by: Salvatore Mesoraca
---
crypto/ctr.c | 13 +++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/crypto/ctr.c b/crypto/ctr.c
index 854d924..ce62552 100644
--- a/crypto/ctr.c
+++ b/crypto/ctr.c
@@ -20,6 +20,7 @@
#include
#include
#include
+#in
aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com
[2] http://lkml.kernel.org/r/4e536889-439a-49e6-dd95-2d4286913...@redhat.com
Salvatore Mesoraca (6):
crypto: api - laying macros for statically allocated buffers
crypto: ctr - avoid VLA use
crypto: api - avoid VLA use
crypto: pcbc - avoid VLA use
c
2018-04-08 11:22 GMT+02:00 Herbert Xu :
> On Sun, Apr 08, 2018 at 11:07:12AM +0200, Salvatore Mesoraca wrote:
>>
>> > This check should be done when the algorithm is registered. Perhaps
>> > crypto_check_alg.
>>
>> Please correct me if I'm wrong:
&
2018-04-08 5:16 GMT+02:00 Herbert Xu :
> On Sat, Apr 07, 2018 at 08:38:20PM +0200, Salvatore Mesoraca wrote:
>>
>> int crypto_init_cipher_ops(struct crypto_tfm *tfm)
>> {
>> + const unsigned long alignmask = crypto_tfm_alg_alignmask(tfm);
>&
018-04-08 5:19 GMT+02:00 Herbert Xu :
> On Sat, Apr 07, 2018 at 08:38:19PM +0200, Salvatore Mesoraca wrote:
>>
>> @@ -206,6 +207,14 @@ static struct crypto_instance *crypto_ctr_alloc(struct
>> rtattr **tb)
>> if (alg->cra_blocksize < 4)
2018-04-08 5:15 GMT+02:00 Herbert Xu :
> On Sat, Apr 07, 2018 at 08:38:18PM +0200, Salvatore Mesoraca wrote:
>> Creating 2 new compile-time constants for internal use,
>> in preparation for the removal of VLAs[1] from crypto code.
>> All ciphers implemented in Linux have a bl
2018-04-07 21:56 GMT+02:00 Kees Cook :
> On Sat, Apr 7, 2018 at 11:38 AM, Salvatore Mesoraca
> wrote:
>> As suggested by Laura Abbott[2], I'm resending my patch with
>> MAX_BLOCKSIZE and MAX_ALIGNMASK defined in an header, so they
>> can be used in other places.
&
://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com
Signed-off-by: Salvatore Mesoraca
---
crypto/internal.h | 8
1 file changed, 8 insertions(+)
diff --git a/crypto/internal.h b/crypto/internal.h
index 9a3f399..89ae41e 100644
--- a/crypto/internal.h
+++ b/crypto
ff-by: Salvatore Mesoraca
---
crypto/pcbc.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/crypto/pcbc.c b/crypto/pcbc.c
index d9e45a9..797da2f 100644
--- a/crypto/pcbc.c
+++ b/crypto/pcbc.c
@@ -21,6 +21,7 @@
#include
#include
#include
+#include "
cu1rq...@mail.gmail.com
Signed-off-by: Salvatore Mesoraca
---
crypto/cipher.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/crypto/cipher.c b/crypto/cipher.c
index 94fa355..9cedf23 100644
--- a/crypto/cipher.c
+++ b/crypto/cipher.c
@@ -67,7 +67,7 @@ static void cipher_crypt_unaligned
d-off-by: Salvatore Mesoraca
---
crypto/cts.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/crypto/cts.c b/crypto/cts.c
index 4773c18..12e6bd3 100644
--- a/crypto/cts.c
+++ b/crypto/cts.c
@@ -50,6 +50,7 @@
#include
#include
#include
+#include "internal.h&
aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com
Signed-off-by: Salvatore Mesoraca
---
crypto/cfb.c | 14 ++
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/crypto/cfb.c b/crypto/cfb.c
index 94ee39b..f500816 100644
--- a/crypto/cfb.c
+++ b/crypto/cfb.c
@@
cu1rq...@mail.gmail.com
Signed-off-by: Salvatore Mesoraca
---
crypto/ctr.c | 13 +++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/crypto/ctr.c b/crypto/ctr.c
index 854d924..ce62552 100644
--- a/crypto/ctr.c
+++ b/crypto/ctr.c
@@ -20,6 +20,7 @@
#include
#include
#include
+#in
aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com
[2] http://lkml.kernel.org/r/4e536889-439a-49e6-dd95-2d4286913...@redhat.com
Salvatore Mesoraca (6):
crypto: api - laying macros for statically allocated buffers
crypto: ctr - avoid VLA use
crypto: api - avoid VLA use
crypto: pcbc - avoid VLA use
c
2018-04-03 23:37 GMT+02:00 Laura Abbott :
> On 03/30/2018 01:53 AM, Salvatore Mesoraca wrote:
>> ---
>> crypto/ctr.c | 15 +--
>> 1 file changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/crypto/ctr.c b/crypto/ctr.c
>> index 854d92
also check the selected cipher at instance creation time, if
it doesn't comply with these limits, we fail the creation.
[1] https://lkml.org/lkml/2018/3/7/621
Signed-off-by: Salvatore Mesoraca
---
crypto/ctr.c | 15 +--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --
2018-03-23 16:36 GMT+01:00 Herbert Xu :
> On Thu, Mar 15, 2018 at 12:18:58PM +0100, Salvatore Mesoraca wrote:
>>
>> +#define MAX_BLOCKSIZE 16
>> +
>> +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
>> +#define MAX_ALIGNMASK 15
>> +#else
>> +#define
also check the selected cipher at instance creation time, if
it doesn't comply with these limits, we fail the creation.
[1] https://lkml.org/lkml/2018/3/7/621
Signed-off-by: Salvatore Mesoraca
---
crypto/ctr.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff
2018-03-15 10:54 GMT+01:00 Herbert Xu :
> On Wed, Mar 14, 2018 at 02:17:30PM +0100, Salvatore Mesoraca wrote:
>> All ciphers implemented in Linux have a block size less than or
>> equal to 16 bytes and the most demanding hw require 16 bits
>> alignment for the block buffer.
2018-03-14 19:31 GMT+01:00 Eric Biggers :
> On Wed, Mar 14, 2018 at 02:17:30PM +0100, Salvatore Mesoraca wrote:
>> All ciphers implemented in Linux have a block size less than or
>> equal to 16 bytes and the most demanding hw require 16 bits
>> alignment for the block buffer.
2018-03-14 14:31 GMT+01:00 Stephan Mueller :
> Am Mittwoch, 14. März 2018, 14:17:30 CET schrieb Salvatore Mesoraca:
>
> Hi Salvatore,
>
>> if (walk.nbytes) {
>> - crypto_ctr_crypt_final(&walk, child);
>> - err =
check, at runtime, that our assumptions still stand,
possibly dynamically allocating a new buffer, just in case
something changes in the future.
[1] https://lkml.org/lkml/2018/3/7/621
Signed-off-by: Salvatore Mesoraca
---
Notes:
Can we maybe skip the runtime check?
crypto/ctr.c | 50
33 matches
Mail list logo