linux-stable/kernel/rcu
Paul E. McKenney 5f1a6ef374 rcu: Avoid signed integer overflow in rcu_preempt_deferred_qs()
Subtracting INT_MIN can be interpreted as unconditional signed integer
overflow, which according to the C standard is undefined behavior.
Therefore, kernel build arguments notwithstanding, it would be good to
future-proof the code.  This commit therefore substitutes INT_MAX for
INT_MIN in order to avoid undefined behavior.

While in the neighborhood, this commit also creates some meaningful names
for INT_MAX and friends in order to improve readability, as suggested
by Joel Fernandes.

Reported-by: Ran Rozenstein <ranro@mellanox.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
2018-11-12 09:03:59 -08:00
..
Kconfig rcu: Clean up flavor-related definitions and comments in Kconfig 2018-08-30 16:03:32 -07:00
Kconfig.debug rcu: Move RCU debug Kconfig options to kernel/rcu 2017-06-08 18:52:44 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rcu.h Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00
rcu_segcblist.c rcu: Simplify and inline cpu_needs_another_gp() 2018-05-15 10:30:59 -07:00
rcu_segcblist.h rcu: Simplify and inline cpu_needs_another_gp() 2018-05-15 10:30:59 -07:00
rcuperf.c Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00
rcutorture.c Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00
srcutiny.c srcu: Make early-boot call_srcu() reuse workqueue lists 2018-08-30 16:10:49 -07:00
srcutree.c Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00
sync.c doc: Fix various RCU docbook comment-header problems 2017-10-19 22:26:11 -04:00
tiny.c Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00
tree.c rcu: Trace end of grace period before end of grace period 2018-11-12 09:03:59 -08:00
tree.h rcu: Convert rcu_state.ofl_lock to raw_spinlock_t 2018-08-30 16:03:54 -07:00
tree_exp.h rcu: Speed up expedited GPs when interrupting RCU reader 2018-11-12 09:03:59 -08:00
tree_plugin.h rcu: Avoid signed integer overflow in rcu_preempt_deferred_qs() 2018-11-12 09:03:59 -08:00
update.c Merge branches 'doc.2018.08.30a', 'dynticks.2018.08.30b', 'srcu.2018.08.30b' and 'torture.2018.08.29a' into HEAD 2018-08-30 16:12:53 -07:00