diff options
-rw-r--r-- | meta-networking/recipes-protocols/frr/frr/CVE-2022-36440.patch | 71 | ||||
-rw-r--r-- | meta-networking/recipes-protocols/frr/frr_8.2.2.bb | 1 |
2 files changed, 72 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/frr/frr/CVE-2022-36440.patch b/meta-networking/recipes-protocols/frr/frr/CVE-2022-36440.patch new file mode 100644 index 0000000000..c06de49eb3 --- /dev/null +++ b/meta-networking/recipes-protocols/frr/frr/CVE-2022-36440.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | From 02a0e45f66160f571196a105b217e1bb84d1a835 Mon Sep 17 00:00:00 2001 | ||
2 | From: Donald Sharp <sharpd@nvidia.com> | ||
3 | Date: Fri, 30 Sep 2022 08:51:45 -0400 | ||
4 | Subject: [PATCH] bgpd: Ensure FRR has enough data to read 2 bytes in | ||
5 | peek_for_as4_capability | ||
6 | |||
7 | In peek_for_as4_capability the code is checking that the | ||
8 | stream has at least 2 bytes to read ( the opt_type and the | ||
9 | opt_length ). However if BGP_OPEN_EXT_OPT_PARAMS_CAPABLE(peer) | ||
10 | is configured then FRR is reading 3 bytes. Which is not good | ||
11 | since the packet could be badly formated. Ensure that | ||
12 | FRR has the appropriate data length to read the data. | ||
13 | |||
14 | Signed-off-by: Donald Sharp <sharpd@nvidia.com> | ||
15 | (cherry picked from commit 3e46b43e3788f0f87bae56a86b54d412b4710286) | ||
16 | |||
17 | CVE: CVE-2022-36440 | ||
18 | CVE: CVE-2022-40302 | ||
19 | |||
20 | Upstream-Status: Backport | ||
21 | [https://github.com/FRRouting/frr/commit/02a0e45f66160f571196a105b217e1bb84d1a835] | ||
22 | |||
23 | Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de> | ||
24 | --- | ||
25 | bgpd/bgp_open.c | 27 +++++++++++++++++++++------ | ||
26 | 1 file changed, 21 insertions(+), 6 deletions(-) | ||
27 | |||
28 | diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c | ||
29 | index c2562c75d3fc..fe4c24a8c979 100644 | ||
30 | --- a/bgpd/bgp_open.c | ||
31 | +++ b/bgpd/bgp_open.c | ||
32 | @@ -1116,15 +1116,30 @@ as_t peek_for_as4_capability(struct peer *peer, uint16_t length) | ||
33 | uint8_t opt_type; | ||
34 | uint16_t opt_length; | ||
35 | |||
36 | - /* Check the length. */ | ||
37 | - if (stream_get_getp(s) + 2 > end) | ||
38 | + /* Ensure we can read the option type */ | ||
39 | + if (stream_get_getp(s) + 1 > end) | ||
40 | goto end; | ||
41 | |||
42 | - /* Fetch option type and length. */ | ||
43 | + /* Fetch the option type */ | ||
44 | opt_type = stream_getc(s); | ||
45 | - opt_length = BGP_OPEN_EXT_OPT_PARAMS_CAPABLE(peer) | ||
46 | - ? stream_getw(s) | ||
47 | - : stream_getc(s); | ||
48 | + | ||
49 | + /* | ||
50 | + * Check the length and fetch the opt_length | ||
51 | + * If the peer is BGP_OPEN_EXT_OPT_PARAMS_CAPABLE(peer) | ||
52 | + * then we do a getw which is 2 bytes. So we need to | ||
53 | + * ensure that we can read that as well | ||
54 | + */ | ||
55 | + if (BGP_OPEN_EXT_OPT_PARAMS_CAPABLE(peer)) { | ||
56 | + if (stream_get_getp(s) + 2 > end) | ||
57 | + goto end; | ||
58 | + | ||
59 | + opt_length = stream_getw(s); | ||
60 | + } else { | ||
61 | + if (stream_get_getp(s) + 1 > end) | ||
62 | + goto end; | ||
63 | + | ||
64 | + opt_length = stream_getc(s); | ||
65 | + } | ||
66 | |||
67 | /* Option length check. */ | ||
68 | if (stream_get_getp(s) + opt_length > end) | ||
69 | -- | ||
70 | 2.40.1 | ||
71 | |||
diff --git a/meta-networking/recipes-protocols/frr/frr_8.2.2.bb b/meta-networking/recipes-protocols/frr/frr_8.2.2.bb index 80f4729e1f..2da870ae4e 100644 --- a/meta-networking/recipes-protocols/frr/frr_8.2.2.bb +++ b/meta-networking/recipes-protocols/frr/frr_8.2.2.bb | |||
@@ -13,6 +13,7 @@ SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/8.2 \ | |||
13 | file://CVE-2022-37035.patch \ | 13 | file://CVE-2022-37035.patch \ |
14 | file://CVE-2022-37032.patch \ | 14 | file://CVE-2022-37032.patch \ |
15 | file://CVE-2022-42917.patch \ | 15 | file://CVE-2022-42917.patch \ |
16 | file://CVE-2022-36440.patch \ | ||
16 | file://frr.pam \ | 17 | file://frr.pam \ |
17 | " | 18 | " |
18 | 19 | ||