Skip to contentSkip to conversation

packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE

PATCH Applied Willem de Bruijn 2 participants 2 messages Nov 28, 2022 – Nov 29, 2022

Subsystems (3)
lore
Share & tools
lore

Willem de Bruijn

author maintainer
#0 lore raw

PATCH 1/1 packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE

From: Willem de Bruijn <[email protected]>

CHECKSUM_COMPLETE signals that skb->csum stores the sum over the entire packet. It does not imply that an embedded l4 checksum field has been validated.

Fixes 682f048bd494 ("af_packet: pass checksum validation status to the user")
---
 net/packet/af_packet.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
net/packet/af_packet.c +2 -4
index 6ce8dd19f33c..1ab65f7f2a0a 100644
@@ -2293,8 +2293,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
 	if (skb->ip_summed == CHECKSUM_PARTIAL)
 		status |= TP_STATUS_CSUMNOTREADY;
 	else if (skb->pkt_type != PACKET_OUTGOING &&
-		 (skb->ip_summed == CHECKSUM_COMPLETE ||
-		  skb_csum_unnecessary(skb)))
+		 skb_csum_unnecessary(skb))
 		status |= TP_STATUS_CSUM_VALID;
 
 	if (snaplen > res)
@@ -3520,8 +3519,7 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 		if (skb->ip_summed == CHECKSUM_PARTIAL)
 			aux.tp_status |= TP_STATUS_CSUMNOTREADY;
 		else if (skb->pkt_type != PACKET_OUTGOING &&
-			 (skb->ip_summed == CHECKSUM_COMPLETE ||
-			  skb_csum_unnecessary(skb)))
+			 skb_csum_unnecessary(skb))
 			aux.tp_status |= TP_STATUS_CSUM_VALID;
 
 		aux.tp_len = origlen;
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
#1 lore raw
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Mon, 28 Nov 2022 11:18:12 -0500 you wrote:

From: Willem de Bruijn <[email protected]>

CHECKSUM_COMPLETE signals that skb->csum stores the sum over the entire packet. It does not imply that an embedded l4 checksum field has been validated.

Fixes 682f048bd494 ("af_packet: pass checksum validation status to the user")

[...]

Here is the summary with links:
- [net] packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE

    https://git.kernel.org/netdev/net/c/b85f628aa158

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html