1 |
slords |
1.1 |
From 44315cc76567e2d911d56091665637e305af182d Mon Sep 17 00:00:00 2001 |
2 |
|
|
From: Konstantin Sharlaimov <konstantin.sharlaimov@gmail.com> |
3 |
|
|
Date: Mon, 24 Sep 2007 23:01:54 +0200 |
4 |
|
|
Subject: [PATCH] [PPP]: Fix osize too small errors when decoding mppe. |
5 |
|
|
|
6 |
|
|
The mppe_decompress() function required a buffer that is 1 byte too |
7 |
|
|
small when receiving a message of mru size. This fixes buffer |
8 |
|
|
allocation to prevent this from occurring. |
9 |
|
|
|
10 |
|
|
Signed-off-by: Konstantin Sharlaimov <konstantin.sharlaimov@gmail.com> |
11 |
|
|
Signed-off-by: David S. Miller <davem@davemloft.net> |
12 |
|
|
Signed-off-by: Adrian Bunk <bunk@kernel.org> |
13 |
|
|
--- |
14 |
|
|
drivers/net/ppp_generic.c | 13 ++++++++++++- |
15 |
|
|
1 files changed, 12 insertions(+), 1 deletions(-) |
16 |
|
|
|
17 |
|
|
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c |
18 |
|
|
index e37648c..802f249 100644 |
19 |
|
|
--- a/drivers/net/ppp_generic.c |
20 |
|
|
+++ b/drivers/net/ppp_generic.c |
21 |
|
|
@@ -1721,7 +1721,18 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb) |
22 |
|
|
goto err; |
23 |
|
|
|
24 |
|
|
if (proto == PPP_COMP) { |
25 |
|
|
- ns = dev_alloc_skb(ppp->mru + PPP_HDRLEN); |
26 |
|
|
+ int obuff_size; |
27 |
|
|
+ |
28 |
|
|
+ switch(ppp->rcomp->compress_proto) { |
29 |
|
|
+ case CI_MPPE: |
30 |
|
|
+ obuff_size = ppp->mru + PPP_HDRLEN + 1; |
31 |
|
|
+ break; |
32 |
|
|
+ default: |
33 |
|
|
+ obuff_size = ppp->mru + PPP_HDRLEN; |
34 |
|
|
+ break; |
35 |
|
|
+ } |
36 |
|
|
+ |
37 |
|
|
+ ns = dev_alloc_skb(obuff_size); |
38 |
|
|
if (ns == 0) { |
39 |
|
|
printk(KERN_ERR "ppp_decompress_frame: no memory\n"); |
40 |
|
|
goto err; |
41 |
|
|
-- |
42 |
|
|
1.6.5.1 |
43 |
|
|
|