[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH net-next v3 02/15] net: skbuff: add skb_checksum_full() that reports failure
- To: Josef Bacik <josef@xxxxxxxxxxxxxx>
- From: Mina Almasry <almasrymina@xxxxxxxxxx>
- Date: Mon, 2 Nov 2026 18:44:46 -0800
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=89u8IRsq+x1BWnVnaXXxXmgEHUj3lM/X6xy8lftQEfg=; fh=B9/BLIodQZGFYGLWq1hKAuTm9BXycMn7R1ZbSwKN4y0=; b=j7YtjbmRuAId+wDnMenyoxPglUE8azV4Ism6PNHQXJ6g0btMPiLTtV4G5YMO2YownF 6RqwLRdZmmFoiA+fUK0pL9INHmlJxs/Deyjv2EcJuhAT164uvUfp6izxWfrkQgVewM68 EaFSzP4gemGHsQ3eSb0DzL92cDjKQMH4ypdLez6D3vubj38ZOJ8x5HOR5j0SrirlJTl7 UUoEumK+NzZ/UDEwZToPeGpbPu2jVbECjT90LbD9eHMl6nzIZwymQYtJ1USpnx/wls5z a0iA2neOtOvW7uVdsvV/jOwnbBFN1Kq1drC2y9w0gO95otlAl9ryAS9D02PsDBxLdfpM wmqA==; darn=lists.xenproject.org
- Arc-seal: i=1; a=rsa-sha256; t=1793673898; cv=none; d=google.com; s=arc-20260327; b=MSmtkckGjT2xhwopyfKk6km5Zh6lZsVquu4WtirCMQrE+KwoQ6t9dcjB/6ryCwpdxe pACryxFieZ+yVwLtu+ZTnCAOmkQjh+W+HM+QB/IfpjLpKFzv9ZmBeJo7/Jj0HAfLW0Yw qEbEMvputhYFPUnlqTUOVBLdlan+cNLuOvSylasbzK3ss/RCu3RKb2/vq5A0IpKb4dwv ZRilxp0gb5g07lW3kb63iPHxwBarNIeNTNzomM5p9fTCbGyqJs0mc3/xOC4VaxgbBQRn 84shX++eyeQZR0jC6Xc1ViFFqtC7xAi5z5atFJ7j1lO28GQ7YRQGKNeqnLKMr2DIyujz zpvQ==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20260707 header.d=google.com header.i="@google.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
- Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>, Eric Dumazet <edumazet@xxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Paolo Abeni <pabeni@xxxxxxxxxx>, Simon Horman <horms@xxxxxxxxxx>, Andrew Lunn <andrew+netdev@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Willem de Bruijn <willemdebruijn.kernel@xxxxxxxxx>, Fernando Fernandez Mancera <fmancera@xxxxxxx>, David Laight <david.laight.linux@xxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Tue, 03 Nov 2026 02:45:05 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Nov 2, 2026 at 6:28 PM Josef Bacik <josef@xxxxxxxxxxxxxx> wrote:
>
> skb_checksum() can't fail. When the range runs into unreadable frags or
> past the end of the skb, skb_checksum() returns 0, which is also a valid
> checksum, so its callers can't tell a sum from a failure.
>
> Add skb_checksum_full(), which adds the range's sum to *@csump and
> returns 0. On failure it leaves *@csump alone and returns -EFAULT, or
> -EINVAL for a negative length. It is __must_check. Its frag_list loop
> sits in a noinline function so that taking the address of a local
> doesn't give skb_checksum_full() a stack protector.
>
> skb_checksum() becomes a wrapper for the callers that aren't converted
> yet, and still returns 0 on failure. Three things change for them:
>
Hmm, but do we really want this intermediate state where skb_checksum
and skb_checksum_full exist? Why not fix it in one go rather than
little by little?
--
Thanks,
Mina
|