Thread (11 messages) flat view 11 messages, 7 authors, 2021-02-17

Re: [PATCH] net: dsa: tag_rtl4_a: Support also egress tags

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: 2021-02-17 14:20:56

On 17.02.2021 13:42, Vladimir Oltean wrote:
On Wed, Feb 17, 2021 at 08:38:30PM +0800, DENG Qingfang wrote:
quoted
On Wed, Feb 17, 2021 at 7:55 AM Linus Walleij [off-list ref] wrote:
quoted
+
+       /* Pad out to at least 60 bytes */
+       if (unlikely(eth_skb_pad(skb)))
+               return NULL;
I just found that this will cause double free (eth_skb_pad will free
the skb if allocation fails, and dsa_slave_xmit will still try to free
it because it returns NULL.
Replace eth_skb_pad(skb) with __skb_put_padto(skb, ETH_ZLEN, false) to
avoid that.
That's really a pitfall. I had to do the same in r8169:
cc6528bc9a0c ("r8169: fix potential skb double free in an error path")
Good catch, Qingfang.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help