Received: by 10.213.65.68 with SMTP id h4csp468108imn; Tue, 13 Mar 2018 10:00:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELsGAr/NILQbbsoWxV73Z+g+1XdECdY2w/Gi/Xjvkv6tkRSSM1b0xgJmb2Cbn0adMtZR1AyD X-Received: by 10.101.85.2 with SMTP id f2mr1079639pgr.210.1520960441798; Tue, 13 Mar 2018 10:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520960441; cv=none; d=google.com; s=arc-20160816; b=su6/QRQ+URrxfJEZ0TIzwlh1kZfFe5NfR2sm9iNh9M9gOhMbh/e2MtD0bo7kv7o+Ex W2qBnN/u+0JhbSN7SMeMlFO2E6c/91rr9F0GstJjfC/rzYV6hMz67keR/kTS/WuxCYd4 aw8A3jTih017QWqjexUoIu3Ft+n50QtBz/SI/L2yTfyNdXCebKcK6K5KjGAMcO3OSwuA Z00dfyN7062O/7gyf/Pc0ECLbN8ugPfhNh3IZ5ESwEzE7IFVdZ9Rkr24nNnZDwssEgsg 7bpMSQqKnEjCbFgnO7u4bDnZS0nDShyZlmmCO8B2lLGrkgnSK11pnphmLv02IVVjPAqX AV9w== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=9qbJCjK+BEyLgQFopYFoCbu3RdjcGexLxOGV+IypnW4=; b=MlCbTwH7+2pgiGSP9c5H1OINDFNsiaQ0Gvo6tkVK3w5cvs8wdq5MhT6lSWupxHUSdH 6kBXAkvc0OSe+AFu1Tg368rz+zaN1DtFAJtoFGoznJPYV2U1DP1NeoHzJf9w2sKxhp5L aiB4RPEhyqdyKmr3LJJWybb/u9oEneuNVga6UmRUvaWfhksl9e5xfCKe6UB1FkYazUo6 VKZs7HytN7w745TaB+66FzF4ID7S+jaRdDudX3qYb7cqZVJdnBLA2s7AORfJwKttUlPp LIFr63U40aG6RT3YKZnThh0yALKU4WiM9tSo/oPEBuwt9XGfTKTDp/LIrvHebvXtCz7i Ug6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pfw3U5Zc; 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 t11-v6si294933plo.225.2018.03.13.10.00.27; Tue, 13 Mar 2018 10:00:41 -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=pfw3U5Zc; 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 S933105AbeCMQ7U (ORCPT + 99 others); Tue, 13 Mar 2018 12:59:20 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:40368 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932671AbeCMQ7R (ORCPT ); Tue, 13 Mar 2018 12:59:17 -0400 Received: by mail-pf0-f193.google.com with SMTP id x1so122658pfh.7; Tue, 13 Mar 2018 09:59:16 -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:content-transfer-encoding:in-reply-to :user-agent; bh=9qbJCjK+BEyLgQFopYFoCbu3RdjcGexLxOGV+IypnW4=; b=pfw3U5ZcydCCC1Tu8zOebG7Dk+9KLf9AKrqZZUlDyUdNg3mjFmYbedufCxy60hGlJZ w03lQuG9wzaMCADQsVxTp7PDuxJc6kFggF5rttxKrfBdwWJyQwWlmc36NIdl8ePrx/jl o9IReC2bGJiAQqymcPXsIhswi0VtnAR2ITzOyuZlXJYTqaX2+wCqxli3ZnI8K89ztneY iOrPfasNZrU6elST3ClYNHr/lmJyXj6Sj++99AIVXyZhChlvsfyZHbflkICw47p00AMs ugkiGPLlnxijGz4no7dZRkLcZZDrgdkh6W6G/JX2cEYSoXUnXO7yr/zNQfhn9gLu1ep+ YNvA== 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:content-transfer-encoding :in-reply-to:user-agent; bh=9qbJCjK+BEyLgQFopYFoCbu3RdjcGexLxOGV+IypnW4=; b=Jb9B1EzTkqhXTagw5BmF/zO0I9IZrv4xI3CUKxI3lMaL/3rYo8x3sOuFDhntQo71q3 F2Jp+4QTrGRskFDmg1lLJQhMH3rO0xR/nYbuxj3eRV48W6QcNFL36T6ard48Fpyorw1m NesWi+oTwYuMcLUHScpjFXFYUtKhF09BUhl01CU5DYvpETAQZ4jLhOuHFcow2uFJ/c3x v7cV/03URjHJrHrV30afZDt8KW4Jg1PnGpsoTtts6iUkSyBmRAXyBTcyJtCf8ZZNqfgt Za9FS0IQ2vk+8G7w8zvGd16gxolXLgfhItwgW7G2go0g9rhpnTDtQK9VUwJ5ml5og4fH FqLQ== X-Gm-Message-State: AElRT7G7FYhET+2takTCsM7P+XrkX19yAg3mBab6qzCwfVDBb5elhrJY JkjWIyoDFC6EOwKSHjzVjnqPh3G0 X-Received: by 10.98.224.65 with SMTP id f62mr1250005pfh.191.1520960356223; Tue, 13 Mar 2018 09:59:16 -0700 (PDT) Received: from himanshu-Vostro-3559 ([106.223.156.183]) by smtp.gmail.com with ESMTPSA id j23sm1106088pfi.78.2018.03.13.09.59.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 09:59:15 -0700 (PDT) Date: Tue, 13 Mar 2018 22:29:06 +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: <20180313165906.GA11317@himanshu-Vostro-3559> References: <20180313152343.GA31789@embeddedgus> <20180313162454.GA8769@himanshu-Vostro-3559> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 On Tue, Mar 13, 2018 at 11:31:19AM -0500, Gustavo A. R. Silva wrote: > > > On 03/13/2018 11:24 AM, Himanshu Jha wrote: > >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. > > > > I see. Can you please update this spreadsheet: > > https://docs.google.com/spreadsheets/d/1OcfyKK8pJ24esYhSEsW4Q2boZE7UTGbYsSEEtFXf7U0/edit Updated! Also, drivers/iio/humidity/hts221_i2c.c:43:2: warning: ISO C90 forbids variable length array ‘send’ [-Wvla] This was already removed in recent commit when regmap API was used. "6217792 iio: humidity: hts221: add regmap API support" For this I added a short note in the *Notes* column. -- Thanks Himanshu Jha