Message ID | cover.1687974498.git.gustavoars@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9123538vqr; Wed, 28 Jun 2023 11:23:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6AZjsysJoo7NwIVIx6XEqBabdMZTaEWAXthUzJQY5EO1eeXhZ+HNbDDTxcNiIQ9raJ0c5H X-Received: by 2002:a17:906:77ca:b0:989:1ed3:d010 with SMTP id m10-20020a17090677ca00b009891ed3d010mr20017586ejn.2.1687976619339; Wed, 28 Jun 2023 11:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687976619; cv=none; d=google.com; s=arc-20160816; b=q7Xwn1G3/YR30LJJRbBpJDsmD4UjQ4Ti6mEjpSNX6pQKivaPF8ZsMmxsb19Tm9vHYr Gv25RS+6zeXP6kmiG0Katl5RSGDmYmevpkKpAfZ/Vt+Nq1LJ3mSMgr+HhhBet6/hZPjH JBXDjMCE1fk71OdBn9gkerUG7wqygi3PLHTNBG7JyfA0NLLh/uBY262gwsRmli6wd3Sv I9xh6b34JIVf8XeyD2ZfadQLai6OxnRN4M50U0G0f1n4/Ud2p1VBirjjHg6568B27j2b /Ul71KnZ+U7jBlVccnmJbBBc4G7HxN7k/aYJYCAGfCOBZ7sp6KpcOvLBO21L7Ul2Bcl7 boqg== 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=yrKocE1K6AGEDpXbr0CLgZkd4URgsKU+XoXga1e3Avg=; fh=2ET6nL/wlcZ4gumDTTusm6ilw662ytnheFDwMTsLDv4=; b=vLBXT/V0oUxDMXvY01kciWOCvPHFL4MqxvjKFfuiubz9489shz6foupzFm552WHBOS dPMBExP/flrgxiNjSYQO6KYtAtI1R4q+Wn6g0GDR94Gldpug4r/oGcR0AI4Zc4o6Qxy4 co/OFVgTkm9rPrAbntmKJwi9Dw3v45IpHALycHELgR/lvQHANEm1+8nBqrlP2a231myb 56LM22d4+Zy3g9meu+AUIlQCHhC7hW1Tly655D/OQxoT6nAiiOmxJnUc+Tqc2+10ffME K2zl7CIRTdchCvZ6OnUQJvPreripfbnOGY99qKzEwHXVUwufwrIObGtiLoCUkplNI3Jv Q81w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bARS9dA+; 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 e17-20020a170906081100b0096f53f61cc8si5832550ejd.967.2023.06.28.11.23.15; Wed, 28 Jun 2023 11:23:39 -0700 (PDT) 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=bARS9dA+; 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 S229941AbjF1Rwz (ORCPT <rfc822;ivan.orlov0322@gmail.com> + 99 others); Wed, 28 Jun 2023 13:52:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbjF1Rwx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 28 Jun 2023 13:52:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 463A1D8; Wed, 28 Jun 2023 10:52:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D06856141D; Wed, 28 Jun 2023 17:52:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 630D1C433C0; Wed, 28 Jun 2023 17:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687974771; bh=WHH0gFQMkPph60tANmhSTj+mN360nHRsNJom4Ty2xHE=; h=Date:From:To:Cc:Subject:From; b=bARS9dA+p26lSNodIZlHUDFp8apSwmr2GmyMrs/EHADL3SphnlhZXr2D02aoUyg7D l0EMwuRwMMOxODqvPH1QW/eqvo0qggWzfTDzkbSVrLjegS07/KSRMxpFC7suVZmK/R thieWf4myTK8qR2YqhO5Xn7AyRr1zk73jqWR1ZMpdu3/GDQA1Zqqyk4SRJXSk9u1Vr tQg2z284osfJ5h4V/5iEHK4OGNbmveou/sljllSZFdBYDjPzPvW0c3i4E/cDbhE5iM tOWLqaGDMftlk6zJvgD0LPEQAtUQ2BBLJQbL/7srqfzXg2D/G1nvkIDIo7x+RU2PQP H+Ot87EbSGdIA== Date: Wed, 28 Jun 2023 11:53:45 -0600 From: "Gustavo A. R. Silva" <gustavoars@kernel.org> To: aacraid@microsemi.com, "James E.J. Bottomley" <jejb@linux.ibm.com>, "Martin K. Petersen" <martin.petersen@oracle.com> Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>, "Gustavo A. R. Silva" <gustavoars@kernel.org>, linux-hardening@vger.kernel.org Subject: [PATCH 00/10][next] scsi: aacraid: Replace one-element arrays with flexible-array members Message-ID: <cover.1687974498.git.gustavoars@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769971771606969501?= X-GMAIL-MSGID: =?utf-8?q?1769971771606969501?= |
Series |
scsi: aacraid: Replace one-element arrays with flexible-array members
|
|
Message
Gustavo A. R. Silva
June 28, 2023, 5:53 p.m. UTC
This series aims to replace one-element arrays with flexible-array members in multiple structures in drivers/scsi/aacraid/aacraid.h. This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). These issues were found with the help of Coccinelle and audited and fixed, manually. Link: https://github.com/KSPP/linux/issues/79 Gustavo A. R. Silva (10): scsi: aacraid: Replace one-element array with flexible-array member scsi: aacraid: Use struct_size() helper in aac_get_safw_ciss_luns() scsi: aacraid: Replace one-element array with flexible-array member in struct aac_aifcmd scsi: aacraid: Replace one-element array with flexible-array member in struct user_sgmapraw scsi: aacraid: Replace one-element array with flexible-array member in struct sgmapraw scsi: aacraid: Use struct_size() helper in code related to struct sgmapraw scsi: aacraid: Replace one-element array with flexible-array member in struct user_sgmap64 scsi: aacraid: Replace one-element array with flexible-array member in struct sgmap scsi: aacraid: Replace one-element array with flexible-array member in struct sgmap64 scsi: aacraid: Replace one-element array with flexible-array member in struct user_sgmap drivers/scsi/aacraid/aachba.c | 42 +++++++++++++-------------------- drivers/scsi/aacraid/aacraid.h | 16 ++++++------- drivers/scsi/aacraid/commctrl.c | 6 ++--- drivers/scsi/aacraid/comminit.c | 3 +-- 4 files changed, 28 insertions(+), 39 deletions(-)
Comments
On Wed, Jun 28, 2023 at 11:53:45AM -0600, Gustavo A. R. Silva wrote: > This series aims to replace one-element arrays with flexible-array > members in multiple structures in drivers/scsi/aacraid/aacraid.h. > > This helps with the ongoing efforts to globally enable -Warray-bounds > and get us closer to being able to tighten the FORTIFY_SOURCE routines > on memcpy(). > > These issues were found with the help of Coccinelle and audited and fixed, > manually. > > Link: https://github.com/KSPP/linux/issues/79 > > Gustavo A. R. Silva (10): > scsi: aacraid: Replace one-element array with flexible-array member > scsi: aacraid: Use struct_size() helper in aac_get_safw_ciss_luns() > scsi: aacraid: Replace one-element array with flexible-array member in > struct aac_aifcmd > scsi: aacraid: Replace one-element array with flexible-array member in > struct user_sgmapraw > scsi: aacraid: Replace one-element array with flexible-array member in > struct sgmapraw > scsi: aacraid: Use struct_size() helper in code related to struct > sgmapraw > scsi: aacraid: Replace one-element array with flexible-array member in > struct user_sgmap64 > scsi: aacraid: Replace one-element array with flexible-array member in > struct sgmap > scsi: aacraid: Replace one-element array with flexible-array member in > struct sgmap64 > scsi: aacraid: Replace one-element array with flexible-array member in > struct user_sgmap I'd like to reorganize this series so that all the conversions are first, and then struct_size() additions are at the end. That way, if desired, the conversions can land as fixes to turn the Clang builds green again.
On 6/28/23 14:08, Kees Cook wrote: > On Wed, Jun 28, 2023 at 11:53:45AM -0600, Gustavo A. R. Silva wrote: >> This series aims to replace one-element arrays with flexible-array >> members in multiple structures in drivers/scsi/aacraid/aacraid.h. >> >> This helps with the ongoing efforts to globally enable -Warray-bounds >> and get us closer to being able to tighten the FORTIFY_SOURCE routines >> on memcpy(). >> >> These issues were found with the help of Coccinelle and audited and fixed, >> manually. >> >> Link: https://github.com/KSPP/linux/issues/79 >> >> Gustavo A. R. Silva (10): >> scsi: aacraid: Replace one-element array with flexible-array member >> scsi: aacraid: Use struct_size() helper in aac_get_safw_ciss_luns() >> scsi: aacraid: Replace one-element array with flexible-array member in >> struct aac_aifcmd >> scsi: aacraid: Replace one-element array with flexible-array member in >> struct user_sgmapraw >> scsi: aacraid: Replace one-element array with flexible-array member in >> struct sgmapraw >> scsi: aacraid: Use struct_size() helper in code related to struct >> sgmapraw >> scsi: aacraid: Replace one-element array with flexible-array member in >> struct user_sgmap64 >> scsi: aacraid: Replace one-element array with flexible-array member in >> struct sgmap >> scsi: aacraid: Replace one-element array with flexible-array member in >> struct sgmap64 >> scsi: aacraid: Replace one-element array with flexible-array member in >> struct user_sgmap > > I'd like to reorganize this series so that all the conversions are > first, and then struct_size() additions are at the end. That way, if > desired, the conversions can land as fixes to turn the Clang builds > green again. > OK; I can make that happen. :) -- Gustavo