Thread (1 message) 1 message, 1 author, 2023-10-20

Re: AW: [PATCH] amd64: Fix csum_partial_copy_generic()

From: Vincent Whitchurch <hidden>
Date: 2023-10-20 08:33:10
Also in: lkml

On Thu, 2023-10-19 at 09:06 +0100, Al Viro wrote:
quoted hunk
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index b8607763d113..6da09157f722 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -376,6 +376,7 @@ static void icmp_push_reply(struct sock *sk,
 	} else if ((skb = skb_peek(&sk->sk_write_queue)) != NULL) {
 		struct icmphdr *icmph = icmp_hdr(skb);
 		__wsum csum;
+		__sum16 folded;
 		struct sk_buff *skb1;
 

 		csum = csum_partial_copy_nocheck((void *)&icmp_param->data,
@@ -384,7 +385,8 @@ static void icmp_push_reply(struct sock *sk,
 		skb_queue_walk(&sk->sk_write_queue, skb1) {
 			csum = csum_add(csum, skb1->csum);
 		}
-		icmph->checksum = csum_fold(csum);
+		folded = csum_fold(csum);
+		icmph->checksum = folded ? folded : CSUM_MANGLED_0;
 		skb->ip_summed = CHECKSUM_NONE;
 		ip_push_pending_frames(sk, fl4);
 	}
32-bit ARM is also affected since commit 1d60be3c25edf4b95 ("arm:
propagate the calling convention changes down to
csum_partial_copy_from_user()").

While the above fixes the ICMP reply case, are there other callers that
also need similar changes?  For example, I see net/sched/act_csum.c also
calculating ICMP checksums?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help