Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3051829imd; Mon, 29 Oct 2018 00:32:01 -0700 (PDT) X-Google-Smtp-Source: AJdET5eudZ/DmjDE38qZR31foQBaoHKl92KXqmfrlAS5V6+idcWI7DMDQYpMHeY5Ehvx4a/gEGXZ X-Received: by 2002:a62:25c2:: with SMTP id l185-v6mr14148151pfl.8.1540798321187; Mon, 29 Oct 2018 00:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540798321; cv=none; d=google.com; s=arc-20160816; b=knR2AW7DXMrTbnpY+YQw/ii0PJko8U2LpXaVkZudvA2vf7D4et4D+rRZ4zj3D35wur /chuxddME8QjVEQrkgSdeGPlvp/WuA6bSQ6lQHtQqIFodXJ2M51vUywof2ctJtvo/DSX uoL7s+Zeq0e1Jg2OGg4qcfMVkHQcbT621wHpeVHweSKT954stiWlUMu33YkDFtgD2jpu HCTdLqoolaw7ks3OcGVwwJr2iYew92h2S/oCFhU/5eOlsc0cAMpwKvxOwBd4OyoFB1vt obxARbxMEgWwj3vNLfEoWEim9nNWPCn2bHwTnKAdm7Q85HfjUYmgOlKZ013kXJSCdaXk w+ow== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=gPhFMTG8+YSmzgIvifxfRoF/4Ej8GL+POdls2nZGoo8=; b=yGbgh2Cpj6CRkuTlnZ1Wj6fcTNcQD/Inn3uBU4A6l5ePJeTB25fDWg3CC0Q79kFG+y vunVJVbpthnl641CQMUoeInGKbdnlYJV8caszKI35osLRuV5U0XfUIwYunbePmISpp0L InNWVs5sOHaG8hfVodEPGnXRxnQyR9uDgYDjmRk3bNaoFmnZFU2fzDndSIVugLu1y5BJ iOtXC1AQSGT2Mnb9rzr0W3Kp/FiKABhkatWSd8kuwtFnMw+D2Q9UyfuP0CudkmTTAStg vltEkBEimJH4qeTIeRcZQT4HMod/ShAHhvJTkF0LPZYIFF/5r4Xz8rlAjf4HvR9g54cG VhqA== 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 x10-v6si18459661pfm.136.2018.10.29.00.31.44; Mon, 29 Oct 2018 00:32:01 -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 S1729409AbeJ2QRe (ORCPT + 99 others); Mon, 29 Oct 2018 12:17:34 -0400 Received: from mail.bootlin.com ([62.4.15.54]:52275 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729248AbeJ2QRe (ORCPT ); Mon, 29 Oct 2018 12:17:34 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 31135207BC; Mon, 29 Oct 2018 08:30:05 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id CDE8520711; Mon, 29 Oct 2018 08:30:04 +0100 (CET) Date: Mon, 29 Oct 2018 08:30:04 +0100 From: Boris Brezillon To: Kees Cook Cc: Arnd Bergmann , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , linux-mtd , Linux Kernel Mailing List , Olof Johansson Subject: Re: [PATCH] mtd: sa1100: avoid VLA in sa1100_setup_mtd Message-ID: <20181029083004.54d535d2@bbrezillon> In-Reply-To: References: <20181010184533.691620-1-arnd@arndb.de> <20181012111603.0d03e043@bbrezillon> <20181012112259.56f3c44f@bbrezillon> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kees, On Sun, 28 Oct 2018 19:13:26 -0700 Kees Cook wrote: > On Fri, Oct 12, 2018 at 2:22 AM, Boris Brezillon > wrote: > > On Fri, 12 Oct 2018 11:19:52 +0200 > > Arnd Bergmann wrote: > > > >> On Fri, Oct 12, 2018 at 11:16 AM Boris Brezillon > >> wrote: > >> > > >> > Hi Arnd, > >> > > >> > On Wed, 10 Oct 2018 20:44:50 +0200 > >> > Arnd Bergmann wrote: > >> > > >> > > Enabling -Wvla found another variable-length array with randconfig > >> > > testing: > >> > > > >> > > drivers/mtd/maps/sa1100-flash.c: In function 'sa1100_setup_mtd': > >> > > drivers/mtd/maps/sa1100-flash.c:224:10: error: ISO C90 forbids variable length array 'cdev' [-Werror=vla] > >> > > > >> > > As far as I can tell, there is an upper bound on the number of resources > >> > > that can be passed, based on the number of CS lines on the bus. > >> > > In practice, all boards we support have either one or two resources, > >> > > but using six to be on the safe side has no extra cost. > >> > > >> > Why not dynamically allocate cdev instead? That removes any kind of > >> > guessing on the max value, and it shouldn't hurt much since this code is > >> > in the probe path. > >> > >> Fine with me as well, If you prefer that one, please just add > >> Reported-by: Arnd Bergmann > > > > Oh, I thought I'd let you send a v2, but I can do it if you prefer. > > Olof just pointed out to me that neither fix landed for this? What's > needed for this? Nothing in particular, I was planning on sending a new version after -rc1 is out and then queue it for 4.21 (5.1?) (this patch came in a bit late, and I had already stopped taking patches for 4.20). If you consider this a fix or want to have it in 4.20 for other reasons, just let me know and I'll queue it to the -fixes branch. Regards, Boris