Re: [PATCH net] net: prevent pulling SKB_GSO_FRAGLIST skb

From: Jakub Kicinski
Date: Mon Apr 29 2024 - 09:42:20 EST


On Sun, 28 Apr 2024 22:29:13 +0800 shiming.cheng@xxxxxxxxxxxx wrote:
> From: Shiming Cheng <shiming.cheng@xxxxxxxxxxxx>
>
> BPF or TC callers may pull in a length longer than skb_headlen()
> for a SKB_GSO_FRAGLIST skb. The data in fraglist will be pulled
> into the linear space. However it destroys the skb's structure
> and may result in an invalid segmentation or kernel exception.
>
> So we should add protection to stop the operation and return
> error to remind callers.

One of the fixes you posted breaks the

tools/testing/selftests/net/udpgro_fwd.sh

selftest. Please investigate, and either adjust the test or the fix.