mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
af_key: mark policy as dead before destroying
xfrm_policy_destroy() will oops if not dead policy is passed to it. On error path in pfkey_compile_policy() exactly this happens. Oopsable for CAP_NET_ADMIN owners. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4bab0ea1d4
commit
70e90679ff
1 changed files with 1 additions and 0 deletions
|
@ -3188,6 +3188,7 @@ static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt,
|
||||||
return xp;
|
return xp;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
xp->walk.dead = 1;
|
||||||
xfrm_policy_destroy(xp);
|
xfrm_policy_destroy(xp);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue