Re: [PATCH] nvmet-fc: Annotate struct nvmet_fc_tgt_queue with __counted_by

2023-10-03 Thread Chaitanya Kulkarni
On 10/3/23 16:25, 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 CONFIG_FORTIFY_SOUR

Re: [PATCH] nfp: nsp: Annotate struct nfp_eth_table with __counted_by

2023-10-03 Thread Louis Peens
On Tue, Oct 03, 2023 at 04:18:51PM -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 via CONFIG_UBSAN_BOUNDS (for > array indexing)

Re: [PATCH] nfp: Annotate struct nfp_reprs with __counted_by

2023-10-03 Thread Louis Peens
On Tue, Oct 03, 2023 at 04:18:43PM -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 via CONFIG_UBSAN_BOUNDS (for > array indexing)

Re: [PATCH] nexthop: Annotate struct nh_notifier_grp_info with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:21, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] netlink: Annotate struct netlink_policy_dump_state with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:21, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] dmaengine: fsl-edma: Annotate struct struct fsl_edma_engine with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:27, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] netem: Annotate struct disttable with __counted_by

2023-10-03 Thread Stephen Hemminger
On Tue, 3 Oct 2023 16:18:23 -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 via CONFIG_UBSAN_BOUNDS (for > array indexing) and

Re: [PATCH] nexthop: Annotate struct nh_group with __counted_by

2023-10-03 Thread David Ahern
On 10/3/23 7:44 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 CONFIG_FORTIFY_SO

Re: [PATCH] flow_offload: Annotate struct flow_action_entry with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:18, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] nfp: nsp: Annotate struct nfp_eth_table with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:18, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] xfrm: Annotate struct xfrm_sec_ctx with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:18, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] ASoC: soc-dapm: Annotate struct snd_soc_dapm_widget_list with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:28, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] nfp: Annotate struct nfp_reprs with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:18, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] i40e: Annotate struct i40e_qvlist_info with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:18, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] nvmet-fc: Annotate struct nvmet_fc_tgt_queue with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:25, 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 CONFIG_FORTIFY_SOURCE

[PATCH] nexthop: Annotate struct nh_group with __counted_by

2023-10-03 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 v2] accessibility: speakup: refactor deprecated strncpy

2023-10-03 Thread Kees Cook
On Mon, 18 Sep 2023 05:30:15 +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > Let's refactor this function to just use synth_write(). > > Thanks for the testing! It's been 2 week without any more comments, so I'll snag this. Applied to

Re: [PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

2023-10-03 Thread Dave Hansen
On 10/3/23 14:54, Justin Stitt wrote: > Note: Ingo Molnar has some concerns about the comment being out of sync > [1] but I believe the comment still has a place as we can still > theoretically copy 64 bytes into our destination buffer without a > NUL-byte. The extra information about the 65th byte

Re: [PATCH v2] drivers: misc: ti-st: replace deprecated strncpy with strscpy

2023-10-03 Thread Kees Cook
On Tue, Oct 03, 2023 at 10:23:07PM +, 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 both `kim_data->dev_name` and `kim_gdata->dev_name` to be > NUL

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

2023-10-03 Thread Kees Cook
On Tue, Oct 03, 2023 at 10:15: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. > > The only caller of mptsas_exp_repmanufacture_info() is > mptsas_probe_one

Re: [PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

2023-10-03 Thread Kees Cook
On Tue, Oct 03, 2023 at 09:54:59PM +, Justin Stitt wrote: > strncpy works perfectly here in all cases, however, it is deprecated and > as such we should prefer more robust and less ambiguous string apis. > > Let's use `strtomem_pad` as this matches the functionality of `strncpy` > and is _not_

Re: [PATCH v2] HID: uhid: replace deprecated strncpy with strscpy

2023-10-03 Thread Kees Cook
On Tue, Oct 03, 2023 at 09:01:58PM +, 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. > > A suitable replacement is `strscpy` [2] due to the fact that it > guarant

Re: [PATCH v1 1/1] kernel.h: Move lib/cmdline.c prototypes to string.h

2023-10-03 Thread Kees Cook
On Tue, Oct 03, 2023 at 04:01:42PM +0300, Andy Shevchenko wrote: > The lib/cmdline.c is basically a set of some small string parsers > which are wide used in the kernel. Their prototypes belong to the > string.h rather then kernel.h. > > Signed-off-by: Andy Shevchenko I think these should live i

Re: [PATCH] netem: Annotate struct disttable with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:18, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] nexthop: Annotate struct nh_notifier_grp_info with __counted_by

2023-10-03 Thread David Ahern
On 10/3/23 5:21 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 CONFIG_FORTIFY_SO

Re: [PATCH] nexthop: Annotate struct nh_notifier_res_table_info with __counted_by

2023-10-03 Thread David Ahern
On 10/3/23 5:18 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 CONFIG_FORTIFY_SO

Re: [PATCH] nexthop: Annotate struct nh_res_table with __counted_by

2023-10-03 Thread David Ahern
On 10/3/23 5:18 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 CONFIG_FORTIFY_SO

Re: [PATCH] nexthop: Annotate struct nh_res_table with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:18, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] netfilter: nf_tables: Annotate struct nft_pipapo_match with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:17, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] net/packet: Annotate struct packet_fanout with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:17, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] net/mlx5: Annotate struct mlx5_flow_handle with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:17, 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 CONFIG_FORTIFY_SOURCE

Re: [PATCH] net/mlx5: Annotate struct mlx5_fc_bulk with __counted_by

2023-10-03 Thread Gustavo A. R. Silva
On 10/4/23 01:17, 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 CONFIG_FORTIFY_SOURCE

[PATCH] ASoC: soc-dapm: Annotate struct snd_soc_dapm_widget_list with __counted_by

2023-10-03 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

[PATCH] dmaengine: fsl-edma: Annotate struct struct fsl_edma_engine with __counted_by

2023-10-03 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] net/mlx5: Annotate struct mlx5_flow_handle with __counted_by

2023-10-03 Thread Justin Stitt
On Tue, Oct 3, 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 > their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for > array indexing) and CON

[PATCH] nvmet-fc: Annotate struct nvmet_fc_tgt_queue with __counted_by

2023-10-03 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

[PATCH] nexthop: Annotate struct nh_notifier_grp_info with __counted_by

2023-10-03 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] net/mlx5: Annotate struct mlx5_fc_bulk with __counted_by

2023-10-03 Thread Justin Stitt
On Tue, Oct 3, 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 > their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for > array indexing) and CON

[PATCH] netlink: Annotate struct netlink_policy_dump_state with __counted_by

2023-10-03 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

[PATCH] nfp: nsp: Annotate struct nfp_eth_table with __counted_by

2023-10-03 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

[PATCH] nfp: Annotate struct nfp_reprs with __counted_by

2023-10-03 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

[PATCH] i40e: Annotate struct i40e_qvlist_info with __counted_by

2023-10-03 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

[PATCH] flow_offload: Annotate struct flow_action_entry with __counted_by

2023-10-03 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

[PATCH] xfrm: Annotate struct xfrm_sec_ctx with __counted_by

2023-10-03 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

[PATCH] nexthop: Annotate struct nh_notifier_res_table_info with __counted_by

2023-10-03 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

[PATCH] netem: Annotate struct disttable with __counted_by

2023-10-03 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

[PATCH] nexthop: Annotate struct nh_res_table with __counted_by

2023-10-03 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

[PATCH] netfilter: nf_tables: Annotate struct nft_pipapo_match with __counted_by

2023-10-03 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

[PATCH] net/packet: Annotate struct packet_fanout with __counted_by

2023-10-03 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

[PATCH] net/mlx5: Annotate struct mlx5_flow_handle with __counted_by

2023-10-03 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 3/5] mlxsw: spectrum: Annotate struct mlxsw_sp_counter_pool with __counted_by

2023-10-03 Thread Justin Stitt
On Fri, Sep 29, 2023 at 11:08 AM 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] net/mlx5: Annotate struct mlx5_fc_bulk with __counted_by

2023-10-03 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 4/5] mlxsw: spectrum_router: Annotate struct mlxsw_sp_nexthop_group_info with __counted_by

2023-10-03 Thread Justin Stitt
On Fri, Sep 29, 2023 at 11:08 AM 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

Re: [PATCH 5/5] mlxsw: spectrum_span: Annotate struct mlxsw_sp_span with __counted_by

2023-10-03 Thread Justin Stitt
On Fri, Sep 29, 2023 at 11:08 AM 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

Re: [PATCH] mailbox: zynqmp: Annotate struct zynqmp_ipi_pdata with __counted_by

2023-10-03 Thread Justin Stitt
On Fri, Sep 22, 2023 at 10:54 AM 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

Re: [PATCH v2][next] PCI/P2PDMA: Fix potential undefined behavior bug in struct pci_p2pdma_pagemap

2023-10-03 Thread Bjorn Helgaas
On Mon, Oct 02, 2023 at 09:04:15PM +0200, Gustavo A. R. Silva wrote: > `struct dev_pagemap` is a flexible structure, which means that it > contains a flexible-array member at the bottom. This could potentially > lead to an overwrite of the objects following `pgmap` in `struct > pci_p2pdma_pagemap`,

[PATCH v2] drivers: misc: ti-st: replace deprecated strncpy with strscpy

2023-10-03 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. We expect both `kim_data->dev_name` and `kim_gdata->dev_name` to be NUL-terminated. `kim_data->dev_name` seems to not require NUL-padding. `kim

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

2023-10-03 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. The only caller of mptsas_exp_repmanufacture_info() is mptsas_probe_one_phy() which can allocate rphy in either sas_end_device_alloc() or sas_exp

[PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

2023-10-03 Thread Justin Stitt
strncpy works perfectly here in all cases, however, it is deprecated and as such we should prefer more robust and less ambiguous string apis. Let's use `strtomem_pad` as this matches the functionality of `strncpy` and is _not_ deprecated. Link: https://www.kernel.org/doc/html/latest/process/depr

Re: [PATCH net-next v5 0/7] introduce DEFINE_FLEX() macro

2023-10-03 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Tue, 12 Sep 2023 07:59:30 -0400 you wrote: > Add DEFINE_FLEX() macro, that helps on-stack allocation of structures > with trailing flex array member. > Expose __struct_size() macro which reads size of data allocat

[PATCH v2] HID: uhid: replace deprecated strncpy with strscpy

2023-10-03 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. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-pa

Re: [PATCH] ACPI: PRM: Annotate struct prm_module_info with __counted_by

2023-10-03 Thread Rafael J. Wysocki
On Sat, Sep 23, 2023 at 11:41 AM Gustavo A. R. Silva wrote: > > > > On 9/22/23 11:53, 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-

Re: [PATCH v2][next] cxgb4/ch_ktls: Fix undefined behavior bug in struct chcr_ktls_ofld_ctx_tx

2023-10-03 Thread Sabrina Dubroca
2023-10-03, 12:56:54 +0200, Gustavo A. R. Silva wrote: > `struct tls_offload_context_tx` is a flexible structure, which means > that it contains a flexible-array member at the bottom. This could > potentially lead to an overwrite of the objects following `base` in > `struct chcr_ktls_ofld_ctx_tx` a

[PATCH v1 1/1] kernel.h: Move lib/cmdline.c prototypes to string.h

2023-10-03 Thread Andy Shevchenko
The lib/cmdline.c is basically a set of some small string parsers which are wide used in the kernel. Their prototypes belong to the string.h rather then kernel.h. Signed-off-by: Andy Shevchenko --- include/linux/kernel.h | 6 -- include/linux/string.h | 8 2 files changed, 8 inserti

Re: [PATCH v2] arm64: dts: ti: k3-am625-beagleplay: Fix typo in ramoops reg

2023-10-03 Thread Vignesh Raghavendra
Hi Wadim Egorov, On Mon, 25 Sep 2023 17:14:44 +0200, Wadim Egorov wrote: > Seems like the address value of the reg property was mistyped. > Update reg to 0x9ca0 to match node's definition. > > I have applied the following to branch ti-k3-dts-next on [1]. Thank you! [1/1] arm64: dts: ti: k3

[PATCH v2][next] cxgb4/ch_ktls: Fix undefined behavior bug in struct chcr_ktls_ofld_ctx_tx

2023-10-03 Thread Gustavo A. R. Silva
`struct tls_offload_context_tx` is a flexible structure, which means that it contains a flexible-array member at the bottom. This could potentially lead to an overwrite of the objects following `base` in `struct chcr_ktls_ofld_ctx_tx` at run-time. Notice that flexible-array member `driver_state` i

[PATCH][next] cxgb4/ch_ktls: Fix undefined behavior bug in struct chcr_ktls_ofld_ctx_tx

2023-10-03 Thread Gustavo A. R. Silva
`struct tls_offload_context_tx` is a flexible structure, which means that it contains a flexible-array member at the bottom. This could potentially lead to an overwrite of the objects following `base` in `struct chcr_ktls_ofld_ctx_tx` at run-time. Notice that flexible-array member `driver_state` i

Re: [PATCH][next] udf: Fix undefined behavior bug in struct udf_fileident_iter

2023-10-03 Thread Jan Kara
On Mon 02-10-23 18:14:26, Gustavo A. R. Silva wrote: > `struct fileIdentDesc` is a flexible structure, which means that it > contains a flexible-array member at the bottom. This could potentially > lead to an overwrite of the objects following `fi` in `struct > udf_fileident_iter` at run-time. > >

Re: [PATCH] qed/red_ll2: Fix undefined behavior bug in struct qed_ll2_info

2023-10-03 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Paolo Abeni : On Sat, 23 Sep 2023 19:15:59 -0600 you wrote: > The flexible structure (a structure that contains a flexible-array member > at the end) `qed_ll2_tx_packet` is nested within the second layer of > `struct qed_ll2_info`: > > st