[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b09450f9-c42f-41f8-a2f6-eea3515eaa2f@embeddedor.com>
Date: Mon, 29 Apr 2024 13:50:46 -0600
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Kees Cook <keescook@...omium.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Marcel Holtmann <marcel@...tmann.org>,
Johan Hedberg <johan.hedberg@...il.com>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
linux-bluetooth@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2][next] Bluetooth: hci_conn, hci_sync: Use
__counted_by() in multiple structs and avoid -Wfamnae warnings
>> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
>> index fe23e862921d..c4c6b8810701 100644
>> --- a/include/net/bluetooth/hci.h
>> +++ b/include/net/bluetooth/hci.h
>> @@ -2026,7 +2026,7 @@ struct hci_cp_le_set_ext_adv_data {
>> __u8 operation;
>> __u8 frag_pref;
>> __u8 length;
>> - __u8 data[];
>> + __u8 data[] __counted_by(length);
>> } __packed;
>
> I noticed some of the other structs here aren't flexible arrays, so it
> made me go take a look at these ones. I see that the only user of struct
> hci_cp_le_set_ext_adv_data uses a fixed-size array:
>
> struct {
> struct hci_cp_le_set_ext_adv_data cp;
> u8 data[HCI_MAX_EXT_AD_LENGTH];
> } pdu;
>
> Let's just change this from a flex array to a fixed-size array?
mmh... not sure about this. It would basically mean reverting this commit:
c9ed0a707730 ("Bluetooth: Fix Set Extended (Scan Response) Data")
--
Gustavo
Powered by blists - more mailing lists