xfrm: fix sa selector validation
Subsystems (3)
PATCH 1/1 xfrm: fix sa selector validation
After commit b38ff4075a80, 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 b38ff4075a80 ("xfrm: Fix xfrm sel prefix length validation")
CC Anirudh Gupta <[email protected]>
Signed-off-by Nicolas Dichtel <[email protected]>
--- net/xfrm/xfrm_user.c | 3 +++ 1 file changed, 3 insertions(+)
net/xfrm/xfrm_user.c +3 -0
@@ -166,6 +166,9 @@ static int verify_newsa_info(struct xfrm_usersa_info *p, }switch (p->sel.family) { +case AF_UNSPEC : +break ; +case AF_INET :if (p->sel.prefixlen_d >32 || p->sel.prefixlen_s >32 ) goto out;
Signature · 1 line
2.21.0
Quoted 11 lines · Nicolas Dichtel
After commit
b38ff4075a80, 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 align4In fact, the selector is not mandatory, allow the user to provide an empty selector.
Fixes b38ff4075a80 ("xfrm: Fix xfrm sel prefix length validation")CC Anirudh Gupta <[email protected]>Signed-off-by Nicolas Dichtel <[email protected]>
Acked-by Herbert Xu <[email protected]>
Sorry for not catching this!
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Steffen Klassert
maintainerQuoted 6 lines · Herbert Xu
Quoted 5 lines · Nicolas Dichtel
After commit
b38ff4075a80, 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
Quoted 8 lines
Quoted 6 lines
In fact, the selector is not mandatory, allow the user to provide an empty selector.
Fixes b38ff4075a80 ("xfrm: Fix xfrm sel prefix length validation")CC Anirudh Gupta <[email protected]>Signed-off-by Nicolas Dichtel <[email protected]>Acked-by Herbert Xu <[email protected]>
Patch applied, thanks everyone!