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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1364337095-19663-1-git-send-email-zenczykowski@gmail.com>
Date:	Tue, 26 Mar 2013 15:31:35 -0700
From:	Maciej Żenczykowski <zenczykowski@...il.com>
To:	Maciej Żenczykowski <maze@...gle.com>,
	"David S. Miller" <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>,
	Mike Dalton <mwdalton@...gle.com>,
	Brian Haley <brian.haley@...com>
Subject: [PATCH] ipv6: fix raw socket checksum for udplite

From: Maciej Żenczykowski <maze@...gle.com>

Commit d3a1be9cba86 from Brian Haley in Nov 2006
"[IPv6]: Only modify checksum for UDP" forgot about
UDPLITE.

(Not clear if this fix is sufficient for udp over raw6 socket
checksumming in kernel to be useful, but it's obviously wrong
as is.)

RFC 3828 section 3.1, 3rd paragraph:

If the computed checksum is 0, it is transmitted as all ones
(the equivalent in one's complement arithmetic).

Signed-off-by: Maciej Żenczykowski <maze@...gle.com>
Cc: Eric Dumazet <edumazet@...gle.com>
Cc: Mike Dalton <mwdalton@...gle.com>
Cc: Brian Haley <brian.haley@...com>
---
 net/ipv6/raw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index eedff8ccded5..745e925eff17 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -590,7 +590,8 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
 	csum = csum_ipv6_magic(&fl6->saddr, &fl6->daddr,
 			       total_len, fl6->flowi6_proto, tmp_csum);
 
-	if (csum == 0 && fl6->flowi6_proto == IPPROTO_UDP)
+	if (csum == 0 && (fl6->flowi6_proto == IPPROTO_UDP
+	    || fl6->flowi6_proto == IPPROTO_UDPLITE))
 		csum = CSUM_MANGLED_0;
 
 	if (skb_store_bits(skb, offset, &csum, 2))
-- 
1.8.1.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ