From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751109AbdALHsL (ORCPT ); Thu, 12 Jan 2017 02:48:11 -0500 Received: from helcar.hengli.com.au ([209.40.204.226]:45059 "EHLO helcar.apana.org.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750782AbdALHsK (ORCPT ); Thu, 12 Jan 2017 02:48:10 -0500 Date: Thu, 12 Jan 2017 15:47:52 +0800 From: Herbert Xu To: Andy Lutomirski Cc: daniel@iogearbox.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Jason@zx2c4.com, hannes@stressinduktion.org, alexei.starovoitov@gmail.com, edumazet@google.com, ebiggers3@gmail.com, tom@herbertland.com, davem@davemloft.net, luto@kernel.org, ard.biesheuvel@linaro.org Subject: Re: [PATCH v2 8/8] crypto/testmgr: Allocate only the required output size for hash tests Message-ID: <20170112074752.GA14230@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <890f4bdb28a1cf72f6b802b220b35ebaf0f76bb9.1484090585.git.luto@kernel.org> X-Newsgroups: apana.lists.os.linux.cryptoapi,apana.lists.os.linux.kernel,apana.lists.os.linux.netdev Organization: Core User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Lutomirski wrote: > There are some hashes (e.g. sha224) that have some internal trickery > to make sure that only the correct number of output bytes are > generated. If something goes wrong, they could potentially overrun > the output buffer. > > Make the test more robust by allocating only enough space for the > correct output size so that memory debugging will catch the error if > the output is overrun. > > Tested by intentionally breaking sha224 to output all 256 > internally-generated bits while running on KASAN. > > Cc: Ard Biesheuvel > Cc: Herbert Xu > Signed-off-by: Andy Lutomirski This patch doesn't seem to depend on anything else in the series. Do you want me to take it separately? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt