lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230717185533.GA8808@unreal>
Date: Mon, 17 Jul 2023 21:55:33 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Yuanjun Gong <ruc_gongyuanjun@....com>
Cc: Saeed Mahameed <saeedm@...dia.com>, Boris Pismenny <borisp@...dia.com>,
	netdev@...r.kernel.org
Subject: Re: [PATCH 1/1] drivers:net: fix return value check in
 mlx5e_ipsec_remove_trailer

On Mon, Jul 17, 2023 at 10:46:40PM +0800, Yuanjun Gong wrote:
> mlx5e_ipsec_remove_trailer should return an error code if function
> pskb_trim returns an unexpected value.
> 
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@....com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Please add fixes line, change title to be "net/mlx5e: ...." instead of
"drivers:..." and target tree which is "net".

Thanks

> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c
> index eab5bc718771..8d995e304869 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c
> @@ -58,7 +58,9 @@ static int mlx5e_ipsec_remove_trailer(struct sk_buff *skb, struct xfrm_state *x)
>  
>  	trailer_len = alen + plen + 2;
>  
> -	pskb_trim(skb, skb->len - trailer_len);
> +	ret = pskb_trim(skb, skb->len - trailer_len);
> +	if (unlikely(ret))
> +		return ret;
>  	if (skb->protocol == htons(ETH_P_IP)) {
>  		ipv4hdr->tot_len = htons(ntohs(ipv4hdr->tot_len) - trailer_len);
>  		ip_send_check(ipv4hdr);
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ