mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
xfrm_user: verify policy direction at XFRM_MSG_POLEXPIRE handler
Add missing check for policy direction verification. This is especially important since without this xfrm_user may end up deleting per-socket policy which is not allowed. Signed-off-by: Timo Teras <timo.teras@iki.fi> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
34996cb91d
commit
c8bf4d04f9
1 changed files with 4 additions and 0 deletions
|
@ -1741,6 +1741,10 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
err = verify_policy_dir(p->dir);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (p->index)
|
||||
xp = xfrm_policy_byid(net, mark, type, p->dir, p->index, 0, &err);
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue