From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array Date: Fri, 24 Mar 2017 15:09:36 +0100 Message-ID: <20170324140936.45gjbfdjyyag5cce@hirez.programming.kicks-ass.net> References: <20170317001520.85223-1-md@google.com> <20170317001520.85223-7-md@google.com> <20170317120837.pr74cv3xuj7qpoin@hirez.programming.kicks-ass.net> <20170317124404.mt3jd5q5vyk63q2w@hirez.programming.kicks-ass.net> <20170317192746.y5ade3bymifdni2p@hirez.programming.kicks-ass.net> <96158847-4F1F-4293-8435-E111F39E3260@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "H. Peter Anvin" , Michael Davidson , Alexander Potapenko , Michal Marek , Thomas Gleixner , Ingo Molnar , Herbert Xu , "David S. Miller" , Shaohua Li , Matthias Kaehlcke , "x86@kernel.org" , "open list:KERNEL BUILD + fi..." , LKML , linux-crypto@vger.kernel.org, linux-raid@vger.kernel.org To: Dmitry Vyukov Return-path: Received: from merlin.infradead.org ([205.233.59.134]:55892 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965014AbdCXOKA (ORCPT ); Fri, 24 Mar 2017 10:10:00 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org List-ID: On Fri, Mar 24, 2017 at 02:47:15PM +0100, Dmitry Vyukov wrote: > > Seriously, you should have taken the hack the first time that this > > needs to be fixed. Just because this is a fairly uncommon construct > > in the kernel doesn't mean it is not in userspace. > > There is a reason why it is fairly uncommon in kernel. So first off; its not entirely clear that the code as it exists it correct. From a cursory reading of it and surrounding code, there is no actual upper limit on the variable. If I were stupid enough to make a raid with 64 devices I'd get a huge on-stack structure. Since you're touching it; you should check these things. And secondly, refactor the code to not look like dog vomit. You can do more than the absolute minimal patch to make it compile, I'm sure.