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]
Date:	Tue, 27 Jan 2015 16:25:16 +0100
From:	Karl Beldan <karl.beldan@...il.com>
To:	unlisted-recipients:; (no To-header on input)
Cc:	Karl Beldan <karl.beldan@...il.com>,
	Karl Beldan <karl.beldan@...ierawaves.com>,
	Mike Frysinger <vapier@...too.org>,
	Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
	Stable <stable@...r.kernel.org>
Subject: [PATCH] lib/checksum.c: fix carry in csum_tcpudp_nofold

The carry from the 64->32bits folding was dropped, e.g with:
saddr=0xFFFFFFFF daddr=0xFF0000FF len=0xFFFF proto=0 sum=1

Signed-off-by: Karl Beldan <karl.beldan@...ierawaves.com>
Cc: Mike Frysinger <vapier@...too.org>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: linux-kernel@...r.kernel.org
Cc: Stable <stable@...r.kernel.org>
---
 lib/checksum.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/checksum.c b/lib/checksum.c
index 129775e..4b5adf2 100644
--- a/lib/checksum.c
+++ b/lib/checksum.c
@@ -195,8 +195,8 @@ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
 #else
 	s += (proto + len) << 8;
 #endif
-	s += (s >> 32);
-	return (__force __wsum)s;
+	s += (s << 32) + (s >> 32);
+	return (__force __wsum)(s >> 32);
 }
 EXPORT_SYMBOL(csum_tcpudp_nofold);
 #endif
-- 
2.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ