From patchwork Wed Oct 2 09:44:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1991916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XJVKk5Jylz1xtq for ; Wed, 2 Oct 2024 19:45:30 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1svvv8-0006Xw-MQ; Wed, 02 Oct 2024 09:45:22 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1svvuu-0006N2-Q3 for kernel-team@lists.ubuntu.com; Wed, 02 Oct 2024 09:45:08 +0000 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 2C8F43F185 for ; Wed, 2 Oct 2024 09:45:08 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-37ccbb420a9so3310807f8f.3 for ; Wed, 02 Oct 2024 02:45:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727862306; x=1728467106; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R5V0bhXzJKRe4ukSpqohjwbXhRyWZJKcQtz1uGmyhWw=; b=Z3uzxLDuqmAKaHB9EEcXqsd91c/q+2krxzsxjTaNK64CbpX12/jecu8IOvMgl56Iga wSWvtWUyk+JN0VVEZt7+FzZnrqu+wJj75y2GSBWOShdpvzeQqACkruhAc0l/gnFSCj20 4YcnNMu9KalWtGKroLTJ+cq6FwgylUvr4LI49GqRMX5UMZeWEpXJHRG1f6W/4Te5zGXM 7D/sqD29TOKSFn6N3oUdQyjwjsEp5hoBzeQauPSBsKKuqzm6NaZbu9xQ735qPNDmcbSi Bx9nSzqZDqWR+xwEsKRkF36VW+0GSR6848Qz3vRxRHJXnKrow8J9Zp0dWEvtKKkvl3C3 haUA== X-Gm-Message-State: AOJu0YwZAOanj1VpBOQgR5zbkoh2zBhdZOzDN9iPZHWm9/9pM/PFej25 KVbzFlc/danCa1wKH2xJljaI23WDOrkzn2WhV8cEWSshqQeKXBwsZ4GKRrJ1Ese6gBaLa2PtFNT D+XQLIQS8qbvgIBS1Fbb9fnCkbtmNlVprDN+qcnAnZzVcRbzNK41yDGf3q98kzSl6pRPMDbxm0l TIJLNyKKq4Fg== X-Received: by 2002:a5d:5c85:0:b0:37d:238:5a84 with SMTP id ffacd0b85a97d-37d02385acamr182795f8f.15.1727862306516; Wed, 02 Oct 2024 02:45:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxEh14PnVdqHzDsO+W6af9+lWCj141eAWA/aZyGCpX6AvMw3KjHNEZ6+nwJSPhoo17Ubh64Q== X-Received: by 2002:a5d:5c85:0:b0:37d:238:5a84 with SMTP id ffacd0b85a97d-37d02385acamr182782f8f.15.1727862306120; Wed, 02 Oct 2024 02:45:06 -0700 (PDT) Received: from localhost ([81.221.247.52]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd572fa2fsm13478443f8f.68.2024.10.02.02.45.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 02:45:05 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][N][PATCH 4/6] scsi: aacraid: struct aac_ciss_phys_luns_resp: Replace 1-element array with flexible array Date: Wed, 2 Oct 2024 11:44:55 +0200 Message-ID: <20241002094457.1777904-5-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241002094457.1777904-1-juerg.haefliger@canonical.com> References: <20241002094457.1777904-1-juerg.haefliger@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kees Cook BugLink: https://bugs.launchpad.net/bugs/2078038 Replace the deprecated[1] use of a 1-element array in struct aac_ciss_phys_luns_resp with a modern flexible array. No binary differences are present after this conversion. Link: https://github.com/KSPP/linux/issues/79 [1] Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20240711175055.work.928-kees@kernel.org Reviewed-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen (cherry picked from commit 2e35b43bc9a82fde4e7aebe5d8331e1158374d5c) Signed-off-by: Juerg Haefliger --- drivers/scsi/aacraid/aachba.c | 2 +- drivers/scsi/aacraid/aacraid.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 70e1cac1975e..0053188dd986 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1833,7 +1833,7 @@ static int aac_get_safw_ciss_luns(struct aac_dev *dev) struct aac_ciss_phys_luns_resp *phys_luns; datasize = sizeof(struct aac_ciss_phys_luns_resp) + - (AAC_MAX_TARGETS - 1) * sizeof(struct _ciss_lun); + AAC_MAX_TARGETS * sizeof(struct _ciss_lun); phys_luns = kmalloc(datasize, GFP_KERNEL); if (phys_luns == NULL) goto out; diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 659e393c1033..6f0417f6f8a1 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -322,7 +322,7 @@ struct aac_ciss_phys_luns_resp { u8 level3[2]; u8 level2[2]; u8 node_ident[16]; /* phys. node identifier */ - } lun[1]; /* List of phys. devices */ + } lun[]; /* List of phys. devices */ }; /*