* [PATCH] scsi: ipr: Replace 1-element arrays with flexible arrays
@ 2024-07-11 18:07 Kees Cook
2024-07-11 18:33 ` Gustavo A. R. Silva
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Kees Cook @ 2024-07-11 18:07 UTC (permalink / raw)
To: Brian King
Cc: Kees Cook, James E.J. Bottomley, Martin K. Petersen, linux-scsi,
linux-kernel, linux-hardening
Replace the deprecated[1] use of a 1-element arrays in
struct ipr_hostrcb_fabric_desc and struct ipr_hostrcb64_fabric_desc
with modern flexible arrays.
No binary differences are present after this conversion.
Link: https://github.com/KSPP/linux/issues/79 [1]
Signed-off-by: Kees Cook <kees@kernel.org>
---
Cc: Brian King <brking@us.ibm.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
---
drivers/scsi/ipr.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index c77d6ca1a210..b2b643c6dbbe 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -1030,7 +1030,7 @@ struct ipr_hostrcb_fabric_desc {
#define IPR_PATH_FAILED 0x03
__be16 num_entries;
- struct ipr_hostrcb_config_element elem[1];
+ struct ipr_hostrcb_config_element elem[];
}__attribute__((packed, aligned (4)));
struct ipr_hostrcb64_fabric_desc {
@@ -1044,7 +1044,7 @@ struct ipr_hostrcb64_fabric_desc {
u8 res_path[8];
u8 reserved3[6];
__be16 num_entries;
- struct ipr_hostrcb64_config_element elem[1];
+ struct ipr_hostrcb64_config_element elem[];
}__attribute__((packed, aligned (8)));
#define for_each_hrrq(hrrq, ioa_cfg) \
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] scsi: ipr: Replace 1-element arrays with flexible arrays
2024-07-11 18:07 [PATCH] scsi: ipr: Replace 1-element arrays with flexible arrays Kees Cook
@ 2024-07-11 18:33 ` Gustavo A. R. Silva
2024-08-03 1:30 ` Martin K. Petersen
2024-08-05 21:17 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2024-07-11 18:33 UTC (permalink / raw)
To: Kees Cook, Brian King
Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi,
linux-kernel, linux-hardening
On 11/07/24 12:07, Kees Cook wrote:
> Replace the deprecated[1] use of a 1-element arrays in
> struct ipr_hostrcb_fabric_desc and struct ipr_hostrcb64_fabric_desc
> with modern flexible arrays.
>
> No binary differences are present after this conversion.
>
> Link: https://github.com/KSPP/linux/issues/79 [1]
> Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Thanks
--
Gustavo
> ---
> Cc: Brian King <brking@us.ibm.com>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> Cc: linux-scsi@vger.kernel.org
> ---
> drivers/scsi/ipr.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
> index c77d6ca1a210..b2b643c6dbbe 100644
> --- a/drivers/scsi/ipr.h
> +++ b/drivers/scsi/ipr.h
> @@ -1030,7 +1030,7 @@ struct ipr_hostrcb_fabric_desc {
> #define IPR_PATH_FAILED 0x03
>
> __be16 num_entries;
> - struct ipr_hostrcb_config_element elem[1];
> + struct ipr_hostrcb_config_element elem[];
> }__attribute__((packed, aligned (4)));
>
> struct ipr_hostrcb64_fabric_desc {
> @@ -1044,7 +1044,7 @@ struct ipr_hostrcb64_fabric_desc {
> u8 res_path[8];
> u8 reserved3[6];
> __be16 num_entries;
> - struct ipr_hostrcb64_config_element elem[1];
> + struct ipr_hostrcb64_config_element elem[];
> }__attribute__((packed, aligned (8)));
>
> #define for_each_hrrq(hrrq, ioa_cfg) \
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] scsi: ipr: Replace 1-element arrays with flexible arrays
2024-07-11 18:07 [PATCH] scsi: ipr: Replace 1-element arrays with flexible arrays Kees Cook
2024-07-11 18:33 ` Gustavo A. R. Silva
@ 2024-08-03 1:30 ` Martin K. Petersen
2024-08-05 21:17 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2024-08-03 1:30 UTC (permalink / raw)
To: Kees Cook
Cc: Brian King, James E.J. Bottomley, Martin K. Petersen, linux-scsi,
linux-kernel, linux-hardening
Kees,
> Replace the deprecated[1] use of a 1-element arrays in struct
> ipr_hostrcb_fabric_desc and struct ipr_hostrcb64_fabric_desc with
> modern flexible arrays.
Applied to 6.12/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: ipr: Replace 1-element arrays with flexible arrays
2024-07-11 18:07 [PATCH] scsi: ipr: Replace 1-element arrays with flexible arrays Kees Cook
2024-07-11 18:33 ` Gustavo A. R. Silva
2024-08-03 1:30 ` Martin K. Petersen
@ 2024-08-05 21:17 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2024-08-05 21:17 UTC (permalink / raw)
To: Brian King, Kees Cook
Cc: Martin K . Petersen, James E.J. Bottomley, linux-scsi,
linux-kernel, linux-hardening
On Thu, 11 Jul 2024 11:07:06 -0700, Kees Cook wrote:
> Replace the deprecated[1] use of a 1-element arrays in
> struct ipr_hostrcb_fabric_desc and struct ipr_hostrcb64_fabric_desc
> with modern flexible arrays.
>
> No binary differences are present after this conversion.
>
>
> [...]
Applied to 6.12/scsi-queue, thanks!
[1/1] scsi: ipr: Replace 1-element arrays with flexible arrays
https://git.kernel.org/mkp/scsi/c/c72e13cf820b
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-08-05 21:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-11 18:07 [PATCH] scsi: ipr: Replace 1-element arrays with flexible arrays Kees Cook
2024-07-11 18:33 ` Gustavo A. R. Silva
2024-08-03 1:30 ` Martin K. Petersen
2024-08-05 21:17 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox