[PATCH net v2] net: ethernet: mtk_eth_soc: fix memory leak in LRO rings release
Elad Yifee
eladwf at gmail.com
Mon Aug 12 09:32:40 PDT 2024
On Mon, Aug 12, 2024 at 6:34 PM Felix Fietkau <nbd at nbd.name> wrote:
>
> On 12.08.24 17:21, Elad Yifee wrote:
> > For LRO we allocate more than one page, yet 'skb_free_frag' is used
> > to free the buffer, which only frees a single page.
> > Fix it by using 'free_pages' instead.
> >
> > Fixes: 2f2c0d2919a1 ("net: ethernet: mtk_eth_soc: fix misuse of mem alloc interface netdev[napi]_alloc_frag")
> > Signed-off-by: Elad Yifee <eladwf at gmail.com>
>
> Are you sure about this change? From what I can see, the LRO buffer is
> (or at least should be) allocated as a compound page. Because of that,
> skb_free_frag should work on it. If it doesn't, wouldn't we run into the
> same issue when the network stack frees received packets?
>
> - Felix
>
Hey Felix,
I encountered this problem while testing the HWLRO operation on NETSYS3,
but it was part of a series of changes, so you’re right, with GFP_COMP
it shouldn’t be a problem. I automatically assumed it was a necessary
fix.
Sorry for the mess, I'll continue testing HWLRO and resubmit this
patch if I still find it necessary.
More information about the Linux-mediatek
mailing list