Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4896082imm; Tue, 26 Jun 2018 02:22:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeSTWREYt9DrmvJKI8HiDLaZQ79fS+D0iPblv16SaP6aPVV2L1SD3t19ZS+dYhE7/pJk5KR X-Received: by 2002:a62:4fd5:: with SMTP id f82-v6mr744461pfj.214.1530004924198; Tue, 26 Jun 2018 02:22:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530004924; cv=none; d=google.com; s=arc-20160816; b=FXlLN65srnvPkku3PRimj5UneYLlwiySZe8Akm0Fxppod7ub5eMlxayB8GLR8YXV0/ 9ScwffAF4zqZ4EgIlsQvbdRS3XkctNANqdzzB+jx+8G66CHc9ZG4tbRZDxF9M9yhDok5 IFkeMZSZ5ZoN4MAMQ40Fp8EgPvq11r4y7/QlnbvxZPUtAgZxRlytBkUvmWujwTykk34R d3wWnMRtnvdYx254SDhbGuAVmuI3Mkm+GbES7QAX0VFoN2VydHMVDV5Uvg6xZqgoVCgk FDRkvjYlrixNPGSE8Dg3MdTjV5w2TpvWV5LlLaY73ZiAvqa/UeSN1ehUN9tGJ3xwr97t Rnvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=I1mznbZp9SEXTt23V5Uo+OwPhTFN+Yiv07s+vc6BGK4=; b=fqLADuqftDMvyNkYoXrSC9rYHlr+gTP67lnWWpizmoNvTgBCqdAH8ynAodhMafQm4d zGVONzcmjtckl9NATNKFpj/iyupezGjCo0cCRuav8aGI62dweg43MCLm/EZlw9sGFm5r o8CXnTQeQajn4ps9DSX7/rimhLm+F1hnZVosaIYELLfTNsiUx/lKSJU3IV2QwDu2AOup wU40cRi2hAwJawRCVJtSzQGwrzfchEtCqsNOwuFhIYSSV99a/agt3wIVQ5C9Z3vsFAca Ba/y8SRTb9qBb766mibuWC9s/4Ts7QiMiR+D6H+WymBf9XXBTdme+bsYFGem88ir8tNK NPOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r9-v6si1025200pgp.591.2018.06.26.02.21.50; Tue, 26 Jun 2018 02:22:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933035AbeFZJVF (ORCPT + 99 others); Tue, 26 Jun 2018 05:21:05 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:47656 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932189AbeFZJVE (ORCPT ); Tue, 26 Jun 2018 05:21:04 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1fXk9R-0004pd-UP; Tue, 26 Jun 2018 17:20:41 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1fXk9R-00020q-C6; Tue, 26 Jun 2018 17:20:41 +0800 Date: Tue, 26 Jun 2018 17:20:41 +0800 From: Herbert Xu To: Kees Cook Cc: "David S. Miller" , linux-crypto@vger.kernel.org, "Gustavo A. R. Silva" , Arnd Bergmann , Eric Biggers , Alasdair Kergon , Giovanni Cabiddu , Lars Persson , Mike Snitzer , Rabin Vincent , Tim Chen , qat-linux@intel.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 11/11] crypto: skcipher: Remove VLA usage for SKCIPHER_REQUEST_ON_STACK Message-ID: <20180626092041.mxfg4lxcvxfivzc2@gondor.apana.org.au> References: <20180625211026.15819-1-keescook@chromium.org> <20180625211026.15819-12-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180625211026.15819-12-keescook@chromium.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 25, 2018 at 02:10:26PM -0700, Kees Cook wrote: > In the quest to remove all stack VLA usage from the kernel[1], this > caps the skcipher request size similar to other limits and adds a > sanity check at registration. In a manual review of the callers of > crypto_skcipher_set_reqsize(), the largest was 384: > > 4 sun4i_cipher_req_ctx > 6 safexcel_cipher_req > 8 cryptd_skcipher_request_ctx > 80 cipher_req_ctx > 80 skcipher_request > 96 crypto_rfc3686_req_ctx > 104 nitrox_kcrypt_request > 144 mv_cesa_skcipher_std_req > 384 rctx > > [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com > > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: linux-crypto@vger.kernel.org > Signed-off-by: Kees Cook This has the same issue as the ahash reqsize patch. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt