Re: [PATCH v2][next] RDMA/core: Use size_{add,mul}() in calls to struct_size()

2023-09-18 Thread Leon Romanovsky
On Fri, Sep 15, 2023 at 12:06:21PM -0600, Gustavo A. R. Silva wrote: > > > On 9/14/23 21:29, Kees Cook wrote: > > On Mon, Sep 11, 2023 at 05:27:59PM -0600, Gustavo A. R. Silva wrote: > > > Harden calls to struct_size() with size_add() and size_mul(). > > > > Specifically, make sure that open-cod

Re: [PATCH 06/19] qibfs: use simple_release_fs

2023-09-18 Thread Leon Romanovsky
s(+), 105 deletions(-) > Thanks, Reviewed-by: Leon Romanovsky

Re: [PATCH v2][next] RDMA/core: Use size_{add,mul}() in calls to struct_size()

2023-09-18 Thread Leon Romanovsky
On Sun, Sep 17, 2023 at 01:59:26PM -0600, Gustavo A. R. Silva wrote: > > > On 9/18/23 04:49, Leon Romanovsky wrote: > > On Fri, Sep 15, 2023 at 12:06:21PM -0600, Gustavo A. R. Silva wrote: > > > > > > > > > On 9/14/23 21:29, Kees Cook wrote: > &

Re: [PATCH v3][next] RDMA/core: Use size_{add,sub,mul}() in calls to struct_size()

2023-09-19 Thread Leon Romanovsky
On Sun, Sep 17, 2023 at 03:21:36PM -0600, Gustavo A. R. Silva wrote: > If, for any reason, the open-coded arithmetic causes a wraparound, The thing is that it doesn't. > the protection that `struct_size()` provides against potential integer > overflows is defeated. Fix this by hardening calls to

Re: [PATCH v3][next] RDMA/core: Use size_{add,sub,mul}() in calls to struct_size()

2023-09-19 Thread Leon Romanovsky
th `size_add()`, `size_sub()` and `size_mul()`. > > Applied, thanks! [1/1] RDMA/core: Use size_{add,sub,mul}() in calls to struct_size() https://git.kernel.org/rdma/rdma/c/81760bedc65194 Best regards, -- Leon Romanovsky

Re: [PATCH] RDMA/irdma: replace deprecated strncpy

2023-09-22 Thread Leon Romanovsky
it > guarantees NUL-termination on the destination buffer. > > [...] Applied, thanks! [1/1] RDMA/irdma: replace deprecated strncpy https://git.kernel.org/rdma/rdma/c/f0cc82ca116f5b Best regards, -- Leon Romanovsky

Re: [PATCH] IB/hfi1: replace deprecated strncpy

2023-09-22 Thread Leon Romanovsky
__entry->src) > | ); > > [...] Applied, thanks! [1/1] IB/hfi1: replace deprecated strncpy https://git.kernel.org/rdma/rdma/c/c2d0c5b28a77d5 Best regards, -- Leon Romanovsky

Re: [PATCH] IB/qib: replace deprecated strncpy

2023-09-22 Thread Leon Romanovsky
lied, thanks! [1/1] IB/qib: replace deprecated strncpy https://git.kernel.org/rdma/rdma/c/cb7ab7854bc709 Best regards, -- Leon Romanovsky

Re: [PATCH 0/7] RDMA: Annotate structs with __counted_by

2023-10-02 Thread Leon Romanovsky
unted_by https://git.kernel.org/rdma/rdma/c/bd8eec5bfa59b5 [6/7] IB/mthca: Annotate struct mthca_icm_table with __counted_by https://git.kernel.org/rdma/rdma/c/2aba54a9e0ead5 [7/7] IB/hfi1: Annotate struct tid_rb_node with __counted_by https://git.kernel.org/rdma/rdma/c/964168970cef5f Best regards, -- Leon Romanovsky

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

2023-10-04 Thread Leon Romanovsky
> their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for > > array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > > functions). > > > > As found with Coccinelle[1], add __counted_by for struct mlx5_fc_bulk. > > > > Cc: Sa

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

2023-10-04 Thread Leon Romanovsky
ray indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct mlx5_flow_handle. > > Cc: Saeed Mahameed > Cc: Leon Romanovsky > Cc: "David S. Miller" > Cc: Eric Dumazet >

Re: [PATCH][next] RDMA/uverbs: Avoid -Wflex-array-member-not-at-end warnings

2024-03-03 Thread Leon Romanovsky
ain a couple of flexible structures: > > struct bundle_priv { > /* Must be first */ > struct bundle_alloc_head alloc_head; > > [...] Applied, thanks! [1/1] RDMA/uverbs: Avoid -Wflex-array-member-not-at-end warnings https://git.kernel.org/rdma/rdma/c/155f0

Re: [PATCH][next] RDMA/cm: Avoid -Wflex-array-member-not-at-end warning

2024-04-02 Thread Leon Romanovsky
On Mon, Mar 25, 2024 at 08:57:08PM -0600, Gustavo A. R. Silva wrote: > > > On 3/25/24 16:47, Jason Gunthorpe wrote: > > On Mon, Mar 25, 2024 at 02:24:07PM -0600, Gustavo A. R. Silva wrote: > > > -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting > > > ready to enable it global

Re: [PATCH v2] RDMA/mana_ib: Add flex array to struct mana_cfg_rx_steer_req_v2

2024-04-02 Thread Leon Romanovsky
On Mon, Apr 01, 2024 at 05:37:03PM +0200, Erick Archer wrote: > The "struct mana_cfg_rx_steer_req_v2" uses a dynamically sized set of > trailing elements. Specifically, it uses a "mana_handle_t" array. So, > use the preferred way in the kernel declaring a flexible array [1]. > > At the same time,

Re: [PATCH v3 0/3] RDMA/mana_ib: Add flex array to struct mana_cfg_rx_steer_req_v2

2024-04-08 Thread Leon Romanovsky
> @@ > > msg = "WARNING: verify allocation on line %s" % (p1[0].line) > coccilib.report.print_report(p1[0],msg) > > Link: > https://www.kernel.org/doc/html/next/process/deprecated.html#zero-length-and-one-element-arrays > [1] > Link: > https://www.kernel.org/doc/h

Re: [PATCH v3 0/3] RDMA/mana_ib: Add flex array to struct mana_cfg_rx_steer_req_v2

2024-04-09 Thread Leon Romanovsky
On Mon, Apr 08, 2024 at 06:36:57PM -0700, Jakub Kicinski wrote: > On Mon, 8 Apr 2024 14:07:30 +0300 Leon Romanovsky wrote: > > Jakub, do you want shared branch for this series or should I take > > everything through RDMA tree as netdev part is small enough? > > Shared branch

Re: [PATCH v3 0/3] RDMA/mana_ib: Add flex array to struct mana_cfg_rx_steer_req_v2

2024-04-11 Thread Leon Romanovsky
On Tue, Apr 09, 2024 at 02:44:19PM -0700, Jakub Kicinski wrote: > On Tue, 9 Apr 2024 18:01:40 +0100 Edward Cree wrote: > > > Shared branch would be good. Ed has some outstanding patches > > > to refactor the ethtool RSS API. > > > > For the record I am extremely unlikely to have time to get tho

Re: [PATCH] RDMA/irdma: Annotate flexible array with __counted_by() in struct irdma_qvlist_info

2024-05-30 Thread Leon Romanovsky
enable some > additional checks. > > This allocation is done in irdma_save_msix_info(). > > [...] Applied, thanks! [1/1] RDMA/irdma: Annotate flexible array with __counted_by() in struct irdma_qvlist_info https://git.kernel.org/rdma/rdma/c/38c02d813aa321 Best regards, -- Leon Romanovsky

Re: [PATCH net-next v2] net: mana: Allow variable size indirection table

2024-05-30 Thread Leon Romanovsky
On Tue, May 28, 2024 at 10:35:55PM -0700, Shradha Gupta wrote: > Allow variable size indirection table allocation in MANA instead > of using a constant value MANA_INDIRECT_TABLE_SIZE. > The size is now derived from the MANA_QUERY_VPORT_CONFIG and the > indirection table is allocated dynamically. >

Re: [PATCH net-next v2] net: mana: Allow variable size indirection table

2024-05-30 Thread Leon Romanovsky
On Thu, May 30, 2024 at 08:42:55AM -0700, Jakub Kicinski wrote: > On Thu, 30 May 2024 17:37:02 +0300 Leon Romanovsky wrote: > > Once you are ok with this patch, let me create shared branch for it. > > It is -rc1 and Konstantin already submitted some changes to qp.c > > https:

Re: [PATCH net-next v3] net: mana: Allow variable size indirection table

2024-06-03 Thread Leon Romanovsky
On Fri, May 31, 2024 at 08:37:41AM -0700, Shradha Gupta wrote: > Allow variable size indirection table allocation in MANA instead > of using a constant value MANA_INDIRECT_TABLE_SIZE. > The size is now derived from the MANA_QUERY_VPORT_CONFIG and the > indirection table is allocated dynamically. >

Re: [PATCH net-next v3] net: mana: Allow variable size indirection table

2024-06-04 Thread Leon Romanovsky
On Mon, Jun 03, 2024 at 10:36:48PM -0700, Shradha Gupta wrote: > On Mon, Jun 03, 2024 at 11:41:22AM +0300, Leon Romanovsky wrote: > > On Fri, May 31, 2024 at 08:37:41AM -0700, Shradha Gupta wrote: > > > Allow variable size indirection table allocation in MANA instead > &g

Re: [PATCH net-next v4] net: mana: Allow variable size indirection table

2024-06-12 Thread Leon Romanovsky
dynamically. > > Applied, thanks! [1/1] net: mana: Allow variable size indirection table https://git.kernel.org/rdma/rdma/c/7fc45cb68696c7 Best regards, -- Leon Romanovsky

Re: [PATCH net-next v4] net: mana: Allow variable size indirection table

2024-06-12 Thread Leon Romanovsky
On Mon, Jun 10, 2024 at 03:28:39AM -0700, Shradha Gupta wrote: > Allow variable size indirection table allocation in MANA instead > of using a constant value MANA_INDIRECT_TABLE_SIZE. > The size is now derived from the MANA_QUERY_VPORT_CONFIG and the > indirection table is allocated dynamically. >

Re: [PATCH v3] PCI/sysfs: Change read permissions for VPD attributes

2024-12-03 Thread Leon Romanovsky
On Tue, Dec 03, 2024 at 02:36:25PM -0600, Bjorn Helgaas wrote: > [+cc Linux hardening folks for any security/reliability concerns] > > On Tue, Dec 03, 2024 at 07:40:27PM +0200, Leon Romanovsky wrote: > > On Tue, Dec 03, 2024 at 09:24:56AM -0800, Stephen Hemminger wrote: > >