Re: [PATCH] gro: check returned skb of napi_frags_skb() against NULL

From: Eric Dumazet
Date: Thu Jul 06 2023 - 09:53:10 EST


On Thu, Jul 6, 2023 at 3:08 PM Kaiyu Zhang <squirrel.prog@xxxxxxxxx> wrote:
>
> Some rogue network adapter and their driver pass bad skbs to GRO.
> napi_frags_skb() detects this, drops these bad skbs, and return NULL
> to napi_gro_frags(), which does not check returned skb against NULL
> and access it. This results in a kernel crash.
>
> A better approach to address these bad skbs would be to issue some
> warnings and drop them, which napi_frags_skb() already does, and
> move on without crashing the kernel.
>

Certainly not.

We are not going to try to be nice to buggy drivers.

Please fix the "rogue network adapter" instead.