Re: [PATCH][next] RDMA/hfi1: Use struct_size() and flex_array_size() helpers

From: Jason Gunthorpe
Date: Mon Sep 27 2021 - 19:36:57 EST


On Mon, Sep 27, 2021 at 05:53:33PM -0500, Gustavo A. R. Silva wrote:
> Make use of the struct_size() and flex_array_size() helpers instead of
> open-coded versions, in order to avoid any potential type mistakes
> or integer overflows that, in the worse scenario, could lead to heap
> overflows.
>
> Link: https://github.com/KSPP/linux/issues/160
> Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
> ---
> drivers/infiniband/hw/hfi1/user_exp_rcv.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)

Applied to for-next, thanks

Jason