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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <WDTCGAs6T_1WrYWzhajhKbTIXfzTBLg0bGDdJpUkGxVMdTG4pu3AzSorhGtletaoPhEf43qQ_F6kO0dndfIfhZsc2MGwcU9indtM80T4cI0=@pm.me>
Date:   Sat, 20 Jun 2020 09:35:00 +0000
From:   Alexander Lobakin <alobakin@...me>
To:     Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc:     Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Paul Burton <paulburton@...nel.org>,
        Alexander Lobakin <alobakin@...me>, linux-mips@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH mips-next 3/3] MIPS: checksum: fix sparse flooding on asm/checksum.h

csum_fold() in MIPS' asm/checksum.h is another source of sparse flooding
when building different networking source code.
The thing is that only half of __wsum <--> u32 casts inside the funtion
is forced, which is insufficient.
Add all necessary forced typecasting to stop floods and simplify actual
bug hunting.

Signed-off-by: Alexander Lobakin <alobakin@...me>
---
 arch/mips/include/asm/checksum.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h
index dcebaaf8c862..181f7d14efb9 100644
--- a/arch/mips/include/asm/checksum.h
+++ b/arch/mips/include/asm/checksum.h
@@ -113,9 +113,9 @@ static inline __sum16 csum_fold(__wsum csum)
 	u32 sum = (__force u32)csum;
 
 	sum += (sum << 16);
-	csum = (sum < csum);
+	csum = (__force __wsum)(sum < (__force u32)csum);
 	sum >>= 16;
-	sum += csum;
+	sum += (__force u32)csum;
 
 	return (__force __sum16)~sum;
 }
-- 
2.27.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ