Message ID | 20230511220957.never.919-kees@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4702309vqo; Thu, 11 May 2023 15:18:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ44KlqqyEePrbwCPaBepgNBZjzwxnaSxsLI2aT+6I7NCN9QOdk/WP76r5pcAITxRau+pXQX X-Received: by 2002:a05:6a20:1445:b0:f3:b7:b10a with SMTP id a5-20020a056a20144500b000f300b7b10amr28634717pzi.15.1683843487189; Thu, 11 May 2023 15:18:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683843487; cv=none; d=google.com; s=arc-20160816; b=QcOctDFSK7h5q+gkEq+GmBfb0wnNL9kgrztRpe+AHVmyxOJAxLwHOj5oG1++7V4Gg7 c1/Hm94qoOHqMkuPdfv1q62P4FjEYnP2wtcD9tOP8Za34Klg00885uguA6szx9iaXCWW vdMo4hlUsFFg6FrNnokKdHL9HBi8E7Lx8d8a5gf6kPywNbkuoBtUPjKrxEo40tFY55Q6 oKrxKUz9CAbaks31B9x4uSqZBxYj6xeQKiugndRxyze9F9+qe4BJgZuUNOQ20gfhb8Ia VIBZzF/8xiaTTvpLm+I862tSMeXloeVzPLqGMz1EBPaKUaTZFhwePtc40NDLA9JygZtz egMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ooac5tL+mseyTN9L+x1m+1D+z3zZPNRSrEyDHL8CuWc=; b=UnL1dhJIwBDlyhAxfDNhy1e57DxPsTB3Zd75wOvDGmohG3fOTjoErq2GcAkwhWejmv Cy3F0KJUPzvL91a2pKh4gw48/wgVAl4HF7n3NO3RzYhDom/P7tdkzTCVCMTN6gB5IdGO lFdgdSs3ymF4y8cVmAWpxrnaPACjD4eO/vledqTPHGPV4617tFYdECZ67FDpTr2NrKWZ XKf8pwuB0vEmidtyQyxghk+Uajqn8/dPUtPgh80rBaRNTlk+Ue7poMssiraT+Ir3aAqi ru+gvFv7D1s0IZVy1Mz8DMPQkur06c77AC4pWEWp0vfLigZjU0DRIEUWSdpjzHUUCyFY KFZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="JXR/xm0E"; 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=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a654389000000b00513af1fa0b5si7160267pgp.797.2023.05.11.15.17.50; Thu, 11 May 2023 15:18:07 -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=@chromium.org header.s=google header.b="JXR/xm0E"; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238953AbjEKWKO (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Thu, 11 May 2023 18:10:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238984AbjEKWKL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 11 May 2023 18:10:11 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 577247AB4 for <linux-kernel@vger.kernel.org>; Thu, 11 May 2023 15:10:03 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-643990c5373so9295358b3a.1 for <linux-kernel@vger.kernel.org>; Thu, 11 May 2023 15:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1683843003; x=1686435003; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ooac5tL+mseyTN9L+x1m+1D+z3zZPNRSrEyDHL8CuWc=; b=JXR/xm0E+UUFmWf1wRMZgI6VaUWPK5W5tDN0vIDM2B0+aOQUWkZiPgoMyBO8V6cyke HPakTwy7CgGnYSqHxcjTXah9Qt1GrRy+PSwbmabFLI+1TM111+Slg9bRn3Yhxy1XMF2z G0R4D24TLDlxpvCnb1z6VM2qFUEpZO95MCunk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683843003; x=1686435003; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ooac5tL+mseyTN9L+x1m+1D+z3zZPNRSrEyDHL8CuWc=; b=B88m9G2IHHbcwODsqFYMA2B9p5Sp9IRcclWVSB3gpK/rNBCxfQPLwQx8I94yAJHquL R1Yxes96Zy+UjYwtDUcNKs1E+J6ZF0glyJQwzpPUEBNy9x5qHinnnW1ztvw2Mh5Z+S+z PO9KGZnzRIkDu3h/JzKaepCbWKN2rWBQsu3rxgtwzf9IWiZZIsUtRkCY1Bf+6B16yROY c+3CUKXYZYKAMlOpUsGLSmJAT5YNTTNRZouhe5aOXdZEtDH+Cng0ZrIMDhToAh2dhlSI 46/Eq4FSg+Cf1KpranGMyqha4VnCQRqj4/JXppXt/hGyjmyCRYbAO2fVfpCKUqneCc/J RwWQ== X-Gm-Message-State: AC+VfDyfXeEOP6QPjpSYigWBJ0yDKoX5HkL/H/bOW90xXavjColFvNXk 8qf6ywI4LolkVJLKOvFyrqKY3Q== X-Received: by 2002:a05:6a00:8c5:b0:647:4dee:62a4 with SMTP id s5-20020a056a0008c500b006474dee62a4mr14029138pfu.34.1683843002834; Thu, 11 May 2023 15:10:02 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id x20-20020aa793b4000000b0063d2bb0d107sm5803828pff.64.2023.05.11.15.10.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 15:10:02 -0700 (PDT) From: Kees Cook <keescook@chromium.org> To: Kashyap Desai <kashyap.desai@broadcom.com> Cc: Kees Cook <keescook@chromium.org>, Sumit Saxena <sumit.saxena@broadcom.com>, Shivasharan S <shivasharan.srikanteshwara@broadcom.com>, "James E.J. Bottomley" <jejb@linux.ibm.com>, "Martin K. Petersen" <martin.petersen@oracle.com>, "Gustavo A . R . Silva" <gustavoars@kernel.org>, megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH] scsi: megaraid_sas: Convert union megasas_sgl to flex-arrays Date: Thu, 11 May 2023 15:10:00 -0700 Message-Id: <20230511220957.never.919-kees@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1525; h=from:subject:message-id; bh=LtOldvtOS7BP2znGslCZolBglC52ivG2kUh4xsBr7gw=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBkXWe4srTr9P0R2BfZ0l3zZwW7FDKgoLhejYjQrjIf E1DhPjSJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZF1nuAAKCRCJcvTf3G3AJq5ID/ 0Y3B0fKlu1yboIdHGvoWREvQu7tbf7nV5Z41kc6P+Ojp9TNpFBIlG96li90StqxGhYgOIEkFSYH3l4 Wi2Yp/ZCkyNU+sYXJzElh/YaIzN1A6Lr4VmwQiuQaNPZImUSXDAK50ZtSe/bQOQA8dOhIlYn5UmsRX LT/qVO8M6go9nbw95DXaRuzKNy5quQ01yWS0WCZX6lfWOA3njEY4GdoIZctuxniV+tIbHQv4IXVwIp +fq1rperKy9ZE+7FnEBZ1MmQBk3XLJsk4eaO+QPEUr2g4z5U6VojjqnHwEqqcvixz0YGxl/iBe8Xap eIFLGGwEXeTl947aab86Qm1AnzMqCVKj1Wtln0muf7DGwuNOJkw6WFOLtIUFdur7GnWp7gyLDC939M fXuAQhCxIuWbzYU1hV3IjUs/PA4UufdBvofOg2+r9bje5PCZrSUXOT4XQkHwZC2OSrWva/mIQ5axn0 PDQA2r5xZuXYuDrgLookOhX0CfYleymhaYpFKZovIrPbBOb4S1WcHe/12vLSzMwfA4673xs9l8yATc e9gydMjqmpJ5+JfaKDyr8bUWxtR6omvsi0Z+YxP0HJSwm5MkHvpRXwi9h/Jg8M4LI3CJD0t5JonWy/ jLrcHchurIWO129uc/Vz5ExJ0UILUdacwQRf9o89nhNKx5C8TvKolC8Ep7Jg== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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?1765637868349735381?= X-GMAIL-MSGID: =?utf-8?q?1765637868349735381?= |
Series |
scsi: megaraid_sas: Convert union megasas_sgl to flex-arrays
|
|
Commit Message
Kees Cook
May 11, 2023, 10:10 p.m. UTC
In the ongoing effort to replace all fake flexible arrays with true
flexible arrays, replace the sge32, sge64, and sge_skinny members of
union megasas_sgl with true flexible arrays. No binary differences are
seen after this change; sizes were already being manually calculated
using the member struct sizes directly.
Cc: Kashyap Desai <kashyap.desai@broadcom.com>
Cc: Sumit Saxena <sumit.saxena@broadcom.com>
Cc: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
Cc: megaraidlinux.pdl@broadcom.com
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
drivers/scsi/megaraid/megaraid_sas.h | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
Comments
Kees, > In the ongoing effort to replace all fake flexible arrays with true > flexible arrays, replace the sge32, sge64, and sge_skinny members of > union megasas_sgl with true flexible arrays. No binary differences are > seen after this change; sizes were already being manually calculated > using the member struct sizes directly. Applied to 6.5/scsi-staging, thanks!
On Thu, 11 May 2023 15:10:00 -0700, Kees Cook wrote: > In the ongoing effort to replace all fake flexible arrays with true > flexible arrays, replace the sge32, sge64, and sge_skinny members of > union megasas_sgl with true flexible arrays. No binary differences are > seen after this change; sizes were already being manually calculated > using the member struct sizes directly. > > > [...] Applied to 6.5/scsi-queue, thanks! [1/1] scsi: megaraid_sas: Convert union megasas_sgl to flex-arrays https://git.kernel.org/mkp/scsi/c/aa67380056a4
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 63bac3684c19..3554f6b07727 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1722,11 +1722,9 @@ struct megasas_sge_skinny { } __packed; union megasas_sgl { - - struct megasas_sge32 sge32[1]; - struct megasas_sge64 sge64[1]; - struct megasas_sge_skinny sge_skinny[1]; - + DECLARE_FLEX_ARRAY(struct megasas_sge32, sge32); + DECLARE_FLEX_ARRAY(struct megasas_sge64, sge64); + DECLARE_FLEX_ARRAY(struct megasas_sge_skinny, sge_skinny); } __attribute__ ((packed)); struct megasas_header {