From: Kees Cook Subject: Re: [dm-devel] [PATCH v5 10/11] crypto: ahash: Remove VLA usage for AHASH_REQUEST_ON_STACK Date: Tue, 17 Jul 2018 13:11:52 -0700 Message-ID: References: <20180717042150.37761-1-keescook@chromium.org> <20180717042150.37761-11-keescook@chromium.org> <20180717164358.GC75957@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Herbert Xu , Giovanni Cabiddu , Arnd Bergmann , "Gustavo A. R. Silva" , Mike Snitzer , Eric Biggers , qat-linux@intel.com, LKML , dm-devel@redhat.com, linux-crypto , Lars Persson , Tim Chen , Alasdair Kergon , Rabin Vincent To: Eric Biggers Return-path: In-Reply-To: <20180717164358.GC75957@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org On Tue, Jul 17, 2018 at 9:43 AM, Eric Biggers wrote: > On Mon, Jul 16, 2018 at 09:21:49PM -0700, Kees Cook wrote: >> + reqsize = sizeof(struct shash_desc) + crypto_shash_descsize(shash); >> + if (WARN_ON(reqsize > AHASH_MAX_REQSIZE)) { >> + crypto_mod_put(calg); >> + return -EINVAL; >> + } > > 'crypto_free_shash(shash);' instead of 'crypto_mod_put(calg);' Oops! Yes, thanks; I have fixed it now in the next version. -Kees -- Kees Cook Pixel Security