lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <FRAPR01MB11703F861DE24373440FD1C0FA430@FRAPR01MB1170.DEUPRD01.PROD.OUTLOOK.DE>
Date:   Fri, 22 Mar 2019 14:34:58 +0000
From:   <Markus.Amend@...ekom.de>
To:     <gerrit@....abdn.ac.uk>
CC:     <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
        <dccp@...r.kernel.org>
Subject: [PATCH] net: dccp: Checksum verification considering skb->ip_summed

Modify checksum verification to allow the validation of skb->ip_summed, in case the checksum has already been verified by another process.

Signed-off-by: Nathalie Romo Moreno <natha.ro.moreno@...il.com>
Signed-off-by: Markus Amend <markus.amend@...ekom.de>
---
 net/dccp/ipv4.c | 8 +++++---
 net/dccp/ipv6.c | 4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 26a21d97b6b0..0d777888efe1 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -763,8 +763,9 @@ int dccp_invalid_packet(struct sk_buff *skb)
 	}
 
 	/* If header checksum is incorrect, drop packet and return.
-	 * (This step is completed in the AF-dependent functions.) */
-	skb->csum = skb_checksum(skb, 0, cscov, 0);
+	 * (This step is completed in the AF-dependent functions.)
+	 * skb->csum = skb_checksum(skb, 0, cscov, 0);
+	 */
 
 	return 0;
 }
@@ -786,7 +787,8 @@ static int dccp_v4_rcv(struct sk_buff *skb)
 
 	iph = ip_hdr(skb);
 	/* Step 1: If header checksum is incorrect, drop packet and return */
-	if (dccp_v4_csum_finish(skb, iph->saddr, iph->daddr)) {
+	if (__skb_checksum_validate(skb, IPPROTO_DCCP,
+		  true, false, 0, inet_compute_pseudo)) {
 		DCCP_WARN("dropped packet with invalid checksum\n");
 		goto discard_it;
 	}
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index d5740bad5b18..7cb7c9f3e5e1 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -695,8 +695,8 @@ static int dccp_v6_rcv(struct sk_buff *skb)
 		goto discard_it;
 
 	/* Step 1: If header checksum is incorrect, drop packet and return. */
-	if (dccp_v6_csum_finish(skb, &ipv6_hdr(skb)->saddr,
-				     &ipv6_hdr(skb)->daddr)) {
+	if (__skb_checksum_validate(skb, IPPROTO_DCCP,
+		true, false, 0, ip6_compute_pseudo)) {
 		DCCP_WARN("dropped packet with invalid checksum\n");
 		goto discard_it;
 	}
--

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ