Subject: Re: r8169: Crash with TX segmentation offload on RTL8125

From: Jakub Kicinski <[email-masked]>
Date: Wed, 22 May 2024 06:55:50 -0700

On Fri, 17 May 2024 15:21:00 -0700 Florian Fainelli wrote:
> > The patch below fixes the problem, by simply reading nr_frags a bit later, after the checksum stage.  
> 
> Yeah, that's an excellent catch and one that is bitten us before, too:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=20d1f2d1b024f6be199a3bedf1578a1d21592bc5
> 
> unclear what we would do in skb_shinfo() to help driver writers, rather 
> than rely upon code inspection to find such bugs.

I wonder if we should add a "error injection" hook under DEBUG_NET
to force re-allocation of skbs in any helper which may cause it?