From patchwork Tue Nov 15 20:25:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 20538 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2927263wru; Tue, 15 Nov 2022 12:28:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf78erdr/B+s4JjgoluXjOXP56FX5FBoGqmh5lWzbmT99h/2EnzZET78QHzFrrHvMNjYki+R X-Received: by 2002:a17:90a:f684:b0:20a:df72:e61f with SMTP id cl4-20020a17090af68400b0020adf72e61fmr120298pjb.87.1668544134280; Tue, 15 Nov 2022 12:28:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668544134; cv=none; d=google.com; s=arc-20160816; b=VKZUXt73XMHrLcizy0AwYfEIXtoIHRnGxp1Nr9nT2RPkPnFHw+FKp0J7MQmeYnoBWA 5U39EkPeyDxLnscL4C1mjwNx+ESDN+IdHPFtFasZkDKKRbovWv2eK1tnxk1Tz9RsB1H3 QAEcM6q/b9q/sYfzhQzQ2EGmO8Xvs7mMeC+jpbj+ETnvMdjJ3kuv/CouQxEax8EoVPl9 otPTBX51CkKrm76UoxI2VQx3B+BDQ0ZQgKu1MBkx7YLSf4zUFiIYfOUsL8xP9wqPTi6d 8nhHLoWi5Ll+mb0E634r+z/2gvgZ8fHmzo5/7UaYcusid54bc2xzDvpfGCVcjdk6Kpqh hHEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=heXgMpXTNP+inze4shujDdQYQxvGUDut3Z0gFNZRVec=; b=dGvC3jz76YhIHgvwKS/neUQ4y9mKA2eQ9qxrDllY03ONjHGStijLDYL7tp89/i/BVP 3efAqeiC0JFpVFbtbos0ekEvGPaJmvZTFNXGGxkQUK/Urf+3bh2fQxX6YB1stiueveJx 0647GDpD4EVExZAsiIP/9QDbTlnz6gJCgA60igNjjOuN/CeWy98HYSe0mY1A5s7j4WQX eNoOt8UzMWN73DefvLEpfz0w/Cx8Et1l6xXDB2HDo0Z9ilkjlPGibZthHNxxM/+Lyyfy c9otg6oatuU1ZvJLTCyWDHo21/VyYGnKb9YSkRjIBvLBBuIwTgJ307/Zkx/Esxgn1ncL 8lmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fgg0M1Pa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q3-20020a6557c3000000b0046f58089605si13238515pgr.272.2022.11.15.12.28.38; Tue, 15 Nov 2022 12:28:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fgg0M1Pa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231142AbiKOUZe (ORCPT + 99 others); Tue, 15 Nov 2022 15:25:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbiKOUZd (ORCPT ); Tue, 15 Nov 2022 15:25:33 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FD796577; Tue, 15 Nov 2022 12:25:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E3FC2619FA; Tue, 15 Nov 2022 20:25:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4707AC433D6; Tue, 15 Nov 2022 20:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668543931; bh=wkeY+zmuuIfH0P91UWN754W6X7lV8EgxxsphFuXI3qQ=; h=Date:From:To:Cc:Subject:From; b=Fgg0M1Pa192/Avsm6D+UwDM5fJrY2sspV5S56Q+2trynAiKPqcStFT+abyT6XSc1/ a3x5kEAWQ+sZwqGN2K0FTFXyAZdYfUN6Mki0F8ZAudv4vZfDZ+u0gGMe6RDRJXWukL UrAyFqTp5Mc39jkIyvLQ72CN/beRH3tKjCTt+cTA7RMKzxEC6PaGr0wIHueFBRSjUV bV2vE5peSGuf1XnRLsrqSIftx4J3h+OftKuhb14g3jryyWGSZJotmApNd3daqKV3yh +OD4viYDiq4mM10gITPiTO7iDtLGMwdaEAt/kDTFf2CzRk2MjUQIQVGWg29SM34K7J 7Fj+EZ52eSMkA== Date: Tue, 15 Nov 2022 14:25:16 -0600 From: "Gustavo A. R. Silva" To: Anil Gurumurthy , Sudarsana Kalluru , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] scsi: bfa: Replace one-element array with flexible-array member Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749595334243402751?= X-GMAIL-MSGID: =?utf-8?q?1749595334243402751?= One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct fdmi_attr_s. Important to mention is that doing a build before/after this patch results in no binary output differences. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. Link: https://github.com/KSPP/linux/issues/209 Link: https://github.com/KSPP/linux/issues/79 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook --- drivers/scsi/bfa/bfa_fc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/bfa/bfa_fc.h b/drivers/scsi/bfa/bfa_fc.h index 0314e4b9e1fb..a12d693065ce 100644 --- a/drivers/scsi/bfa/bfa_fc.h +++ b/drivers/scsi/bfa/bfa_fc.h @@ -1548,7 +1548,7 @@ enum fdmi_port_attribute_type { struct fdmi_attr_s { __be16 type; __be16 len; - u8 value[1]; + u8 value[]; }; /*