Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70e90679 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by David S. Miller
Browse files

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: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4bab0ea1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3188,6 +3188,7 @@ static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt,
	return xp;

out:
	xp->walk.dead = 1;
	xfrm_policy_destroy(xp);
	return NULL;
}