Subject: Re: [PATCH mlx5-next 1/3] net/mlx5: Refactor query port speed functions

From: Jason Gunthorpe <[email-masked]>
Date: Thu, 27 Aug 2020 09:45:40 -0300

On Mon, Aug 24, 2020 at 01:58:24PM +0300, Leon Romanovsky wrote:

> @@ -490,7 +490,7 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num,
>  	props->active_width     = IB_WIDTH_4X;
>  	props->active_speed     = IB_SPEED_QDR;
>  
> -	translate_eth_proto_oper(eth_prot_oper, &props->active_speed,
> +	translate_eth_proto_oper(eth_prot_oper, (u16 *)&props->active_speed,
>  				 &props->active_width, ext);

This is memory corruption, put it on a stack u16 then truncate it.

Jason