xfrm_user: validate XFRM_MSG_NEWAE incoming ESN size harder
authorAndy Whitcroft <apw@canonical.com>
Thu, 23 Mar 2017 07:45:44 +0000 (07:45 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Jun 2017 22:46:47 +0000 (00:46 +0200)
commitcbd95d10ef8248a02864a45f26089553294b155d
tree76e42db2f7479e4d6cd08a01c5214d320ba15312
parentccf85441e11acf8db050d9dcd5dce61f893c454e
xfrm_user: validate XFRM_MSG_NEWAE incoming ESN size harder

commit f843ee6dd019bcece3e74e76ad9df0155655d0df upstream.

Kees Cook has pointed out that xfrm_replay_state_esn_len() is subject to
wrapping issues.  To ensure we are correctly ensuring that the two ESN
structures are the same size compare both the overall size as reported
by xfrm_replay_state_esn_len() and the internal length are the same.

CVE-2017-7184
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/xfrm/xfrm_user.c