diff options
Diffstat (limited to 'meta/recipes-connectivity/ppp')
-rw-r--r-- | meta/recipes-connectivity/ppp/ppp/CVE-2022-4603.patch | 48 | ||||
-rw-r--r-- | meta/recipes-connectivity/ppp/ppp_2.4.9.bb | 1 |
2 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/ppp/ppp/CVE-2022-4603.patch b/meta/recipes-connectivity/ppp/ppp/CVE-2022-4603.patch new file mode 100644 index 0000000000..4325b1d6b0 --- /dev/null +++ b/meta/recipes-connectivity/ppp/ppp/CVE-2022-4603.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From a75fb7b198eed50d769c80c36629f38346882cbf Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Mackerras <paulus@ozlabs.org> | ||
3 | Date: Thu, 4 Aug 2022 12:23:08 +1000 | ||
4 | Subject: [PATCH] pppdump: Avoid out-of-range access to packet buffer | ||
5 | |||
6 | This fixes a potential vulnerability where data is written to spkt.buf | ||
7 | and rpkt.buf without a check on the array index. To fix this, we | ||
8 | check the array index (pkt->cnt) before storing the byte or | ||
9 | incrementing the count. This also means we no longer have a potential | ||
10 | signed integer overflow on the increment of pkt->cnt. | ||
11 | |||
12 | Fortunately, pppdump is not used in the normal process of setting up a | ||
13 | PPP connection, is not installed setuid-root, and is not invoked | ||
14 | automatically in any scenario that I am aware of. | ||
15 | |||
16 | Signed-off-by: Paul Mackerras <paulus@ozlabs.org> | ||
17 | |||
18 | Upstream-Status: Backport | ||
19 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
20 | --- | ||
21 | pppdump/pppdump.c | 7 ++++++- | ||
22 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
23 | |||
24 | diff --git a/pppdump/pppdump.c b/pppdump/pppdump.c | ||
25 | index 2b815fc9..b85a8627 100644 | ||
26 | --- a/pppdump/pppdump.c | ||
27 | +++ b/pppdump/pppdump.c | ||
28 | @@ -297,6 +297,10 @@ dumpppp(f) | ||
29 | printf("%s aborted packet:\n ", dir); | ||
30 | q = " "; | ||
31 | } | ||
32 | + if (pkt->cnt >= sizeof(pkt->buf)) { | ||
33 | + printf("%s over-long packet truncated:\n ", dir); | ||
34 | + q = " "; | ||
35 | + } | ||
36 | nb = pkt->cnt; | ||
37 | p = pkt->buf; | ||
38 | pkt->cnt = 0; | ||
39 | @@ -400,7 +404,8 @@ dumpppp(f) | ||
40 | c ^= 0x20; | ||
41 | pkt->esc = 0; | ||
42 | } | ||
43 | - pkt->buf[pkt->cnt++] = c; | ||
44 | + if (pkt->cnt < sizeof(pkt->buf)) | ||
45 | + pkt->buf[pkt->cnt++] = c; | ||
46 | break; | ||
47 | } | ||
48 | } | ||
diff --git a/meta/recipes-connectivity/ppp/ppp_2.4.9.bb b/meta/recipes-connectivity/ppp/ppp_2.4.9.bb index 700ece61dc..7e3ae43b58 100644 --- a/meta/recipes-connectivity/ppp/ppp_2.4.9.bb +++ b/meta/recipes-connectivity/ppp/ppp_2.4.9.bb | |||
@@ -25,6 +25,7 @@ SRC_URI = "https://download.samba.org/pub/${BPN}/${BP}.tar.gz \ | |||
25 | file://provider \ | 25 | file://provider \ |
26 | file://ppp@.service \ | 26 | file://ppp@.service \ |
27 | file://0001-ppp-fix-build-against-5.15-headers.patch \ | 27 | file://0001-ppp-fix-build-against-5.15-headers.patch \ |
28 | file://CVE-2022-4603.patch \ | ||
28 | " | 29 | " |
29 | 30 | ||
30 | SRC_URI[sha256sum] = "f938b35eccde533ea800b15a7445b2f1137da7f88e32a16898d02dee8adc058d" | 31 | SRC_URI[sha256sum] = "f938b35eccde533ea800b15a7445b2f1137da7f88e32a16898d02dee8adc058d" |