[PATCH net v2] net: ethernet: mtk_eth_soc: fix memory leak in LRO rings release

Felix Fietkau nbd at nbd.name
Mon Aug 12 08:34:12 PDT 2024


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




More information about the Linux-mediatek mailing list