aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Zumbiehl <florz@florz.de>2007-04-20 19:58:14 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:29:20 -0400
commit202a03acf9994076055df40ae093a5c5474ad0bd (patch)
tree293b06b3c8789cf9df053d6ab1da70dcdecd1f75
parent74b885cf86def9bc836772e3c1788c00b72a35c9 (diff)
[PPPOE]: memory leak when socket is release()d before PPPIOCGCHAN has been called on it
below you find a patch that fixes a memory leak when a PPPoE socket is release()d after it has been connect()ed, but before the PPPIOCGCHAN ioctl ever has been called on it. This is somewhat of a security problem, too, since PPPoE sockets can be created by any user, so any user can easily allocate all the machine's RAM to non-swappable address space and thus DoS the system. Is there any specific reason for PPPoE sockets being available to any unprivileged process, BTW? After all, you need a packet socket for the discovery stage anyway, so it's unlikely that any unprivileged process will ever need to create a PPPoE socket, no? Allocating all session IDs for a known AC is a kind of DoS, too, after all - with Juniper ERXes, this is really easy, actually, since they don't ever assign session ids above 8000 ... Signed-off-by: Florian Zumbiehl <florz@florz.de> Acked-by: Michal Ostrowski <mostrows@earthlink.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/pppox.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c
index 9315046b3f55..3f8115db4d54 100644
--- a/drivers/net/pppox.c
+++ b/drivers/net/pppox.c
@@ -58,7 +58,7 @@ void pppox_unbind_sock(struct sock *sk)
58{ 58{
59 /* Clear connection to ppp device, if attached. */ 59 /* Clear connection to ppp device, if attached. */
60 60
61 if (sk->sk_state & (PPPOX_BOUND | PPPOX_ZOMBIE)) { 61 if (sk->sk_state & (PPPOX_BOUND | PPPOX_CONNECTED | PPPOX_ZOMBIE)) {
62 ppp_unregister_channel(&pppox_sk(sk)->chan); 62 ppp_unregister_channel(&pppox_sk(sk)->chan);
63 sk->sk_state = PPPOX_DEAD; 63 sk->sk_state = PPPOX_DEAD;
64 } 64 }