]> git.hungrycats.org Git - linux/commitdiff
[PATCH] CAN-2005-0384: Remote Linux DoS on ppp servers
authorPaul Mackerras <paulus@au1.ibm.com>
Tue, 15 Mar 2005 07:38:47 +0000 (23:38 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Mar 2005 07:38:47 +0000 (23:38 -0800)
Martin Schulze writes:

> Ben Martel and Stephen Blackheath have discovered a denial-of-service attack
> that a client of pppd can make that can hang the server machine.  The bug is
> in the Linux kernel 2.6 (tested on 2.6.9), but it looks like it also exists
> in the 2.4 series.

Yes, this is my bug. :(

I would just do this instead:

Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/ppp_async.c

index a48e19391208fcdc805ae51c50c62cae00bf796d..33b9d79b1aadad177ee5b4dab213199bb8de63ff 100644 (file)
@@ -1000,7 +1000,7 @@ static void async_lcp_peek(struct asyncppp *ap, unsigned char *data,
        data += 4;
        dlen -= 4;
        /* data[0] is code, data[1] is length */
-       while (dlen >= 2 && dlen >= data[1]) {
+       while (dlen >= 2 && dlen >= data[1] && data[1] >= 2) {
                switch (data[0]) {
                case LCP_MRU:
                        val = (data[2] << 8) + data[3];