Unverified Commit e06ee045 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13157 xfrm: validate new SA's prefixlen using SA family when sel.family is unset

parents 2b61c887 779b82b8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -149,6 +149,7 @@ static int verify_newsa_info(struct xfrm_usersa_info *p,
			     struct nlattr **attrs)
{
	int err;
	u16 family = p->sel.family;

	err = -EINVAL;
	switch (p->family) {
@@ -167,7 +168,10 @@ static int verify_newsa_info(struct xfrm_usersa_info *p,
		goto out;
	}

	switch (p->sel.family) {
	if (!family && !(p->flags & XFRM_STATE_AF_UNSPEC))
		family = p->family;

	switch (family) {
	case AF_UNSPEC:
		break;