]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfrm: Workaround incompatibility of ESN and async crypto
authorSteffen Klassert <steffen.klassert@secunet.com>
Tue, 4 Sep 2012 00:03:29 +0000 (00:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2012 20:46:58 +0000 (05:46 +0900)
commitdbf8195072fe92708d740d23095b835a11adab93
treeb1d8eb63982c6f6bf3c62c85e89a1888faba0761
parent3ccda9bc19a76edeea574127be4478648426f3d2
xfrm: Workaround incompatibility of ESN and async crypto

[ Upstream commit 3b59df46a449ec9975146d71318c4777ad086744 ]

ESN for esp is defined in RFC 4303. This RFC assumes that the
sequence number counters are always up to date. However,
this is not true if an async crypto algorithm is employed.

If the sequence number counters are not up to date on sequence
number check, we may incorrectly update the upper 32 bit of
the sequence number. This leads to a DOS.

We workaround this by comparing the upper sequence number,
(used for authentication) with the upper sequence number
computed after the async processing. We drop the packet
if these numbers are different.

To do this, we introduce a recheck function that does this
check in the ESN case.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/xfrm.h
net/xfrm/xfrm_input.c
net/xfrm/xfrm_replay.c