lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 4 Aug 2023 07:15:43 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Atul Raut <rauji.raut@...il.com>
Cc:     kvalo@...nel.org, linux-kernel-mentees@...ts.linuxfoundation.org,
        linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] ath6kl: replace one-element array with flexible-array
 member

On Thu, Aug 03, 2023 at 09:55:54PM -0700, Atul Raut wrote:
> One-element arrays are no longer relevant, and their
> place has been taken by flexible array members thus,
> use a flexible-array member to replace the one-element
> array in struct ath6kl_usb_ctrl_diag_cmd_write
> 
> This fixes warnings such as:
> ./drivers/net/wireless/ath/ath6kl/usb.c:109:8-12: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)
> 
> Signed-off-by: Atul Raut <rauji.raut@...il.com>
> ---
>  drivers/net/wireless/ath/ath6kl/usb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
> index 5220809841a6..c8ecc9e85897 100644
> --- a/drivers/net/wireless/ath/ath6kl/usb.c
> +++ b/drivers/net/wireless/ath/ath6kl/usb.c
> @@ -106,7 +106,7 @@ struct ath6kl_usb_ctrl_diag_cmd_write {
>  	__le32 cmd;
>  	__le32 address;
>  	__le32 value;
> -	__le32 _pad[1];
> +	__le32 _pad[];

Are you sure this is actually a variable length array?

And you just changed the size of this structure, are you sure this is
correct?

There have been lots of work on this type of thing in the past on the
hardening mailing list, I suggest you work there with the developers to
see if this is even a valid change first.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ