]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Sep 2012 18:09:45 +0000 (14:09 -0400)
commit0e99cf1a3ff0827345fc4e4fe04088158958df3f
tree8ba7e6186ef90c4bffe553504c33f40054704f94
parent73cbbe2ba5386d6c1993c95adcb4a5f6f492e572
xfrm: Workaround incompatibility of ESN and async crypto

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>
include/net/xfrm.h
net/xfrm/xfrm_input.c
net/xfrm/xfrm_replay.c