Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1212798imm; Wed, 20 Jun 2018 13:41:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJfgwapulgQI+BYK1EWcVQfgfY6MX77a4nYp5nOEwelrzC9pqLTFmR+sgGWJONiUQXZxPVs X-Received: by 2002:a63:9d88:: with SMTP id i130-v6mr341284pgd.162.1529527280851; Wed, 20 Jun 2018 13:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529527280; cv=none; d=google.com; s=arc-20160816; b=w+1kYU7aoc62rgKvtwu7Sjbdf3A6M+Q8TCUZPYBN4ddT5cc8H2c2f11Ol9XMQ72i2r a/NqHCnUbR+z6CbOagfqVsgTw1k4W5sJK+RYnKWwekl0R78/l2PQgNJ2VhycCqcWpF94 THMwK6EXm+ENZTF/61Mjvc3YKM0VkZtAHgIjU0gfyhfSTIDelxZ0xohloWbkR0zdqmgC ZOXw0N+nYrr/vYz4paMbOD9eRexMxQD8I1PigdsRrB0S7m5rIdGg4MevR0IZmUkjFyfC jwWj9knZfHOdHtbM2VTTmLVkaN7O+BjXnYmqRz6aCK8hZBPTlXA6Lxua3BiHV42QtBzU h38g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=+N6QHGdN+rm7u3zZFjJ9C6T1x9VNcjFLi0iUnjvR4XA=; b=LnaKwNjcTo794TGc2PxQX6WSVeV1yn81ghAgEn9UvWRddLVNAqpuMYKSHHEn4zX3nE 7xDTS47Blxhxt7FwSw4bqzeQQUjiOBheRHHfSdEPRLSFFksyL3KRJXYYartakqjnwrqK QkcLl25demli33jBQEO5hnjm+g1dQwWY5x7X06E8o8r8teG+qalA1+Ef5v6eA7kFa8x1 zdvLTtJjh42wEcJ+QFXiKhkvOLsyT9z4sDkrdWzlFsRjjXOr2U16HXU1DIw5BlmsYSPw N1O+7oOwPEpmOUlUlHur9srlgUCgl1frjvjarWscO4W5ax7+h50J3DLX0IyiZhWPEuxg q23w== 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 s184-v6si2619526pgb.172.2018.06.20.13.41.06; Wed, 20 Jun 2018 13:41:20 -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 S933446AbeFTUkD (ORCPT + 99 others); Wed, 20 Jun 2018 16:40:03 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:51132 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933148AbeFTUkA (ORCPT ); Wed, 20 Jun 2018 16:40:00 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 419xXV4brkz9tvf7; Wed, 20 Jun 2018 22:39:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id z8BgJ3zG8xHk; Wed, 20 Jun 2018 22:39:54 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 419xXV3yTHz9tvf5; Wed, 20 Jun 2018 22:39:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id EF58F8B83E; Wed, 20 Jun 2018 22:39:58 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id jInhoYD73Tgz; Wed, 20 Jun 2018 22:39:58 +0200 (CEST) Received: from PO15451 (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 49AD68B82D; Wed, 20 Jun 2018 22:39:58 +0200 (CEST) Subject: Re: [PATCH 01/11] crypto: shash: Remove VLA usage To: Kees Cook Cc: Herbert Xu , "Gustavo A. R. Silva" , Alasdair Kergon , Arnd Bergmann , Eric Biggers , Giovanni Cabiddu , Lars Persson , Mike Snitzer , Rabin Vincent , Tim Chen , "David S. Miller" , linux-crypto , qat-linux@intel.com, dm-devel@redhat.com, LKML References: <20180620190408.45104-1-keescook@chromium.org> <20180620190408.45104-2-keescook@chromium.org> <638faf05-946a-1345-dda4-f75fee5b07d9@c-s.fr> From: Christophe LEROY Message-ID: <073a8f9e-8ad5-6fd5-e9b8-33e2c9a65e37@c-s.fr> Date: Wed, 20 Jun 2018 22:39:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 20/06/2018 à 22:36, Kees Cook a écrit : > On Wed, Jun 20, 2018 at 12:30 PM, Christophe Leroy > wrote: >> >> >> On 06/20/2018 07:03 PM, Kees Cook wrote: >>> >>> In the quest to remove all stack VLA usage from the kernel[1], this >>> removes the VLAs in SHASH_DESC_ON_STACK (via crypto_shash_descsize()) >>> by using the maximum allowable size (which is now more clearly captured >>> in a macro). Similar limits are turned into macros as well. >>> >>> [1] >>> https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com >>> >>> Signed-off-by: Kees Cook >> >> >> Got the following warnings: >> >> crypto/testmgr.c: In function ‘alg_test_crc32c.part.4’: >> crypto/testmgr.c:1896:1: warning: the frame size of 2088 bytes is larger >> than 1024 bytes [-Wframe-larger-than=] >> crypto/hmac.c: In function ‘hmac_setkey’: >> crypto/hmac.c:88:1: warning: the frame size of 2088 bytes is larger than >> 1024 bytes [-Wframe-larger-than=] > > Ah yes. I didn't do 32-bit builds. So, here's the issue: this uncovers > the frame size problems that were hidden by in being a VLA before. It > was always possible for the frame to get this big, it's just that the > compiler couldn't see it. > > For qat, I raised the -Wframe-larger-than flag. It seems we'll need to > do this in some other places too. Maybe the issue is because I have selected 16k pages ? Christophe > > -Kees >