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

2023-09-15 Thread Gustavo A. R. Silva
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-coded arithmetic cannot cause an overflow/wraparound. (i.e. it will stay saturated at

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

2023-09-14 Thread Kees Cook
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-coded arithmetic cannot cause an overflow/wraparound. (i.e. it will stay saturated at SIZE_MAX.) > > Fixes: 467f432a521a

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

2023-09-11 Thread Gustavo A. R. Silva
Harden calls to struct_size() with size_add() and size_mul(). Fixes: 467f432a521a ("RDMA/core: Split port and device counter sysfs attributes") Fixes: a4676388e2e2 ("RDMA/core: Simplify how the gid_attrs sysfs is created") Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Update