Re: [PATCH net v2] net: skbuff: make skb_copy_and_csum_bits() report unreadable frags
From: Josef Bacik
Date: Wed Oct 14 2026 - 13:54:44 EST
On Wed, Oct 14, 2026 at 12:52 PM Josef Bacik <josef@xxxxxxxxxxxxxx> wrote:
> ...ERR_PTR would be fine too? I'm arguing for explicit return values,
> not "0 means failure". But I don't care enough to argue, I'm
> respinning. Thanks,
I respun it with the sum starting from ~0, and it changes what goes on
the wire, so I was wrong above about ~0 not changing the folded result.
csum_add(~0, 0) stays ~0, and csum_fold(~0) is 0x0000 where
csum_fold(0) is 0xffff. No other 32 bit value folds to 0xffff, so
there's no non-zero value that can stand in for a zero sum. ICMPv4
folds the raw sum with no pseudo-header, so an echo request with id 0,
seq 0 and an all-zero payload gets a reply with a checksum of 0x0000
instead of 0xffff, and the sender drops it. I checked that on
loopback: the reply has 0xffff with v2 and 0x0000 with the ~0 seed.
So 0 can't mean failure here without changing checksums, and v3 will
keep the explicit error return from v2.
Thanks,
Josef