From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:50542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932177AbeCHSGh (ORCPT ); Thu, 8 Mar 2018 13:06:37 -0500 Date: Thu, 8 Mar 2018 13:06:33 -0500 From: Steven Rostedt To: Josh Poimboeuf Cc: Kees Cook , Andrew Morton , linux-kernel@vger.kernel.org, corbet@lwn.net, gustavo@embeddedor.com, Chris Mason , Josef Bacik , David Sterba , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Masahiro Yamada , Borislav Petkov , Randy Dunlap , Ian Abbott , "Tobin C. Harding" , Sergey Senozhatsky , Petr Mladek , Andy Shevchenko , Pantelis Antoniou , linux-btrfs@vger.kernel.org, netdev@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: Re: [PATCH 0/3] Remove accidental VLA usage Message-ID: <20180308130633.0d819f44@vmware.local.home> In-Reply-To: <20180308150236.5tysfbm3xdouii5n@treble> References: <1520479847-39174-1-git-send-email-keescook@chromium.org> <20180308150236.5tysfbm3xdouii5n@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Thu, 8 Mar 2018 09:02:36 -0600 Josh Poimboeuf wrote: > On Wed, Mar 07, 2018 at 07:30:44PM -0800, Kees Cook wrote: > > This series adds SIMPLE_MAX() to be used in places where a stack array > > is actually fixed, but the compiler still warns about VLA usage due to > > confusion caused by the safety checks in the max() macro. > > > > I'm sending these via -mm since that's where I've introduced SIMPLE_MAX(), > > and they should all have no operational differences. > > What if we instead simplify the max() macro's type checking so that GCC > can more easily fold the array size constants? The below patch seems to > work: Nice. Have you tried to do a allmodconfig and build on various archs? Of course pushing it to kernel.org will have the zero day bot do it for you ;-) -- Steve