* [PATCH] af_key: mark policy as dead before destroying
@ 2008-11-07 2:49 Alexey Dobriyan
2008-11-07 7:09 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2008-11-07 2:49 UTC (permalink / raw)
To: davem; +Cc: netdev
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>
---
net/key/af_key.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3189,6 +3189,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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-07 7:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 2:49 [PATCH] af_key: mark policy as dead before destroying Alexey Dobriyan
2008-11-07 7:09 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox