Received: by 10.213.65.68 with SMTP id h4csp3155391imn; Mon, 9 Apr 2018 15:25:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+I1SWRxOdPMycFZQbtQu+maSQJA7/POgSJc5x4hj4zgKLIvljrVNc9Hqw8FqSdHNwGBZY+ X-Received: by 2002:a17:902:481:: with SMTP id e1-v6mr40455856ple.377.1523312712907; Mon, 09 Apr 2018 15:25:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523312712; cv=none; d=google.com; s=arc-20160816; b=EBN0QZUkt78Xknn8laDTq8b+dWtnVQLNab9Y+M9quhh29HNFCVBpP2obWf9s2PR711 Y3WEOyztyIWP8yWj+SFdFB3OhqLPkuyOmpJ53YdiivLC93Pja1yjk9zqb67jw/osT7Wr K62qzKT9/JXj/akBEfHkY/73W2CWTDzfjgcwbCAYGmBVtTphTWRBUA06xPQJuodzFlhR tRx8iJ1t6KIn5mygxJBqSR7HAapbGsNNWKhBST5ny/80MdtRq3oZn2pmNz9i3GQUJmJ+ HBf/krhiwdNTdoTTc5+McX1TMiKkuY5BPcy9cDUAQm87t4Fk21HqPJKGrtisXv1CBPIv +aYA== 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=Lpom34oTIIagmiCwV1gox+SofcsC0GhihfdeVrCb+XM=; b=oVOKOGOhInBRPvPFLGnXqv/cgISqF5r9rN/YMKUNW/+Yt2RnMaKRRnNCUOdMvrTiQh s08WwJh9cMWZXaBpHAFNDJpf99ICzZ7/iVEH3ypBX6M8Df9zRJ28VDiV7crXe80KfWe2 VF9ME8EuaIXm9PFrI2T5YbnR8Edijc+u5om/X4B6WYkzF7aggaAbIUM3frVxxagJbRZI /zixCg5XghREjS8STzrcZJmdPZNPLIu3fOpISQRQSOSsB45gXO59sWwNfOt3/H3to25Z FsW1lDL8s4FoP9hbF49DbasMCpkjWYh+c9WOyT1/FkrmVv3eTXUyzQkVx/cgBx2q3c6w oTUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=fABparhz; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si781781pgo.567.2018.04.09.15.24.35; Mon, 09 Apr 2018 15:25:12 -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=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=fABparhz; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751611AbeDIWV5 (ORCPT + 99 others); Mon, 9 Apr 2018 18:21:57 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:46470 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbeDIWVz (ORCPT ); Mon, 9 Apr 2018 18:21:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Lpom34oTIIagmiCwV1gox+SofcsC0GhihfdeVrCb+XM=; b=fABparhz210eMBcXnvpDnFeZS O1l+doVN12W6tys4UQYx1X38xgkx8s4vkTLIWSOESz6hKh0bg0SVJXHSU5L6vvIdNPkvskYkLqHjy vxdW31SWHtzCLnHuinchGstNa50kj1O9gAV1VmQ3T1u2CF/a4/PpLk2MwTNmGEqiANkB8=; Received: from n2100.armlinux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:50179) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1f5fAX-0003kR-5h; Mon, 09 Apr 2018 23:21:45 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1f5fAU-0005g9-KP; Mon, 09 Apr 2018 23:21:42 +0100 Date: Mon, 9 Apr 2018 23:21:41 +0100 From: Russell King - ARM Linux To: Laura Abbott Cc: David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Kees Cook Subject: Re: [PATCH] drm/i2c: tda998x: Remove VLA usage Message-ID: <20180409222141.GR16141@n2100.armlinux.org.uk> References: <20180409210703.3787-1-labbott@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180409210703.3787-1-labbott@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 09, 2018 at 02:07:03PM -0700, Laura Abbott wrote: > There's an ongoing effort to remove VLAs[1] from the kernel to eventually > turn on -Wvla. The vla in reg_write_range is based on the length of data > passed. The one use of a non-constant size for this range is bounded by > the size buffer passed to hdmi_infoframe_pack which is a fixed size. > Switch to this upper bound. Does this _really_ make it safer? What if the code is modified to write more than 32 bytes in the future? Sorry, I don't think this is safer at all. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up