Files
kernel_google_wahoo/include/net
Cong Wang e1b22f7a0b xfrm: clean up xfrm protocol checks
commit dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399 upstream.

In commit 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
I introduced a check for xfrm protocol, but according to Herbert
IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so
it should be removed from validate_tmpl().

And, IPSEC_PROTO_ANY is expected to only match 3 IPSec-specific
protocols, this is why xfrm_state_flush() could still miss
IPPROTO_ROUTING, which leads that those entries are left in
net->xfrm.state_all before exit net. Fix this by replacing
IPSEC_PROTO_ANY with zero.

This patch also extracts the check from validate_tmpl() to
xfrm_id_proto_valid() and uses it in parse_ipsecrequest().
With this, no other protocols should be added into xfrm.

Fixes: 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
Reported-by: syzbot+0bf0519d6e0de15914fe@syzkaller.appspotmail.com
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Zubin Mithra <zsm@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-16 08:13:35 +02:00
..
2018-09-29 03:08:51 -07:00
2019-03-23 08:44:34 +01:00
2014-09-18 10:54:36 +02:00
2019-02-23 09:05:14 +01:00
2018-10-20 09:52:36 +02:00
2015-03-06 21:50:02 -05:00
2015-09-17 17:18:37 -07:00
2018-02-25 11:03:34 +01:00
2017-06-07 12:05:59 +02:00
2014-09-30 01:02:26 -04:00
2019-03-23 08:44:23 +01:00
2019-03-23 08:44:23 +01:00
2019-02-08 11:25:31 +01:00
2015-10-08 04:27:03 -07:00
2015-10-23 06:26:42 -07:00
2018-05-16 10:06:50 +02:00
2018-02-25 11:03:40 +01:00
2015-03-12 22:58:12 -04:00
2015-10-26 22:24:22 -07:00
2019-09-16 08:13:35 +02:00