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: <20171013070121.dzcncojuj2f4utij@mwanda>
Date:   Fri, 13 Oct 2017 10:01:22 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Ingo Molnar <mingo@...hat.com>,
        luca abeni <luca.abeni@...tannapisa.it>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH] sched/deadline: Don't use dubious signed bitfields

It doesn't cause a run-time bug, but these bitfields should be unsigned.
When it's signed ->dl_throttled is set to either 0 or -1, instead of
0 and 1 as expected.  The sched.h file is included into tons of places
so Sparse generates a flood of warnings like this:

./include/linux/sched.h:477:54: error: dubious one-bit signed bitfield

Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0f897dfc195e..105eaff8a5e7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -474,10 +474,10 @@ struct sched_dl_entity {
 	 * conditions between the inactive timer handler and the wakeup
 	 * code.
 	 */
-	int				dl_throttled      : 1;
-	int				dl_boosted        : 1;
-	int				dl_yielded        : 1;
-	int				dl_non_contending : 1;
+	unsigned int			dl_throttled      : 1;
+	unsigned int			dl_boosted        : 1;
+	unsigned int			dl_yielded        : 1;
+	unsigned int			dl_non_contending : 1;
 
 	/*
 	 * Bandwidth enforcement timer. Each -deadline task has its

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ