[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230717193259.98375-1-kuniyu@amazon.com>
Date: Mon, 17 Jul 2023 12:32:59 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <ruc_gongyuanjun@....com>
CC: <ajit.khaparde@...adcom.com>, <netdev@...r.kernel.org>,
<somnath.kotur@...adcom.com>, <sriharsha.basavapatna@...adcom.com>,
<kuniyu@...zon.com>
Subject: Re: [PATCH 1/1] drivers:net: fix return value check in be_lancer_xmit_workarounds
From: Yuanjun Gong <ruc_gongyuanjun@....com>
Date: Mon, 17 Jul 2023 22:45:32 +0800
> in be_lancer_xmit_workarounds, it should go to label 'err' if
> an unexpected value is returned by pskb_trim.
>
Fixes tag needed here.
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@....com>
> ---
> drivers/net/ethernet/emulex/benet/be_main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
> index 18c2fc880d09..eba29a2e0e8b 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -1138,7 +1138,8 @@ static struct sk_buff *be_lancer_xmit_workarounds(struct be_adapter *adapter,
> (lancer_chip(adapter) || BE3_chip(adapter) ||
> skb_vlan_tag_present(skb)) && is_ipv4_pkt(skb)) {
> ip = (struct iphdr *)ip_hdr(skb);
> - pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len));
> + if (unlikely(pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len))))
> + goto err;
This should be `goto tx_drop`, or we'll leak skb.
> }
>
> /* If vlan tag is already inlined in the packet, skip HW VLAN
> --
> 2.17.1
Powered by blists - more mailing lists