Received: by 10.223.185.111 with SMTP id b44csp811145wrg; Fri, 9 Mar 2018 14:17:17 -0800 (PST) X-Google-Smtp-Source: AG47ELsKW+q9wfvGRb54QzdqEnz2T1NgCRIxztw4R/ZNgO35Na7a8g0T/CFwV2hNEEOOwSxk+Ugl X-Received: by 2002:a17:902:28e2:: with SMTP id f89-v6mr48092plb.114.1520633837257; Fri, 09 Mar 2018 14:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520633837; cv=none; d=google.com; s=arc-20160816; b=i1D94YNc+9WGegCRyM4rGSdBxCZhpZOCkIPYiDfW+ay+BkEkG/abJj170l3qA39YF4 WryUrR7WEnZajCp3wyHPYiNT87QhcGyTfZLgBtKuYytJlPQGmiedZrgtP2XeEFavJjx7 8392bxiSh9L4l75cfTfZAK9uw4RG07dkJ4HTqMU1N5z+37JPtKRA7V5XHaB851/CgiT8 7AJpGs3MzZjxi65gsy/HuVGcYkFgXRg4IHuTMzmv+qRK4eSOe4K2XDD2U4v7lMR5R56s PK3g/7mFKv9j2H9tkBt1U+jUNV5ktzaLeMO3GzDTR8tmt0Qy+6bYz6DH5KaSIi2G4alX IdMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=O59kq8/QpHFuE87P2BKCW5nhv703//meU8hgjqoWR+g=; b=uLC7dhgBB6UqfMA0wesN7w3R7xO4qVEYzuQch4VEceWi+OGRe0ryjfWf3NGvckhIdX gM5jHbo3aqGAPRbatEzOaO6U2HChAOZUhE1PAAALv8Mf2n1IwfScyXmemb42z1Ug2J8f wR6bLIQb4E4Lwb0U185+L5LPp23/WVpmftpqFZX9njJqpEWPW8mFgvbM440ARuEYCRxh xUm0akQ4ZBjKglbOgZLdHHpk897q62GNv2ap5Kp5wbgYhrG7SvRNN+KzaVlp8YQxoic4 E6Zi4RbkM6BJl9jN3pGsrQerhFMPEZJm+Ep41f3tQOqubX9doMxjVmxfzeDRjTnexOwp bQKg== 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 n14si1570710pfk.106.2018.03.09.14.17.02; Fri, 09 Mar 2018 14:17: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 S932669AbeCIWPy (ORCPT + 99 others); Fri, 9 Mar 2018 17:15:54 -0500 Received: from 10.mo177.mail-out.ovh.net ([46.105.73.133]:53905 "EHLO 10.mo177.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932108AbeCIWPw (ORCPT ); Fri, 9 Mar 2018 17:15:52 -0500 X-Greylist: delayed 91195 seconds by postgrey-1.27 at vger.kernel.org; Fri, 09 Mar 2018 17:15:52 EST Received: from player729.ha.ovh.net (unknown [10.109.108.16]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id 39242A1D96 for ; Fri, 9 Mar 2018 23:15:51 +0100 (CET) Received: from heffalump.sk2.org (gw.sk2.org [88.186.243.14]) (Authenticated sender: steve@sk2.org) by player729.ha.ovh.net (Postfix) with ESMTPSA id 2CAA95E0090; Fri, 9 Mar 2018 23:15:44 +0100 (CET) Date: Fri, 9 Mar 2018 23:15:42 +0100 From: Stephen Kitt To: Anil Gurumurthy , Sudarsana Kalluru Cc: linux-scsi@vger.kernel.org, Kernel Hardening , LKML Subject: Re: [PATCH] bfa: remove VLA Message-ID: <20180309231542.3eb53b87@heffalump.sk2.org> In-Reply-To: References: <20180308213841.13807-1-steve@sk2.org> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/jOtjcHV197POdtlrpWmTaxu"; protocol="application/pgp-signature" X-Ovh-Tracer-Id: 546905879944580586 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtfedrkeeigdduheekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/jOtjcHV197POdtlrpWmTaxu Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I sent this to the wrong maintainers, sorry =E2=80=94 you=E2=80=99ll find t= he original patch on https://patchwork.kernel.org/patch/10269257/ Regards, Stephen On Thu, 8 Mar 2018 13:43:07 -0800, Kees Cook wrote: > On Thu, Mar 8, 2018 at 1:38 PM, Stephen Kitt wrote: > > In preparation to enabling -Wvla, remove VLAs and replace them with > > fixed-length arrays instead. > > > > bfad_bsg.c uses a variable-length array declaration to measure the > > size of a putative array; this can be replaced by the product of the > > size of an element and the number of elements, avoiding the VLA > > altogether. > > > > This was prompted by https://lkml.org/lkml/2018/3/7/621 > > > > Signed-off-by: Stephen Kitt =20 >=20 > Reviewed-by: Kees Cook >=20 > -Kees >=20 > > --- > > drivers/scsi/bfa/bfad_bsg.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c > > index 3976e787ba64..7c884f881180 100644 > > --- a/drivers/scsi/bfa/bfad_bsg.c > > +++ b/drivers/scsi/bfa/bfad_bsg.c > > @@ -891,7 +891,7 @@ bfad_iocmd_fabric_get_lports(struct bfad_s *bfad, > > void *cmd, > > > > if (bfad_chk_iocmd_sz(payload_len, > > sizeof(struct bfa_bsg_fabric_get_lports_s), > > - sizeof(wwn_t[iocmd->nports])) !=3D BFA_STATUS_OK) { > > + sizeof(wwn_t) * iocmd->nports) !=3D BFA_STATUS_OK) { > > iocmd->status =3D BFA_STATUS_VERSION_FAIL; > > goto out; > > } > > -- > > 2.11.0 > > =20 >=20 >=20 >=20 > --=20 > Kees Cook > Pixel Security --Sig_/jOtjcHV197POdtlrpWmTaxu Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEnPVX/hPLkMoq7x0ggNMC9Yhtg5wFAlqjB48ACgkQgNMC9Yht g5wCVg//UcQ24fCOOWQ5szsHoH5YyR1bybfaTFF7kioyZbs8Y81CvCAHDrPG4e/L amizlXarNLtjYRGGCilsR8G7ZVa0PzaZiVE4H+r4feFZ4YARFgZH2Hu2qyySwTRK yu0tchLBE3/QlGgNC/0zd7pPWMXcNeB88OZCbcIGjy/GG5SO1XRjiPaAKsHfe6b3 9AFyr4bHKwqzuZaLLMZSJgb9J1RIFH0ZF4KPc+bc4tHMlNryU4VWJzuucZQzS5AI tzFbuwi7V+7R9qj7o7TdrDKw64HrBgFci+f1xRkGKoOrPTXpXMSWt0zMjaKI47ft FNvFoftDHNRNs+4v7b3mczLW0UAFiLA9gGSwWqv4ra/Ot0BcevILYdc2RQrIIcZ0 FBWugDaSnexs/IcTkaooInaR0mDGZig9NcWd0mzmcszg/b6hqqtcuSXrQX0W9TAH St5ObogNFnBIrqHNROyCtKhZBxsKqTlAMOhvQziTtUoCG4jmVt4OpJ/J6K+SJ6zw BCRn7FkKb5fbnd7RsUOKn6RiP87OXie2f/lGn1JpaOZq47ndHw01xh2b0u6aAq/j fVMqK5ODTNYYogt/GQrxIGQ5bjt5rWa/147XMZW1NGWJ896eq/nkv9Cb33PhC0si wPAvk2D7+fdMYeeXdkWWU1YvljrI6s1FWO8blFVY00rvNgJXEeg= =jztF -----END PGP SIGNATURE----- --Sig_/jOtjcHV197POdtlrpWmTaxu--