* [PATCH v2] ath6kl: replace one-element array with flexible-array member
@ 2023-08-04 4:55 Atul Raut
2023-08-04 5:15 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Atul Raut @ 2023-08-04 4:55 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, linux-kernel, linux-kernel-mentees
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@gmail.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[];
} __packed;
struct ath6kl_usb_ctrl_diag_cmd_read {
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] ath6kl: replace one-element array with flexible-array member
2023-08-04 4:55 [PATCH v2] ath6kl: replace one-element array with flexible-array member Atul Raut
@ 2023-08-04 5:15 ` Greg KH
2023-08-04 7:10 ` Kalle Valo
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2023-08-04 5:15 UTC (permalink / raw)
To: Atul Raut; +Cc: kvalo, linux-kernel-mentees, linux-wireless, linux-kernel
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@gmail.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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] ath6kl: replace one-element array with flexible-array member
2023-08-04 5:15 ` Greg KH
@ 2023-08-04 7:10 ` Kalle Valo
2023-08-04 9:30 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Kalle Valo @ 2023-08-04 7:10 UTC (permalink / raw)
To: Greg KH; +Cc: Atul Raut, linux-kernel-mentees, linux-wireless, linux-kernel
Greg KH <gregkh@linuxfoundation.org> writes:
> 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@gmail.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?
It's not, it's just padding. We both told this in v1:
https://patchwork.kernel.org/project/linux-wireless/patch/20230731012941.21875-1-rauji.raut@gmail.com/
> And you just changed the size of this structure, are you sure this is
> correct?
This patch is not correct.
Atul, ALWAYS include a changelog when submitting a new version. Please
carefully read our wiki link below before submitting new patches to
wireless.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] ath6kl: replace one-element array with flexible-array member
2023-08-04 7:10 ` Kalle Valo
@ 2023-08-04 9:30 ` Greg KH
2023-08-07 14:13 ` Jeff Johnson
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2023-08-04 9:30 UTC (permalink / raw)
To: Kalle Valo; +Cc: Atul Raut, linux-kernel-mentees, linux-wireless, linux-kernel
On Fri, Aug 04, 2023 at 10:10:37AM +0300, Kalle Valo wrote:
> Greg KH <gregkh@linuxfoundation.org> writes:
>
> > 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@gmail.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?
>
> It's not, it's just padding. We both told this in v1:
>
> https://patchwork.kernel.org/project/linux-wireless/patch/20230731012941.21875-1-rauji.raut@gmail.com/
Hey, I'm consistent, nice! :)
But Atul, that's not good to ignore our review comments. Usually that
ends up meaning that everyone will then just ignore your submissions,
generally a not-good resolution.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] ath6kl: replace one-element array with flexible-array member
2023-08-04 9:30 ` Greg KH
@ 2023-08-07 14:13 ` Jeff Johnson
2023-08-07 15:17 ` Atul Raut
2023-08-07 15:31 ` Atul Raut
0 siblings, 2 replies; 7+ messages in thread
From: Jeff Johnson @ 2023-08-07 14:13 UTC (permalink / raw)
To: Greg KH, Kalle Valo
Cc: Atul Raut, linux-kernel-mentees, linux-wireless, linux-kernel
On 8/4/2023 2:30 AM, Greg KH wrote:
> On Fri, Aug 04, 2023 at 10:10:37AM +0300, Kalle Valo wrote:
>> Greg KH <gregkh@linuxfoundation.org> writes:
>>
>>> 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@gmail.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?
>>
>> It's not, it's just padding. We both told this in v1:
>>
>> https://patchwork.kernel.org/project/linux-wireless/patch/20230731012941.21875-1-rauji.raut@gmail.com/
>
> Hey, I'm consistent, nice! :)
>
> But Atul, that's not good to ignore our review comments. Usually that
> ends up meaning that everyone will then just ignore your submissions,
> generally a not-good resolution.
>
> thanks,
>
> greg k-h
Since the 'pad' field is never directly accessed, suggest the author
respin this this to use simply:
__le32 _pad;
That will prevent others from trying to "fix" this actual one-element
array in the future.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] ath6kl: replace one-element array with flexible-array member
2023-08-07 14:13 ` Jeff Johnson
@ 2023-08-07 15:17 ` Atul Raut
2023-08-07 15:31 ` Atul Raut
1 sibling, 0 replies; 7+ messages in thread
From: Atul Raut @ 2023-08-07 15:17 UTC (permalink / raw)
To: Jeff Johnson
Cc: gregkh, kvalo, linux-kernel-mentees, linux-wireless, linux-kernel
[-- Attachment #1: I appreciate the comments. Will refrain from altering this or any other submitted patches, as advised. --]
[-- Type: text/plain, Size: 2091 bytes --]
On Mon, Aug 07, 2023 at 07:13:20AM -0700, Jeff Johnson wrote:
>On 8/4/2023 2:30 AM, Greg KH wrote:
>>On Fri, Aug 04, 2023 at 10:10:37AM +0300, Kalle Valo wrote:
>>>Greg KH <gregkh@linuxfoundation.org> writes:
>>>
>>>>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@gmail.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?
>>>
>>>It's not, it's just padding. We both told this in v1:
>>>
>>>https://patchwork.kernel.org/project/linux-wireless/patch/20230731012941.21875-1-rauji.raut@gmail.com/
>>
>>Hey, I'm consistent, nice! :)
>>
>>But Atul, that's not good to ignore our review comments. Usually that
>>ends up meaning that everyone will then just ignore your submissions,
>>generally a not-good resolution.
>>
>>thanks,
>>
>>greg k-h
>
>Since the 'pad' field is never directly accessed, suggest the author
>respin this this to use simply:
> __le32 _pad;
>
>That will prevent others from trying to "fix" this actual one-element
>array in the future.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] ath6kl: replace one-element array with flexible-array member
2023-08-07 14:13 ` Jeff Johnson
2023-08-07 15:17 ` Atul Raut
@ 2023-08-07 15:31 ` Atul Raut
1 sibling, 0 replies; 7+ messages in thread
From: Atul Raut @ 2023-08-07 15:31 UTC (permalink / raw)
To: Jeff Johnson, Greg KH, Kalle Valo
Cc: linux-kernel-mentees, linux-wireless, linux-kernel
Considering everyone's input/comments, will refrain from altering this or
other submitted patches, as advised.
-Atul
On 8/7/23 07:13, Jeff Johnson wrote:
> On 8/4/2023 2:30 AM, Greg KH wrote:
>> On Fri, Aug 04, 2023 at 10:10:37AM +0300, Kalle Valo wrote:
>>> Greg KH <gregkh@linuxfoundation.org> writes:
>>>
>>>> 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@gmail.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?
>>>
>>> It's not, it's just padding. We both told this in v1:
>>>
>>> https://patchwork.kernel.org/project/linux-wireless/patch/20230731012941.21875-1-rauji.raut@gmail.com/
>>>
>>
>> Hey, I'm consistent, nice! :)
>>
>> But Atul, that's not good to ignore our review comments. Usually that
>> ends up meaning that everyone will then just ignore your submissions,
>> generally a not-good resolution.
>>
>> thanks,
>>
>> greg k-h
>
> Since the 'pad' field is never directly accessed, suggest the author
> respin this this to use simply:
> __le32 _pad;
>
> That will prevent others from trying to "fix" this actual one-element
> array in the future.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-08-07 15:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-04 4:55 [PATCH v2] ath6kl: replace one-element array with flexible-array member Atul Raut
2023-08-04 5:15 ` Greg KH
2023-08-04 7:10 ` Kalle Valo
2023-08-04 9:30 ` Greg KH
2023-08-07 14:13 ` Jeff Johnson
2023-08-07 15:17 ` Atul Raut
2023-08-07 15:31 ` Atul Raut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox