Re: [PATCH v2] wifi: nl80211: fix bounds checker error in nl80211_parse_sched_scan

2024-11-05 Thread Kalle Valo
Jeff Johnson writes: > On 10/29/2024 6:22 AM, Aleksei Vetrov wrote: >> The channels array in the cfg80211_scan_request has a __counted_by >> attribute attached to it, which points to the n_channels variable. This >> attribute is used in bounds checking, and if it is not set before the >> array is

Re: [PATCH v2 1/2] wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_config_scan()

2024-10-17 Thread Kalle Valo
Alper Nebi Yasak wrote: > Replace one-element array with a flexible-array member in `struct > mwifiex_ie_types_wildcard_ssid_params` to fix the following warning > on a MT8173 Chromebook (mt8173-elm-hana): > > [ 356.775250] [ cut here ] > [ 356.784543] memcpy: detected

Re: [PATCH][next] wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_cmd_802_11_scan_ext()

2024-09-09 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Replace one-element array with a flexible-array member in > `struct host_cmd_ds_802_11_scan_ext`. > > With this, fix the following warning: > > elo 16 17:51:58 surfacebook kernel: [ cut here ] > elo 16 17:51:58 surfacebook kernel: memcpy: d

Re: [PATCH] wifi: wireless: fix two more possible UBSAN-detected off-by-one errors

2024-09-09 Thread Kalle Valo
Dmitry Antipov writes: > Although not reproduced in practice, these two cases may be > considered by UBSAN as off-by-one errors. So fix them in the > same way as in commit a26a5107bc52 ("wifi: cfg80211: fix UBSAN > noise in cfg80211_wext_siwscan()"). > > Fixes: 807f8a8c3004 ("cfg80211/nl80211: ad

Re: [PATCH][next] wifi: ath12k: Avoid -Wflex-array-member-not-at-end warnings

2024-09-05 Thread Kalle Valo
> [-Wflex-array-member-not-at-end] > drivers/net/wireless/ath/ath12k/dp.h:1499:24: warning: structure containing a > flexible array member is not at the end of another structure > [-Wflex-array-member-not-at-end] > > Signed-off-by: Gustavo A. R. Silva > Signed-off-b

Re: [PATCH][next] wifi: ath11k: Avoid -Wflex-array-member-not-at-end warnings

2024-09-05 Thread Kalle Valo
cture containing a > flexible array member is not at the end of another structure > [-Wflex-array-member-not-at-end] > > Signed-off-by: Gustavo A. R. Silva > Acked-by: Jeff Johnson > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 820a

Re: [PATCH][next] wifi: ath12k: Avoid -Wflex-array-member-not-at-end warnings

2024-08-22 Thread Kalle Valo
> [-Wflex-array-member-not-at-end] > drivers/net/wireless/ath/ath12k/dp.h:1499:24: warning: structure containing a > flexible array member is not at the end of another structure > [-Wflex-array-member-not-at-end] > > Signed-off-by: Gustavo A. R. Silva > Signed-off-by: K

Re: [PATCH][next] wifi: ath11k: Avoid -Wflex-array-member-not-at-end warnings

2024-08-22 Thread Kalle Valo
Jeff Johnson writes: > On 8/9/2024 9:20 AM, Gustavo A. R. Silva wrote: > >> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are >> getting ready to enable it, globally. >> >> Move the conflicting declaration to the end of the structure. Notice >> that `struct ieee80211_chanctx_co

Re: [PATCH][next] wifi: iwlegacy: Avoid multiple -Wflex-array-member-not-at-end warnings

2024-08-22 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > -Wflex-array-member-not-at-end was introduced in GCC-14, and we are > getting ready to enable it, globally. > > So, in order to avoid ending up with a flexible-array member in the > middle of multiple other structs, we use the `__struct_group()` > helper to create

Re: [PATCH][next] wifi: mwl8k: Use static_assert() to check struct sizes

2024-08-13 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Commit 5c4250092fad ("wifi: mwl8k: Avoid -Wflex-array-member-not-at-end > warnings") introduced tagged `struct mwl8k_cmd_pkt_hdr`. We want to > ensure that when new members need to be added to the flexible structure, > they are always included within this tagged str

Re: [next] wifi: ipw2x00: libipw: Avoid -Wflex-array-member-not-at-end warnings

2024-08-10 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > -Wflex-array-member-not-at-end was introduced in GCC-14, and we are > getting ready to enable it, globally. > > So, in order to avoid ending up with a flexible-array member in the > middle of multiple other structs, we use the `__struct_group()` > helper to create

Re: [1/2] wifi: at76c50x: use sizeof(*pointer) instead of sizeof(type)

2024-06-12 Thread Kalle Valo
Erick Archer wrote: > It is preferred to use sizeof(*pointer) instead of sizeof(type) > due to the type of the variable can change and one needs not > change the former (unlike the latter). This patch has no effect > on runtime behavior. > > At the same time remove some redundant NULL initializa

Re: [PATCH v3] wifi: mac80211: Avoid address calculations via out of bounds array indexing

2024-06-06 Thread Kalle Valo
Kenton Groombridge writes: > req->n_channels must be set before req->channels[] can be used. > > This patch fixes one of the issues encountered in [1]. > > [ 83.964252] [ cut here ] > [ 83.964255] UBSAN: array-index-out-of-bounds in net/mac80211/scan.c:364:4 > [ 83.9

Re: [PATCH v2] wifi: brcm80211: use sizeof(*pointer) instead of sizeof(type)

2024-06-01 Thread Kalle Valo
Erick Archer wrote: > It is preferred to use sizeof(*pointer) instead of sizeof(type) > due to the type of the variable can change and one needs not > change the former (unlike the latter). This patch has no effect > on runtime behavior. > > At the same time remove some redundant NULL initializa

Re: [PATCH v2][next] wifi: wil6210: wmi: Use __counted_by() in struct wmi_set_link_monitor_cmd and avoid -Wfamnae warning

2024-04-29 Thread Kalle Valo
Kees Cook writes: >> >> > I was just walking through our patch tracker and noticed that I don't >> >> > see this patch include in -next yet (as of next-20240429). Is there a >> >> > flush of the ath-next queue planned soon? Or did I miss some change? >> >> >> >> Yeah, wireless-next was pulled la

Re: [PATCH v2][next] wifi: wil6210: wmi: Use __counted_by() in struct wmi_set_link_monitor_cmd and avoid -Wfamnae warning

2024-04-29 Thread Kalle Valo
Kees Cook writes: > On Mon, Apr 29, 2024 at 08:25:56PM +0300, Kalle Valo wrote: > >> Kees Cook writes: >> >> > On Thu, Apr 04, 2024 at 10:12:28AM +, Kalle Valo wrote: >> > >> >> "Gustavo A. R. Silva" wrote: >> >>

Re: [PATCH v2][next] wifi: wil6210: wmi: Use __counted_by() in struct wmi_set_link_monitor_cmd and avoid -Wfamnae warning

2024-04-29 Thread Kalle Valo
Kees Cook writes: > On Thu, Apr 04, 2024 at 10:12:28AM +0000, Kalle Valo wrote: > >> "Gustavo A. R. Silva" wrote: >> >> > Prepare for the coming implementation by GCC and Clang of the >> > __counted_by attribute. Flexible array members annotated

Re: [PATCH v2][next] wifi: wil6210: wmi: Use __counted_by() in struct wmi_set_link_monitor_cmd and avoid -Wfamnae warning

2024-04-04 Thread Kalle Valo
t the end of another structure > [-Wflex-array-member-not-at-end] > > Link: https://github.com/KSPP/linux/issues/202 > Signed-off-by: Gustavo A. R. Silva > Reviewed-by: Jeff Johnson > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. cbb0697e0ded

Re: [PATCH v2][next] wifi: wil6210: cfg80211: Use __counted_by() in struct wmi_start_scan_cmd and avoid some -Wfamnae warnings

2024-04-04 Thread Kalle Valo
s not at the end of another structure > [-Wflex-array-member-not-at-end] > > Link: https://github.com/KSPP/linux/issues/202 > Signed-off-by: Gustavo A. R. Silva > Reviewed-by: Jeff Johnson > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 34c34c2

Re: [PATCH 1/2] [RESEND] wifi: carl9170: re-fix fortified-memset warning

2024-04-04 Thread Kalle Valo
wo members does address the warning though. > > Fixes: fb5f6a0e8063b ("mac80211: Use memset_after() to clear tx status") > Link: https://lore.kernel.org/lkml/20230623152443.2296825-1-a...@kernel.org/ > Signed-off-by: Arnd Bergmann > Reviewed-by: Kees Cook > Acked-by

Re: [PATCH][next] wifi: mwl8k: Avoid -Wflex-array-member-not-at-end warnings

2024-03-28 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting > ready to enable it globally. > > There is currently an object (`header`), at the beginning of multiple > structures, that contains a flexible structure (`struct mwl8k_cmd_pkt`), > for example:

Re: [PATCH][next] wifi: ti: Avoid a hundred -Wflex-array-member-not-at-end warnings

2024-03-28 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting > ready to enable it globally. > > Remove unused flexible-array members in multiple structures, and fix > a hundred -Wflex-array-member-not-at-end warnings[1] in > drivers/wireless/ti/ > > Link

Re: [PATCH][next] wifi: wil6210: Annotate struct wmi_set_link_monitor_cmd with __counted_by()

2024-03-28 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for > array indexing) and CONFIG_FORTIFY_SOURCE (

Re: [PATCH][next] wifi: cfg80211: Use __counted_by() in struct wmi_start_scan_cmd and avoid -Wfamnae warning

2024-03-27 Thread Kalle Valo
"Gustavo A. R. Silva" writes: > Prepare for the coming implementation by GCC and Clang of the > __counted_by attribute. Flexible array members annotated with > __counted_by can have their accesses bounds-checked at run-time > via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE

Re: [PATCH][next] wifi: brcmfmac: fweh: Fix boot crash on Raspberry Pi 4

2024-02-27 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Fix boot crash on Raspberry Pi by moving the update to `event->datalen` > before data is copied into flexible-array member `data` via `memcpy()`. > > Flexible-array member `data` was annotated with `__counted_by(datalen)` > in commit 62d19b358088 ("wifi: brcmfmac:

Re: [PATCH][next] wifi: brcmfmac: fweh: Fix boot crash on Raspberry Pi 4

2024-02-27 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Fix boot crash on Raspberry Pi by moving the update to `event->datalen` > before data is copied into flexible-array member `data` via `memcpy()`. > > Flexible-array member `data` was annotated with `__counted_by(datalen)` > in commit 62d19b358088 ("wifi: brcmfmac:

Re: [PATCH v3] wifi: mwifiex: Refactor 1-element array into flexible array in struct mwifiex_ie_types_chan_list_param_set

2024-02-12 Thread Kalle Valo
; > Link: https://github.com/KSPP/linux/issues/51 [1] > Cc: Brian Norris > Cc: Kalle Valo > Cc: Dmitry Antipov > Cc: Johannes Berg > Cc: zuoqilin > Cc: Ruan Jinjie > Cc: Thomas Gleixner > Cc: Christophe JAILLET > Cc: Gustavo A. R. Silva > Cc: linux-wirel..

Re: [PATCH] wifi: brcmfmac: Adjust n_channels usage for __counted_by

2024-02-02 Thread Kalle Valo
~~~^~ > > Fixes: e3eac9f32ec0 ("wifi: cfg80211: Annotate struct cfg80211_scan_request > with __counted_by") > Cc: Arend van Spriel > Cc: Franky Lin > Cc: Hante Meuleman > Cc: Kalle Valo > Cc: Chi-hsien Lin > Cc:

Re: [PATCH] wifi: brcmfmac: Adjust n_channels usage for __counted_by

2024-02-02 Thread Kalle Valo
Arend Van Spriel writes: > On 2/2/2024 10:58 AM, Arend Van Spriel wrote: > >> On 2/1/2024 11:04 AM, Kalle Valo wrote: >>> Kees Cook wrote: >>> >>>> After commit e3eac9f32ec0 ("wifi: cfg80211: Annotate struct >>>> cfg80211_scan_request

Re: [PATCH] wifi: brcmfmac: Adjust n_channels usage for __counted_by

2024-02-01 Thread Kalle Valo
~~~^~ > > Fixes: e3eac9f32ec0 ("wifi: cfg80211: Annotate struct cfg80211_scan_request > with __counted_by") > Cc: Arend van Spriel > Cc: Franky Lin > Cc: Hante Meuleman > Cc: Kalle Valo > Cc: Chi-hsien Lin > Cc:

Re: [PATCH] wifi: iwlegacy: Use kcalloc() instead of kzalloc()

2024-01-23 Thread Kalle Valo
Erick Archer wrote: > As noted in the "Deprecated Interfaces, Language Features, Attributes, > and Conventions" documentation [1], size calculations (especially > multiplication) should not be performed in memory allocator (or similar) > function arguments due to the risk of them overflowing. Thi

Re: [PATCH 41/82] wil6210: Refactor intentional wrap-around test

2024-01-23 Thread Kalle Valo
ng the wrap-around sanitizers in the future. > > Link: https://git.kernel.org/linus/68df3755e383e6fecf2354a67b08f92f18536594 > [1] > Link: https://github.com/KSPP/linux/issues/26 [2] > Link: https://github.com/KSPP/linux/issues/27 [3] > Link: https://github.com/KSPP/linux/issues/344 [

Re: [PATCH 62/82] mwifiex: pcie: Refactor intentional wrap-around test

2024-01-22 Thread Kalle Valo
ing the wrap-around sanitizers in the future. > > Link: https://git.kernel.org/linus/68df3755e383e6fecf2354a67b08f92f18536594 > [1] > Link: https://github.com/KSPP/linux/issues/26 [2] > Link: https://github.com/KSPP/linux/issues/27 [3] > Link: https://github.com/KSPP/linux/issues/344 [4] &g

Re: [PATCH 41/82] wil6210: Refactor intentional wrap-around test

2024-01-22 Thread Kalle Valo
ing the wrap-around sanitizers in the future. > > Link: https://git.kernel.org/linus/68df3755e383e6fecf2354a67b08f92f18536594 > [1] > Link: https://github.com/KSPP/linux/issues/26 [2] > Link: https://github.com/KSPP/linux/issues/27 [3] > Link: https://github.com/KSPP/linux/issues/344 [4] >

Re: [PATCH v2][wireless-next/for-next] wifi: mt76: mt7996: Use DECLARE_FLEX_ARRAY() and fix -Warray-bounds warnings

2023-12-17 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Transform zero-length arrays `rate`, `adm_stat` and `msdu_cnt` into > proper flexible-array members in anonymous union in `struct > mt7996_mcu_all_sta_info_event` via the DECLARE_FLEX_ARRAY() > helper; and fix multiple -Warray-bounds warnings: > > drivers/net/wirel

Re: [PATCH v2][wireless-next/for-next] wifi: mt76: mt7996: Use DECLARE_FLEX_ARRAY() and fix -Warray-bounds warnings

2023-12-15 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Transform zero-length arrays `rate`, `adm_stat` and `msdu_cnt` into > proper flexible-array members in anonymous union in `struct > mt7996_mcu_all_sta_info_event` via the DECLARE_FLEX_ARRAY() > helper; and fix multiple -Warray-bounds warnings: > > drivers/net/wirel

Re: [PATCH][next] wifi: mt76: mt7996: Use DECLARE_FLEX_ARRAY() and fix -Warray-bounds warnings

2023-12-12 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Transform zero-length arrays `adm_stat` and `msdu_cnt` into proper > flexible-array members in anonymous union in `struct > mt7996_mcu_all_sta_info_event` via the DECLARE_FLEX_ARRAY() > helper; and fix multiple -Warray-bounds warnings: > > drivers/net/wireless/medi

Re: [PATCH][next] wifi: mt76: mt7996: Use DECLARE_FLEX_ARRAY() and fix -Warray-bounds warnings

2023-12-04 Thread Kalle Valo
Kees Cook writes: > On Thu, Nov 16, 2023 at 02:57:24PM -0600, Gustavo A. R. Silva wrote: > >> Transform zero-length arrays `adm_stat` and `msdu_cnt` into proper >> flexible-array members in anonymous union in `struct >> mt7996_mcu_all_sta_info_event` via the DECLARE_FLEX_ARRAY() >> helper; and fi

Re: [PATCH v2] wifi: iwlwifi: fw: replace deprecated strncpy with strscpy_pad

2023-12-01 Thread Kalle Valo
Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > Based on the deliberate `sizeof(dest) ... - 1` pattern we can see that > both dump_info->dev_human_readable and d

Re: [PATCH v2] wifi: iwlwifi: fw: replace deprecated strncpy with strscpy_pad

2023-12-01 Thread Kalle Valo
Kees Cook writes: > On Thu, Oct 19, 2023 at 05:44:59PM +, Justin Stitt wrote: >> strncpy() is deprecated for use on NUL-terminated destination strings >> [1] and as such we should prefer more robust and less ambiguous string >> interfaces. >> >> Based on the deliberate `sizeof(dest) ... - 1`

Re: [PATCH][next] wifi: rtw89: coex: Fix -Wstringop-overflow warnings in _append_tdma()

2023-11-14 Thread Kalle Valo
"Gustavo A. R. Silva" writes: >> wireless-next has taken my patch [1] that is identical to yours. > > Great! > > I had mine ready on Oct 31, but I was waiting for the merge window to close > before sending it. BTW we keep wireless-next open also during merge windows. So no need to hold up wirele

Re: [v2] wifi: airo: replace deprecated strncpy with strscpy_pad

2023-10-30 Thread Kalle Valo
Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > `extra` is clearly supposed to be NUL-terminated which is evident by the > manual NUL-byte assignment as well as

Re: [PATCH v3 1/2] wifi: brcm80211: replace deprecated strncpy with strscpy

2023-10-30 Thread Kalle Valo
Justin Stitt wrote: > Let's move away from using strncpy and instead favor a less ambiguous > and more robust interface. > > For ifp->ndev->name, we expect ifp->ndev->name to be NUL-terminated based > on its use in format strings within core.c: > 67 | char *brcmf_ifname(struct brcmf_if *if

Re: [PATCH v2] airo: replace deprecated strncpy with strscpy_pad

2023-10-27 Thread Kalle Valo
Kees Cook writes: > On Thu, Oct 26, 2023 at 11:19:18PM +, Justin Stitt wrote: > >> strncpy() is deprecated for use on NUL-terminated destination strings >> [1] and as such we should prefer more robust and less ambiguous string >> interfaces. >> >> `extra` is clearly supposed to be NUL-termin

Re: the nul-terminated string helper desk chair rearrangement

2023-10-27 Thread Kalle Valo
Jonathan Corbet writes: > Steven Rostedt writes: > >> On Thu, 26 Oct 2023 07:39:44 -0400 >> James Bottomley wrote: >> >>> While it's nice in theory to have everything documented, it's not much >>> use if no one can actually find the information ... >> >> Does kerneldoc provide an automated inde

Re: [v2] wifi: atmel: replace deprecated strncpy with strscpy

2023-10-23 Thread Kalle Valo
Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We expect priv->firmware_id to be NUL-terminated based on its usage > with seq_printf() and strlen() in atmel.c:

Re: [PATCH] wifi: wlcore: main: replace deprecated strncpy with strscpy

2023-10-23 Thread Kalle Valo
Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We expect fw_version strings to be NUL-terminated based on other similar > assignments: > > wireless/broadcom/br

Re: wifi: wlcore: boot: replace deprecated strncpy with strscpy

2023-10-23 Thread Kalle Valo
Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We expect wl->chip.fw_ver_str to be NUL-terminated based on its usage > with DRIVER_STATE_PRINT_STR() in debugfs.

Re: [PATCH v2] wifi: wl18xx: replace deprecated strncpy with strscpy

2023-10-23 Thread Kalle Valo
Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > wl->chip.phy_fw_ver_str is obviously intended to be NUL-terminated by > the deliberate comment telling us as much

Re: [PATCH v2] wifi: wl1251: replace deprecated strncpy with strscpy

2023-10-23 Thread Kalle Valo
Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > Based on other assignments of similar fw_version fields we can see that > NUL-termination is required but not NUL

Re: [PATCH v2] wifi: ipw2x00: replace deprecated strncpy with strscpy_pad

2023-10-23 Thread Kalle Valo
Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > `extra` is intended to be NUL-terminated which is evident by the manual > assignment of a NUL-byte as well as its

Re: [PATCH] ath6kl: replace deprecated strncpy with memcpy

2023-10-18 Thread Kalle Valo
precated.html#strncpy-on-nul-terminated-strings > [1] > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Justin Stitt > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 40990961d983 wifi: ath6kl: rep

Re: [PATCH] ath5k: replace deprecated strncpy with strscpy

2023-10-18 Thread Kalle Valo
/issues/90 > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Justin Stitt > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 24709752bfe8 wifi: ath5k: replace deprecated strncpy with strscpy -- https://patchwork.kernel.org/project/linux-w

Re: [PATCH v2] brcmfmac: replace deprecated strncpy

2023-10-17 Thread Kalle Valo
Franky Lin writes: > Hi Justin, > > On Mon, Oct 16, 2023 at 3:14 PM Justin Stitt wrote: >> >> strncpy() is deprecated for use on NUL-terminated destination strings >> [1] and as such we should prefer more robust and less ambiguous string >> interfaces. >> >> This patch replaces multiple strncpy

Re: [PATCH v2] wifi: p54: Annotate struct p54_cal_database with __counted_by

2023-10-12 Thread Kalle Valo
(for strcpy/memcpy-family > functions). > > Add __counted_by for struct p54_cal_database. > > Cc: Christian Lamparter > Cc: Kalle Valo > Cc: "Gustavo A. R. Silva" > Cc: linux-wirel...@vger.kernel.org > Cc: linux-hardening@vger.kernel.org > Suggested-by: J

Re: [PATCH][next] wifi: brcmfmac: fweh: Add __counted_by for struct brcmf_fweh_queue_item and use struct_size()

2023-10-11 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for > array indexing) and CONFIG_FORTIFY_SOURCE (

Re: [next] wifi: hostap: Add __counted_by for struct prism2_download_data and use struct_size()

2023-10-11 Thread Kalle Valo
"Gustavo A. R. Silva" wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for > array indexing) and CONFIG_FORTIFY_SOURCE (

Re: [PATCH][next] hostap: Add __counted_by for struct prism2_download_data and use struct_size()

2023-10-09 Thread Kalle Valo
Kees Cook writes: >> > Should this be considered a v2 of: >> > https://lore.kernel.org/linux-hardening/94848cc3-6f5c-46d7-8cc7-98a4f1086...@embeddedor.com/ >> > >> > ? >> >> Oops... sorry, I forgot I had reviewed this patch of yours. >> >> > >> > Yours is more complete since it includes the s

Re: [PATCH] wifi: mt76: Annotate struct mt76_rx_tid with __counted_by

2023-10-06 Thread Kalle Valo
Kees Cook writes: > On Fri, Sep 15, 2023 at 01:06:12PM -0700, Kees Cook wrote: >> Prepare for the coming implementation by GCC and Clang of the __counted_by >> attribute. Flexible array members annotated with __counted_by can have >> their accesses bounds-checked at run-time checking via CONFIG_U

Re: [PATCH] wifi: wcn36xx: Annotate struct wcn36xx_hal_ind_msg with __counted_by

2023-09-21 Thread Kalle Valo
RTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct wcn36xx_hal_ind_msg. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Loic Poulain > Cc: Kalle Valo

Re: [PATCH] wifi: ipw2x00: Annotate struct libipw_txb with __counted_by

2023-09-20 Thread Kalle Valo
RTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct libipw_txb. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Stanislav Yakovlev > Cc: Kalle Valo > C

Re: [PATCH] wifi: brcmfmac: firmware: Annotate struct brcmf_fw_request with __counted_by

2023-09-20 Thread Kalle Valo
RTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct brcmf_fw_request. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Arend van Spriel > Cc: Franky Lin

Re: [PATCH] wifi: brcmfmac: Annotate struct brcmf_gscan_config with __counted_by

2023-09-20 Thread Kalle Valo
RTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct brcmf_gscan_config. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Arend van Spriel > Cc: Franky Lin