Message ID | 20190430053030.27009-2-steffen.klassert@secunet.com |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | [01/12] xfrm: policy: Fix out-of-bound array accesses in __xfrm_policy_unlink | expand |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index a131f9ff979e..8d4d52fd457b 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -1424,7 +1424,7 @@ static int verify_newpolicy_info(struct xfrm_userpolicy_info *p) ret = verify_policy_dir(p->dir); if (ret) return ret; - if (p->index && ((p->index & XFRM_POLICY_MAX) != p->dir)) + if (p->index && (xfrm_policy_id2dir(p->index) != p->dir)) return -EINVAL; return 0;