[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130117.154622.1758706863368180089.davem@davemloft.net>
Date: Thu, 17 Jan 2013 15:46:22 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: nickolai@...il.mit.edu
Cc: steffen.klassert@...unet.com, herbert@...dor.hengli.com.au,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net/xfrm/xfrm_replay: avoid division by zero
From: Nickolai Zeldovich <nickolai@...il.mit.edu>
Date: Thu, 17 Jan 2013 13:58:28 -0500
> 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@...il.mit.edu>
I'm assuming Steffen will take care of this patch.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists