[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201016140036.GC456889@lunn.ch>
Date: Fri, 16 Oct 2020 16:00:36 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Christian Eggers <ceggers@...i.de>
Cc: Woojung Huh <woojung.huh@...rochip.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: dsa: ksz: don't pad a cloned sk_buff
On Fri, Oct 16, 2020 at 09:35:27AM +0200, Christian Eggers wrote:
> If the supplied sk_buff is cloned (e.g. in dsa_skb_tx_timestamp()),
> __skb_put_padto() will allocate a new sk_buff with size = skb->len +
> padlen. So the condition just tested for (skb_tailroom(skb) >= padlen +
> len) is not fulfilled anymore. Although the real size will usually be
> larger than skb->len + padlen (due to alignment), there is no guarantee
> that the required memory for the tail tag will be available
>
> Instead of letting __skb_put_padto allocate a new (too small) sk_buff,
> lets take the already existing path and allocate a new sk_buff ourself
> (with sufficient size).
Hi Christian
What is not clear to me is why not change the __skb_put_padto() call
to pass the correct length?
Andrew
Powered by blists - more mailing lists