linux/net/xfrm
Nickolai Zeldovich e2f6725917 net/xfrm/xfrm_replay: avoid division by zero
All of the xfrm_replay->advance functions in xfrm_replay.c check if
x->replay_esn->replay_window is zero (and return if so).  However,
one of them, xfrm_replay_advance_bmp(), divides by that value (in the
'%' operator) before doing the check, which can potentially trigger
a divide-by-zero exception.  Some compilers will also assume that the
earlier division means the value cannot be zero later, and thus will
eliminate the subsequent zero check as dead code.

This patch moves the division to after the check.

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
2013-01-18 06:19:49 +01:00
..
Kconfig xfrm: make xfrm_algo.c a module 2012-05-15 13:13:34 -04:00
Makefile xfrm: make xfrm_algo.c a module 2012-05-15 13:13:34 -04:00
xfrm_algo.c xfrm_algo: drop an unnecessary inclusion 2012-05-15 13:13:34 -04:00
xfrm_hash.c
xfrm_hash.h
xfrm_input.c xfrm: Workaround incompatibility of ESN and async crypto 2012-09-04 14:09:45 -04:00
xfrm_ipcomp.c net: xfrm: use __this_cpu_read per-cpu helper 2012-11-13 14:38:52 +01:00
xfrm_output.c
xfrm_policy.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-10-02 13:38:27 -07:00
xfrm_proc.c
xfrm_replay.c net/xfrm/xfrm_replay: avoid division by zero 2013-01-18 06:19:49 +01:00
xfrm_state.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-10-02 13:38:27 -07:00
xfrm_sysctl.c net: Don't export sysctls to unprivileged users 2012-11-18 20:30:55 -05:00
xfrm_user.c net: Allow userns root to control llc, netfilter, netlink, packet, and xfrm 2012-11-18 20:32:45 -05:00