]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: fix sa selector validation
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Fri, 14 Jun 2019 09:13:55 +0000 (11:13 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 17 Jun 2019 09:22:35 +0000 (11:22 +0200)
commit4adeafbb0d4b842ef715b053d1b6e38378623e9e
treec3b27de2c7e26124a1a324d09c26aba511dfb9db
parent0bacb40ed6be41cb7f48648de7bf9f8c1419a14f
xfrm: fix sa selector validation

After commit 4fbe3121a215, the following command does not work anymore:
$ ip xfrm state add src 10.125.0.2 dst 10.125.0.1 proto esp spi 34 reqid 1 \
  mode tunnel enc 'cbc(aes)' 0xb0abdba8b782ad9d364ec81e3a7d82a1 auth-trunc \
  'hmac(sha1)' 0xe26609ebd00acb6a4d51fca13e49ea78a72c73e6 96 flag align4

In fact, the selector is not mandatory, allow the user to provide an empty
selector.

Fixes: 4fbe3121a215 ("xfrm: Fix xfrm sel prefix length validation")
CC: Anirudh Gupta <anirudh.gupta@sophos.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_user.c