Received: by 10.223.185.116 with SMTP id b49csp6112294wrg; Thu, 8 Mar 2018 01:55:17 -0800 (PST) X-Google-Smtp-Source: AG47ELuRRdutiubkKaI+hEvASPM78brKaJOw3YiTxOfRKGDRN1w/+SjRrYcx/7/Bni55j+Ue25q8 X-Received: by 2002:a17:902:600e:: with SMTP id r14-v6mr23884525plj.200.1520502917071; Thu, 08 Mar 2018 01:55:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520502917; cv=none; d=google.com; s=arc-20160816; b=Prm5XbsOFDXH1vJUoEPJrwBuP97PzVEJZS1mQK4wl6BA0GKmWuY3Ur0EIsWwnd1Gyp tEpK0xtmJTlU3ZDhC5SDIq63cj/5dJuwVrrLOpEpd9xFgTJBCZdc+EuKTn+Z2uEAeMMD FUvTbbtlqBvmX5JHXyHwxVe5KmapI/54Vx4gfiWpQ8Q1fXxU0bwD2Ptluz/DEnnG3JFP YvLuENI3de57MO+u6RDiXdEiEgoI3/njtoWYmZ3adSaf4f0iffWsTSX/KtJMGODSHnPl Rk+VIi917JSuCycLXMXt98KyKo4QKeU4k5mEAPjqT16RuP5c6UUgW6ZhXREjfNR3Qpoe WR2w== 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:arc-authentication-results; bh=iqODe1dtHPip3jgigO+xwlFB9F23TLMMrmPGBuls6Vc=; b=xto2rXqMSeAOzmKvJVN3icwOoeMy15PEMUnq2KfejmJmOn+ZpLdjyJOegslM3jwYFZ TGAtulusyNwYX778RIhnnTc/FBJCxLHAxwR0ddWjtM7BWrV6Lw/2zbLpfjVrZ5b/N2SK d5/Eh2P0palQqiAU5swulkudYgQQzTlAe8UC1LEcZOdOlPD/aKZaApWR3tM25sOnGl3A /6/5jLFx8q+/V8lCLgdpetCk3/pkqallRmLtDRUSvQ+A3/h3xbcjTHc/kJ36etaOvqiP QYl5kfBx2y8XxWT4HDyS2swpdZCnIMR6R59LaJFSiIUJSqaJETnzYsCeZPoy/I9jQlyr 0kTA== 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 h71si12733918pgc.3.2018.03.08.01.55.02; Thu, 08 Mar 2018 01:55:17 -0800 (PST) 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 S935718AbeCHJtY (ORCPT + 99 others); Thu, 8 Mar 2018 04:49:24 -0500 Received: from mail.bootlin.com ([62.4.15.54]:41553 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935676AbeCHJtV (ORCPT ); Thu, 8 Mar 2018 04:49:21 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 468CF2073C; Thu, 8 Mar 2018 10:49:18 +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, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id E3297204AD; Thu, 8 Mar 2018 10:49:17 +0100 (CET) Date: Thu, 8 Mar 2018 10:49:19 +0100 From: Alexandre Belloni To: "Gustavo A. R. Silva" Cc: Alessandro Zummo , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] rtc: remove VLA usage Message-ID: <20180308094919.GD20370@piout.net> References: <20180308022756.GA28733@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180308022756.GA28733@embeddedor.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/03/2018 at 20:27:56 -0600, Gustavo A. R. Silva wrote: > In preparation to enabling -Wvla, remove VLA and replace it > with a fixed-length array instead. > > From a security viewpoint, the use of Variable Length Arrays can be > a vector for stack overflow attacks. Also, in general, as the code > evolves it is easy to lose track of how big a VLA can get. Thus, we > can end up having segfaults 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 > That is a good description, thanks > Signed-off-by: Gustavo A. R. Silva > --- > Changes in v2: > - Update changelog as per Alexandre Belloni request. > - Update the code for rtc-bq32k driver based on Alexandre's feedback. > > drivers/rtc/rtc-bq32k.c | 6 +++++- > drivers/rtc/rtc-mcp795.c | 2 +- > 2 files changed, 6 insertions(+), 2 deletions(-) > Applied. -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com