From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH v5 0/2] Remove false-positive VLAs when using max() Date: Fri, 16 Mar 2018 10:29:16 -0700 Message-ID: References: <1521174359-46392-1-git-send-email-keescook@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: Kees Cook , Andrew Morton , Josh Poimboeuf , Rasmus Villemoes , Randy Dunlap , Miguel Ojeda , Ingo Molnar , David Laight , Ian Abbott , linux-input , linux-btrfs , Network Development , Linux Kernel Mailing List , Kernel Hardening To: Florian Weimer Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Sender: linus971@gmail.com In-Reply-To: List-Id: netdev.vger.kernel.org On Fri, Mar 16, 2018 at 4:47 AM, Florian Weimer wrote: > > If you want to catch stack frames which have unbounded size, > -Werror=3Dstack-usage=3D1000 or -Werror=3Dvla-larger-than=3D1000 (with th= e constant > adjusted as needed) might be the better approach. No, we want to catch *variable* stack sizes. Does "-Werror=3Dvla-larger-than=3D0" perhaps work for that? No, because the stupid compiler says that is "meaningless". And no, using "-Werror=3Dvla-larger-than=3D1" doesn't work either, because the moronic compiler continues to think that "vla" is about the _type_, not the code: t.c: In function =E2=80=98test=E2=80=99: t.c:6:6: error: argument to variable-length array is too large [-Werror=3Dvla-larger-than=3D] int array[(1,100)]; Gcc people are crazy. Is there really no way to just say "shut up about the stupid _syntax_ issue that is entirely irrelevant, and give us the _code_ issue". Linus