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

2023-10-09 Thread Jason Andryuk
Hi, I randomly peeked at this patch. Unfortunately, I am not familiar with the actual p54 code. On Fri, Oct 6, 2023 at 4:17 PM 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

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

2023-10-09 Thread Gustavo A. R. Silva
On 10/9/23 16:55, Jason Andryuk wrote: Hi, I randomly peeked at this patch. Unfortunately, I am not familiar with the actual p54 code. On Fri, Oct 6, 2023 at 4:17 PM Kees Cook wrote: Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array memb

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

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 10:55:32AM -0400, Jason Andryuk wrote: > Hi, > > I randomly peeked at this patch. Unfortunately, I am not familiar > with the actual p54 code. > > On Fri, Oct 6, 2023 at 4:17 PM Kees Cook wrote: > > > > Prepare for the coming implementation by GCC and Clang of the __coun

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

2023-10-09 Thread Kees Cook
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 (for strcpy/memcpy-family functions). A

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

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 10:55:32AM -0400, Jason Andryuk wrote: > This is the function that creates struct p54_cal_database: > > static struct p54_cal_database *p54_convert_db(struct pda_custom_wrapper *src, >size_t total_len) > { > struct p54

Re: [PATCH v2] staging: qlge: Replace strncpy with strscpy

2023-10-09 Thread Kees Cook
On Fri, Oct 06, 2023 at 05:12:24PM +0100, Ricardo Lopes wrote: > Reported by checkpatch: > > WARNING: Prefer strscpy, strscpy_pad, or __nonstring over strncpy Thanks for working on this! Doing these replacements needs analysis of several issues that should be described in the commit log: - is th

Re: [PATCH] wifi: rtw89: coex: Annotate struct rtw89_btc_btf_set_slot_table with __counted_by

2023-10-09 Thread Kees Cook
On Sat, Oct 07, 2023 at 01:20:43AM +, Ping-Ke Shih wrote: > On Fri, 2023-10-06 at 13:17 -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 bound

Re: [PATCH] ASoC: apple: mca: Annotate struct mca_data with __counted_by

2023-10-09 Thread Kees Cook
On Fri, Oct 06, 2023 at 09:53:49PM +0100, Mark Brown wrote: > On Fri, Oct 06, 2023 at 01:22:55PM -0700, Kees Cook wrote: > > On Fri, Sep 22, 2023 at 10:50:50AM -0700, Kees Cook wrote: > > > > Prepare for the coming implementation by GCC and Clang of the __counted_by > > > attribute. Flexible array

Re: [PATCH] regulator: da9062: Annotate struct da9062_regulators with __counted_by

2023-10-09 Thread Mark Brown
On Fri, 22 Sep 2023 10:53:31 -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_UBSAN_BOUNDS > (for array indexi

[PATCH v2] bna: replace deprecated strncpy with strscpy_pad

2023-10-09 Thread Justin Stitt
`strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. bfa_ioc_get_adapter_manufacturer() simply copies a string literal into `manufacturer`. Another implementation of bfa_ioc_get_adapter_manufacture

[PATCH][next] wifi: mac80211: Add __counted_by for struct ieee802_11_elems and use struct_size()

2023-10-09 Thread Gustavo A. R. Silva
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 (for strcpy/memcpy-family functions). W

[PATCH] net: dsa: lantiq_gswip: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Justin Stitt
`strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of this more robust and easier to understand i

[PATCH][next] iommu/virtio: Add __counted_by for struct viommu_request and use struct_size()

2023-10-09 Thread Gustavo A. R. Silva
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 (for strcpy/memcpy-family functions). W

[PATCH] net: dsa: mt7530: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Justin Stitt
RING_LEN); + ethtool_sprintf(&data, "%s", mt7530_mib[i].name); } static void --- base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2 change-id: 20231009-strncpy-drivers-net-dsa-mt7530-c-40cad383654d Best regards, -- Justin Stitt

Re: [PATCH] net: dsa: lantiq_gswip: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 06:24:20PM +, 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. > > ethtool_sprintf() is designed specifically for get_strings() usage. > Let

Re: [PATCH] net: dsa: mt7530: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 06:29:19PM +, 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. > > ethtool_sprintf() is designed specifically for get_strings() usage. > Let

Re: [PATCH] net: dsa: mt7530: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Kees Cook
me); Err, wait, I spoke too soon. Shouldn't this be "data" and not "&data"? > } > > static void > > --- > base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2 > change-id: 20231009-strncpy-drivers-net-dsa-mt7530-c-40cad383654d > > Best regards, > -- > Justin Stitt > > -- Kees Cook

Re: [PATCH] net: dsa: lantiq_gswip: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 06:24:20PM +, 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. > > ethtool_sprintf() is designed specifically for get_strings() usage. > Let

[PATCH] net: dsa: qca8k: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Justin Stitt
27_mib[i].name, - ETH_GSTRING_LEN); + ethtool_sprintf(&data, "%s", ar8327_mib[i].name); } void qca8k_get_ethtool_stats(struct dsa_switch *ds, int port, --- base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2 change-id: 20231009-strncpy-drivers-net-dsa-qca

Re: [PATCH] net: dsa: mt7530: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Daniel Golle
port, u32 > stringset, > return; > > for (i = 0; i < ARRAY_SIZE(mt7530_mib); i++) > - strncpy(data + i * ETH_GSTRING_LEN, mt7530_mib[i].name, > - ETH_GSTRING_LEN); > + ethtool_sprintf(&data, "%s", mt7530_

[PATCH][next] media: venus: hfi_cmds: Replace one-element array with flex-array member and use __counted_by

2023-10-09 Thread Gustavo A. R. Silva
Array `data` in `struct hfi_sfr` is being used as a fake flexible array at run-time: drivers/media/platform/qcom/venus/hfi_venus.c: 1033 p = memchr(sfr->data, '\0', sfr->buf_size); 1034 /* 1035 * SFR isn't guaranteed to be NULL terminated since SYS_ERROR indicates 1036

Re: [PATCH v2] staging: qlge: Replace strncpy with strscpy

2023-10-09 Thread Ricardo Lopes
On Mon, Oct 09, 2023 at 09:44:37AM -0700, Kees Cook wrote: > Thanks for working on this! Doing these replacements needs analysis of > several issues that should be described in the commit log: > > - is the destination an %NUL-terminated string? (strncpy can produce > non-%NUL-terminated strings

[PATCH][next] xen/xenbus: Add __counted_by for struct read_buffer and use struct_size()

2023-10-09 Thread Gustavo A. R. Silva
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 (for strcpy/memcpy-family functions). W

Re: [PATCH] net: dsa: mt7530: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 11:31:46AM -0700, Kees Cook wrote: > On Mon, Oct 09, 2023 at 06:29:19PM +, 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. > > > > et

Re: [PATCH] net: dsa: lantiq_gswip: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 11:34:27AM -0700, Kees Cook wrote: > On Mon, Oct 09, 2023 at 06:24:20PM +, 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. > > > > et

Re: [PATCH][next] xen/xenbus: Add __counted_by for struct read_buffer and use struct_size()

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 12:55:30PM -0600, 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

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

2023-10-09 Thread Gustavo A. R. Silva
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 (for strcpy/memcpy-family functions). W

Re: [PATCH] ASoC: apple: mca: Annotate struct mca_data with __counted_by

2023-10-09 Thread Mark Brown
On Mon, Oct 09, 2023 at 10:17:33AM -0700, Kees Cook wrote: > On Fri, Oct 06, 2023 at 09:53:49PM +0100, Mark Brown wrote: > > Please don't send content free pings and please allow a reasonable time > > for review. People get busy, go on holiday, attend conferences and so > > on so unless there is

Re: [PATCH] ASoC: apple: mca: Annotate struct mca_data with __counted_by

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 08:43:44PM +0100, Mark Brown wrote: > Off the top of my head I'd say wait at least three weeks for this sort > of patch before doing anything and then prefer to do a resend, that's > should avoid most issues. If you're going to just apply things yourself > I'd suggest waiti

Re: [PATCH] net: dsa: qca8k: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 06:34:45PM +, 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. > > ethtool_sprintf() is designed specifically for get_strings() usage. > Let

[PATCH] ima: Add __counted_by for struct modsig and use struct_size()

2023-10-09 Thread Gustavo A. R. Silva
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 (for strcpy/memcpy-family functions). A

Re: [PATCH][next] media: venus: hfi_cmds: Replace one-element array with flex-array member and use __counted_by

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 12:42:05PM -0600, Gustavo A. R. Silva wrote: > Array `data` in `struct hfi_sfr` is being used as a fake flexible array > at run-time: > > drivers/media/platform/qcom/venus/hfi_venus.c: > 1033 p = memchr(sfr->data, '\0', sfr->buf_size); > 1034 /* > 1035

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

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 01:41:18PM -0600, 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

Re: [PATCH] ima: Add __counted_by for struct modsig and use struct_size()

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 01:52:45PM -0600, 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

Re: [PATCH][next] wifi: mac80211: Add __counted_by for struct ieee802_11_elems and use struct_size()

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 11:59:41AM -0600, 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

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

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 05:45:33PM +, 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. > > bfa_ioc_get_adapter_manufacturer() simply copies a string literal into >

Re: [PATCH] mtd: rawnand: rockchip: Use struct_size()

2023-10-09 Thread Kees Cook
On Sun, Oct 01, 2023 at 09:44:04AM +0200, Christophe JAILLET wrote: > Use struct_size() instead of hand writing it. > This is less verbose and more robust. > > While at it, prepare for the coming implementation by GCC and Clang of the > __counted_by attribute. Flexible array members annotated with

Re: [PATCH] mtd: rawnand: rockchip: Use struct_size()

2023-10-09 Thread Heiko Stuebner
Am Sonntag, 1. Oktober 2023, 09:44:04 CEST schrieb Christophe JAILLET: > Use struct_size() instead of hand writing it. > This is less verbose and more robust. > > While at it, prepare for the coming implementation by GCC and Clang of the > __counted_by attribute. Flexible array members annotated w

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

2023-10-09 Thread Gustavo A. R. Silva
On 10/9/23 21:54, Kees Cook wrote: On Mon, Oct 09, 2023 at 01:41:18PM -0600, 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 v

Re: [PATCH] net: dsa: mt7530: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Florian Fainelli
On 10/9/23 11:29, 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. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of thi

Re: [PATCH] net: dsa: lantiq_gswip: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Florian Fainelli
On 10/9/23 11:24, 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. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of thi

Re: [PATCH] net: dsa: qca8k: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Florian Fainelli
On 10/9/23 11:34, 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. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of thi

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

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 02:33:01PM -0600, Gustavo A. R. Silva wrote: > > > On 10/9/23 21:54, Kees Cook wrote: > > On Mon, Oct 09, 2023 at 01:41:18PM -0600, Gustavo A. R. Silva wrote: > > > Prepare for the coming implementation by GCC and Clang of the __counted_by > > > attribute. Flexible array m

[PATCH][next] ASoC: sigmadsp: Add __counted_by for struct sigmadsp_data and use struct_size()

2023-10-09 Thread Gustavo A. R. Silva
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 (for strcpy/memcpy-family functions). W

[PATCH][next] soc: qcom: apr: Add __counted_by for struct apr_rx_buf and use struct_size()

2023-10-09 Thread Gustavo A. R. Silva
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 (for strcpy/memcpy-family functions). W

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

2023-10-09 Thread Gustavo A. R. Silva
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 (for strcpy/memcpy-family functions). A

[PATCH][next] net: wwan: t7xx: Add __counted_by for struct t7xx_fsm_event and use struct_size()

2023-10-09 Thread Gustavo A. R. Silva
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 (for strcpy/memcpy-family functions). W

[PATCH][next] staging: greybus: Add __counted_by for struct apr_rx_buf and use struct_size()

2023-10-09 Thread Gustavo A. R. Silva
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 (for strcpy/memcpy-family functions). W

Re: [PATCH 03/19] fs: release anon dev_t in deactivate_locked_super

2023-10-09 Thread Al Viro
On Mon, Oct 02, 2023 at 08:46:46AM +0200, Christoph Hellwig wrote: > On Tue, Sep 26, 2023 at 10:25:15PM +0100, Al Viro wrote: > > Before your patch: foo_kill_super() calls kill_anon_super(), > > which calls kill_super_notify(), which removes the sucker from > > the list, then frees ->s_fs_info. Af

Re: [PATCH][next] ASoC: sigmadsp: Add __counted_by for struct sigmadsp_data and use struct_size()

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 03:24:23PM -0600, 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

Re: [PATCH][next] soc: qcom: apr: Add __counted_by for struct apr_rx_buf and use struct_size()

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 03:30:17PM -0600, 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

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

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 03:42:04PM -0600, 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

Re: [PATCH][next] net: wwan: t7xx: Add __counted_by for struct t7xx_fsm_event and use struct_size()

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 03:46:18PM -0600, 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

Re: [PATCH][next] ASoC: sigmadsp: Add __counted_by for struct sigmadsp_data and use struct_size()

2023-10-09 Thread Gustavo A. R. Silva
On 10/10/23 00:03, Kees Cook wrote: On Mon, Oct 09, 2023 at 03:24:23PM -0600, 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

[PATCH] net: dsa: realtek: rtl8365mb: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Justin Stitt
b_counters[i]; - - strncpy(data + i * ETH_GSTRING_LEN, mib->name, ETH_GSTRING_LEN); + ethtool_sprintf(&data, "%s", mib->name); } } --- base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2 change-id: 20231009-strncpy-drivers-net-dsa-realtek-rtl836

[PATCH] net: dsa: realtek: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Justin Stitt
mib->name, ETH_GSTRING_LEN); + ethtool_sprintf(&data, "%s", priv->mib_counters[i].name); } } EXPORT_SYMBOL_GPL(rtl8366_get_strings); --- base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2 change-id: 20231009-strncpy-drivers-net-dsa-realtek-rtl8366-core-c-60a0f0ddc5cc Best regards, -- Justin Stitt

Re: [PATCH] net: dsa: realtek: rtl8365mb: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Florian Fainelli
On 10/9/23 15:43, 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. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of thi

Re: [PATCH] net: dsa: realtek: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Florian Fainelli
On 10/9/23 15:47, 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. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of thi

[PATCH] net: dsa: vsc73xx: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Justin Stitt
, true); if (cnt) - strncpy(data + j * ETH_GSTRING_LEN, - cnt->name, ETH_GSTRING_LEN); - j++; + ethtool_sprintf(&buf, "%s", cnt->name); } } --- base-commit: cbf3a2cb156a2c

[PATCH] net: fec: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Justin Stitt
tf(&data, "%s", fec_xdp_stat_strs[i]); } page_pool_ethtool_stats_get_strings(data); --- base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2 change-id: 20231009-strncpy-drivers-net-ethernet-freescale-fec_main-c-84f03fffa031 Best regards, -- Justin Stitt

Re: [PATCH][next] staging: greybus: Add __counted_by for struct apr_rx_buf and use struct_size()

2023-10-09 Thread Kees Cook
On Mon, Oct 09, 2023 at 03:52:59PM -0600, 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

Re: [PATCH] net: dsa: vsc73xx: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Florian Fainelli
On 10/9/23 15:54, 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. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of thi

Re: [PATCH] net: fec: replace deprecated strncpy with ethtool_sprintf

2023-10-09 Thread Florian Fainelli
On 10/9/23 16:05, 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. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of thi

[PATCH] ibmvnic: replace deprecated strncpy with strscpy

2023-10-09 Thread Justin Stitt
polated VPD buff\n"); } --- base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2 change-id: 20231009-strncpy-drivers-net-ethernet-ibm-ibmvnic-c-e0900ba19e56 Best regards, -- Justin Stitt

[PATCH] e100: replace deprecated strncpy with strscpy

2023-10-09 Thread Justin Stitt
cpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); + strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name)); nic = netdev_priv(netdev); netif_napi_add_weight(netdev, &nic->napi, e100_poll, E100_NAPI_WEIGHT); --- base-commit: cbf3a2cb156a2c911d

Re: [PATCH][next] soc: qcom: apr: Add __counted_by for struct apr_rx_buf and use struct_size()

2023-10-09 Thread Justin Stitt
On Mon, Oct 9, 2023 at 2:30 PM 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 indexin

Re: [PATCH][next] iommu/virtio: Add __counted_by for struct viommu_request and use struct_size()

2023-10-09 Thread Justin Stitt
On Mon, Oct 9, 2023 at 11:24 AM 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 indexi

Re: [PATCH] scsi: message: fusion: replace deprecated strncpy with strscpy_pad

2023-10-09 Thread Martin K. Petersen
Justin, > `strncpy` is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. Applied to 6.7/scsi-staging, thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH v2] scsi: message: fusion: replace deprecated strncpy with strscpy

2023-10-09 Thread Martin K. Petersen
Justin, > `strncpy` is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. Applied to 6.7/scsi-staging, thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH][next] staging: greybus: Add __counted_by for struct apr_rx_buf and use struct_size()

2023-10-09 Thread Alex Elder
On 10/9/23 4:52 PM, 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_FORTIF

Re: [PATCH] scsi: target: tcmu: Annotate struct tcmu_tmr with __counted_by

2023-10-09 Thread Martin K. Petersen
On Fri, 22 Sep 2023 10:53:01 -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_UBSAN_BOUNDS > (for array index

Re: [PATCH] cavium/liquidio: replace deprecated strncpy with strscpy

2023-10-09 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Thu, 05 Oct 2023 22:52:34 + you 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 expe

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

2023-10-09 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Thu, 05 Oct 2023 20:51:40 + you 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. > > A suita

Re: [PATCH] liquidio: replace deprecated strncpy/strcpy with strscpy

2023-10-09 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Thu, 05 Oct 2023 21:33:19 + you 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. > > NUL-pad

Re: [PATCH] net: liquidio: replace deprecated strncpy with strscpy_pad

2023-10-09 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Thu, 05 Oct 2023 21:41:01 + you 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 know

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

2023-10-09 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Thu, 05 Oct 2023 21:55:06 + you 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. > > NUL-pad

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

2023-10-09 Thread Jason Andryuk
On Mon, Oct 9, 2023 at 12:10 PM 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 via CONFIG_UBSAN_BOUNDS (for > array indexing) and CO

Re: [ovs-dev] [PATCH net-next 2/2] net: openvswitch: Annotate struct mask_array with __counted_byUse struct_size()

2023-10-09 Thread Christophe JAILLET
Le 02/10/2023 à 18:51, Ilya Maximets a écrit : On 10/1/23 13:07, Christophe JAILLET 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 CONF

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