[PATCH] ppp: mppe: Remove VLA usage

2018-07-15 Thread Kees Cook
+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- drivers/net/ppp/ppp_mppe.c | 57 +- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp/ppp_mppe.c index

[PATCH v6 05/18] crypto alg: Introduce generic max blocksize and alignmask

2018-07-24 Thread Kees Cook
cra_blocksize is 144 (SHA3_224_BLOCK_SIZE, 18 8-byte words). For the new blocksize limit, I went with 160 (20 8-byte words). [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- crypto/algapi.c | 7 ++- include

[PATCH v6 12/18] drbd: Convert from ahash to shash

2018-07-24 Thread Kees Cook
and reduces stack usage. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- drivers/block/drbd/drbd_int.h | 13 +++ drivers/block

[PATCH v6 13/18] wireless/lib80211: Convert from ahash to shash

2018-07-24 Thread Kees Cook
and reduces stack usage. The stack allocation will be made a fixed size in a later patch to the crypto subsystem. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- net/wireless/lib80211_crypt_tkip.c | 58

[PATCH v6 10/18] x86/power/64: Remove VLA usage

2018-07-24 Thread Kees Cook
/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook Acked-by: Pavel Machek --- arch/x86/power/hibernate_64.c | 36 --- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/arch/x86/power/hibernate_64.c b/arch

[PATCH v6 09/18] ppp: mppe: Remove VLA usage

2018-07-24 Thread Kees Cook
+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook Acked-by: Arnd Bergmann --- drivers/net/ppp/ppp_mppe.c | 56 -- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp

[PATCH v6 07/18] crypto: shash: Remove VLA usage in unaligned hashing

2018-07-24 Thread Kees Cook
this helper was the only user. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- crypto/shash.c | 27 --- include/linux/compiler-gcc.h | 1 - 2 files changed, 16 insertions(+), 12

[PATCH v6 06/18] crypto: qat: Remove VLA usage

2018-07-24 Thread Kees Cook
In the quest to remove all stack VLA usage from the kernel[1], this uses the new upper bound for the stack buffer. Also adds a sanity check. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook --- drivers/crypto/qat

[PATCH v6 03/18] crypto: hash: Remove VLA usage

2018-07-24 Thread Kees Cook
...@mail.gmail.com Signed-off-by: Kees Cook --- crypto/ahash.c| 4 ++-- crypto/algif_hash.c | 2 +- crypto/shash.c| 6 +++--- include/crypto/hash.h | 6 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/crypto/ahash.c b/crypto/ahash.c index a64c143165b1..78aaf2158c43

[PATCH v6 02/18] crypto: cbc: Remove VLA usage

2018-07-24 Thread Kees Cook
-by: Kees Cook --- include/crypto/cbc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/crypto/cbc.h b/include/crypto/cbc.h index f5b8bfc22e6d..47db0aac2ab9 100644 --- a/include/crypto/cbc.h +++ b/include/crypto/cbc.h @@ -113,7 +113,9 @@ static inline int

Re: [PATCH v6 18/18] crypto: Remove AHASH_REQUEST_ON_STACK

2018-07-24 Thread Kees Cook
On Tue, Jul 24, 2018 at 10:31 AM, Joe Perches wrote: > On Tue, 2018-07-24 at 09:49 -0700, Kees Cook wrote: >> All users of AHASH_REQUEST_ON_STACK have been removed from the kernel, so >> drop it entirely so no VLAs get reintroduced by future users. > > checkpatch has a test

Re: [PATCH] ppp: mppe: Remove VLA usage

2018-08-02 Thread Kees Cook
On Mon, Jul 16, 2018 at 4:01 AM, Arnd Bergmann wrote: > On Mon, Jul 16, 2018 at 6:05 AM, Kees Cook wrote: >> In the quest to remove all stack VLA usage from the kernel[1], this >> removes the discouraged use of AHASH_REQUEST_ON_STACK (and associated >> VLA) by switch

[PATCH net-next] ppp: mppe: Remove VLA usage

2018-08-03 Thread Kees Cook
+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook Acked-by: Arnd Bergmann --- Paul suggested this go via netdev directly: https://lkml.kernel.org/r/20180803031315.GA30807@fergus --- drivers/net/ppp/ppp_mppe.c | 56 -- 1 file