Received: by 10.213.65.68 with SMTP id h4csp450825imn; Tue, 13 Mar 2018 09:26:48 -0700 (PDT) X-Google-Smtp-Source: AG47ELtNUh50pA4bkTvz1RF6UE7q2BlskklNVIlYd5tcwxeVeFypuq7b1kiyBdC3dXp/fiMZTn/n X-Received: by 10.98.8.92 with SMTP id c89mr1174908pfd.154.1520958408188; Tue, 13 Mar 2018 09:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520958408; cv=none; d=google.com; s=arc-20160816; b=G5frgNd/FDrhCwIZGuCNAnm1oT0qzKmtVFPAy2CZJj3s9n7y1jgIjswlMeckuTFGaW YfIofTbtHif5K5z3cyxvDZXTR3VIo4pw7ZFtfGWJB8u8O6sgYo/yftHqJVGpemW9hao/ ILDo+y4Zf8rLG7R9XQsh55qVVxs32c7Robn1T1pOCbkaQwbGU1aw5Zb7HZ/uPLG2vfqW Yc9MoA9ASMz8t2MPWIzmdgRakFaoS0RFRY4B/bxUJtVcfygklvAsBzEBTQbyGOslOeHh 0PNq5sOqwH/V+Bqm4NRoMxngjt8jUyx3thY+anBEVUrZsvY6CqwmFMM7i/EDqaz0zJhH dU0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=gNHHSn8Xlh40fVCNoah3YZ0KoxpPUCJrgk8tCEDdEfc=; b=RqLO67VeUXhhooQvOtnxiYpeZ/TG04q2lhr+Tp60UYuhuVbTa257DqKENqb0/N38WB WWHeeTmYVgr30wU0+Ohk9s0FlEBQfhO3HukUq69tzZIaVkzj2iZO2HDWSsiqhIaeYnvS /A+2IpxyJ6kzhw9KdSl+IstcGhjOlBksP8Znx5AEQdBt8PdCas91K9amTEXUKYELkQGS mrjZXfriNgxmutA3B3KMbgOaz2/3FmrYG7k596o/ee4u5cAD2X1YlFXKu0KKjAngD30P ILv5uPvCnndCmorJpy5mvZubEFT/goU1QXWcxJw3uDTYHipN70Mo2LC4peb96O6Kd1LL Qb3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AyRED6aX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4-v6si277855plr.365.2018.03.13.09.26.33; Tue, 13 Mar 2018 09:26:48 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AyRED6aX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752864AbeCMQZJ (ORCPT + 99 others); Tue, 13 Mar 2018 12:25:09 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36495 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932951AbeCMQZG (ORCPT ); Tue, 13 Mar 2018 12:25:06 -0400 Received: by mail-pg0-f67.google.com with SMTP id i14so76849pgv.3; Tue, 13 Mar 2018 09:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gNHHSn8Xlh40fVCNoah3YZ0KoxpPUCJrgk8tCEDdEfc=; b=AyRED6aXEeiEMAkgP2xkumlzhKtIZeXvO7YxrlDwz9+si5gItmqGaQmBYG1OvuYDPJ HdY9uxPtQ/dKRItiX/KtBmtwob5uvKoYMWDgn0TzKRUHmR5K8BwUbQgy+zD6Os9+Ribb KYnYpJqb9n2w6iylZutqNeEoY/wBASBMg4GIM3KHfNNAMsUl09AuG8FqGG7qfDLxHkc5 FNundK7Xf4J5MCHFK/BFQnTLIi6N7GvDRwR9N2S3Sr+RnXE/Q4RWVgwPIN+iHOR+lv1L RoK88MVVfQ/ilxZrd9AEowABsAjYVtwdz1u2R/cJIvNYYoeT/vF6K32MDoG16AnOCiSO tFCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=gNHHSn8Xlh40fVCNoah3YZ0KoxpPUCJrgk8tCEDdEfc=; b=dEZqo9Eb+9JfCr0x6EKQuvr+WxEn9/ewTMnIrphViniHpaDbnRwQsCmx1Kf/7X+WPC 9xvabrKBWrAuNNMDXJAYfVVoBIi5naUJi37R3tdaJw6pOwjqrw7cDSH1r/GFUT1GXxat qLD+9GDkKzvzBNweOyQmbuRXC8kJS8Msl2DQ8l1iigJW6xXpvrHIUwWInD3dGjClPWNx O7jiUYV4FRuc7RlpoAPZ/Olo7qasVj5DosbOhwjzORl6ckODV5e4Ju9GV64E/kSTiaY2 P2pgyJOExMLzdnY6SEmfRbU3YzK/uK9Ahvil97KsVCDjZl8kyFtXwVLdPvSdEGIxtqCd turg== X-Gm-Message-State: AElRT7HzpFAcCHWBTQ8suamDvmIpsIZDoIsk8ObQO61SLwUXke9e7oPC KBOWKBc393v0zi/ilpGBG9Q= X-Received: by 10.99.155.1 with SMTP id r1mr986330pgd.422.1520958305535; Tue, 13 Mar 2018 09:25:05 -0700 (PDT) Received: from himanshu-Vostro-3559 ([106.223.30.231]) by smtp.gmail.com with ESMTPSA id y23sm998310pgv.4.2018.03.13.09.25.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 09:25:05 -0700 (PDT) Date: Tue, 13 Mar 2018 21:54:54 +0530 From: Himanshu Jha To: "Gustavo A. R. Silva" Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage Message-ID: <20180313162454.GA8769@himanshu-Vostro-3559> References: <20180313152343.GA31789@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180313152343.GA31789@embeddedgus> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Gustavo, On Tue, Mar 13, 2018 at 10:23:43AM -0500, Gustavo A. R. Silva wrote: > In preparation to enabling -Wvla, remove VLA. In this particular > case use macro ARRAY_SIZE so the length of array _result_ can be > computed at preprocessing time. > > The use of stack Variable Length Arrays needs to be avoided, as they > can be a vector for stack exhaustion, which can be both a runtime bug > or a security flaw. Also, in general, as code evolves it is easy to > lose track of how big a VLA can get. Thus, we can end up having runtime > failures that are hard to debug. > > Also, fixed as part of the directive to remove all VLAs from > the kernel: https://lkml.org/lkml/2018/3/7/621 > > Signed-off-by: Gustavo A. R. Silva > --- It is already applied as I had sent the patch few days ago. https://lkml.org/lkml/2018/3/10/164 I specifically CC'ed you and Kees to avoid the patch collisions. -- Thanks Himanshu Jha