Re: [PATCH net-next 1/3] net: selftests: use skb_share_check() in the loopback receive hook
From: Maxime Chevallier
Date: Thu Oct 15 2026 - 03:47:13 EST
Hi,
On 10/9/26 08:49, Nicolai Buchwitz wrote:
> Hi Clashiko
>
[...]
>>
>> Could an IPv4 frame that arrives during ethtool -t make the hook read up
>> to about 64 bytes past skb->tail? Examples would be a minimum-size TCP
>> segment or a frame with ihl=15.
>>
>> The over-read seems to stay inside the skb head allocation, because
>> skb_shared_info follows skb->end. If so, the only effect is a possibly
>> wrong selftest result.
>
> The length check is pre-existing, will address that in a follow-up patch.
I'm unsure about this, Can we instead assume that when one is running the
"ethtool -t" selftests on a machine, they are doing so in some controlled
conditions ?
IOW can we take the assumption that we won't get incoming traffic at the same
time as we run the selftests, and if we do get some and that triggers a wrong
result, this is expected ? ethtool selftests are very cheap to run, only a
handful of seconds, and don't require any extra dependency, it doesn't cost
much to re-run them if something unexpected happens during them.
ofc. getting a stray frame during the selftests mustn't crash :)
That's my take on these tests, but feel free to disagree :)
Maxime