Re: [dm-devel] [PATCH v3 9/9] crypto: shash: Remove VLA usage in unaligned hashing

2018-07-02 Thread Kees Cook
On Sun, Jul 1, 2018 at 10:20 AM, Eric Biggers wrote: > On Sun, Jul 01, 2018 at 10:04:59AM -0700, Kees Cook wrote: >> On Sat, Jun 30, 2018 at 12:03 AM, Eric Biggers wrote: >> > On Thu, Jun 28, 2018 at 05:28:43PM -0700, Kees Cook wrote: >> >> @@ -88,11 +81,13 @@ static int shash_update_unaligned(st

Re: [dm-devel] [PATCH v3 9/9] crypto: shash: Remove VLA usage in unaligned hashing

2018-07-01 Thread Eric Biggers
On Sun, Jul 01, 2018 at 10:04:59AM -0700, Kees Cook wrote: > On Sat, Jun 30, 2018 at 12:03 AM, Eric Biggers wrote: > > On Thu, Jun 28, 2018 at 05:28:43PM -0700, Kees Cook wrote: > >> @@ -88,11 +81,13 @@ static int shash_update_unaligned(struct shash_desc > >> *desc, const u8 *data, > >> uns

Re: [dm-devel] [PATCH v3 9/9] crypto: shash: Remove VLA usage in unaligned hashing

2018-07-01 Thread Kees Cook
On Sat, Jun 30, 2018 at 12:03 AM, Eric Biggers wrote: > On Thu, Jun 28, 2018 at 05:28:43PM -0700, Kees Cook wrote: >> @@ -88,11 +81,13 @@ static int shash_update_unaligned(struct shash_desc >> *desc, const u8 *data, >> unsigned long alignmask = crypto_shash_alignmask(tfm); >> unsigned

Re: [dm-devel] [PATCH v3 9/9] crypto: shash: Remove VLA usage in unaligned hashing

2018-06-30 Thread Eric Biggers
On Thu, Jun 28, 2018 at 05:28:43PM -0700, Kees Cook wrote: > In the quest to remove all stack VLA usage from the kernel[1], this uses > the newly defined max alignment to perform unaligned hashing to avoid > VLAs, and drops the helper function while adding sanity checks on the > resulting buffer si

[PATCH v3 9/9] crypto: shash: Remove VLA usage in unaligned hashing

2018-06-28 Thread Kees Cook
In the quest to remove all stack VLA usage from the kernel[1], this uses the newly defined max alignment to perform unaligned hashing to avoid VLAs, and drops the helper function while adding sanity checks on the resulting buffer sizes. Additionally, the __aligned_largest macro is removed since thi