summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2024-08-15 19:31:55 +0200
committerArmin Kuster <akuster808@gmail.com>2024-08-21 16:45:23 -0400
commit8887a98d27639c694ff0eeb9eb8be66dcb034542 (patch)
tree79299feac676327de8d630632a2b539196f71a59
parent8e6bee4c20c8097e24d33c902872537eb725c7d9 (diff)
downloadmeta-openembedded-8887a98d27639c694ff0eeb9eb8be66dcb034542.tar.gz
libndp: Patch CVE-2024-5564
Pick https://github.com/jpirko/libndp/commit/05e4ba7b0d126eea4c04387dcf40596059ee24af.patch Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-connectivity/libndp/libndp/CVE-2024-5564.patch48
-rw-r--r--meta-oe/recipes-connectivity/libndp/libndp_1.8.bb1
2 files changed, 49 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/libndp/libndp/CVE-2024-5564.patch b/meta-oe/recipes-connectivity/libndp/libndp/CVE-2024-5564.patch
new file mode 100644
index 0000000000..fe7ce41b87
--- /dev/null
+++ b/meta-oe/recipes-connectivity/libndp/libndp/CVE-2024-5564.patch
@@ -0,0 +1,48 @@
1From 05e4ba7b0d126eea4c04387dcf40596059ee24af Mon Sep 17 00:00:00 2001
2From: Hangbin Liu <liuhangbin@gmail.com>
3Date: Wed, 5 Jun 2024 11:57:43 +0800
4Subject: [PATCH] libndp: valid route information option length
5
6RFC 4191 specifies that the Route Information Option Length should be 1, 2,
7or 3, depending on the Prefix Length. A malicious node could potentially
8trigger a buffer overflow and crash the tool by sending an IPv6 router
9advertisement message containing the "Route Information" option with a
10"Length" field larger than 3.
11
12To address this, add a check on the length field.
13
14Fixes: 8296a5bf0755 ("add support for Route Information Option (rfc4191)")
15Reported-by: Evgeny Vereshchagin <evverx@gmail.com>
16Suggested-by: Felix Maurer <fmaurer@redhat.com>
17Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
18Signed-off-by: Jiri Pirko <jiri@nvidia.com>
19
20CVE: CVE-2024-5564
21Upstream-Status: Backport [https://github.com/jpirko/libndp/commit/05e4ba7b0d126eea4c04387dcf40596059ee24af]
22Signed-off-by: Peter Marko <peter.marko@siemens.com>
23---
24 libndp/libndp.c | 11 +++++++++++
25 1 file changed, 11 insertions(+)
26
27diff --git a/libndp/libndp.c b/libndp/libndp.c
28index 6314717..72ec92e 100644
29--- a/libndp/libndp.c
30+++ b/libndp/libndp.c
31@@ -1231,6 +1231,17 @@ static bool ndp_msg_opt_route_check_valid(void *opt_data)
32 */
33 if (((ri->nd_opt_ri_prf_reserved >> 3) & 3) == 2)
34 return false;
35+
36+ /* The Length field is 1, 2, or 3 depending on the Prefix Length.
37+ * If Prefix Length is greater than 64, then Length must be 3.
38+ * If Prefix Length is greater than 0, then Length must be 2 or 3.
39+ * If Prefix Length is zero, then Length must be 1, 2, or 3.
40+ */
41+ if (ri->nd_opt_ri_len > 3 ||
42+ (ri->nd_opt_ri_prefix_len > 64 && ri->nd_opt_ri_len != 3) ||
43+ (ri->nd_opt_ri_prefix_len > 0 && ri->nd_opt_ri_len == 1))
44+ return false;
45+
46 return true;
47 }
48
diff --git a/meta-oe/recipes-connectivity/libndp/libndp_1.8.bb b/meta-oe/recipes-connectivity/libndp/libndp_1.8.bb
index 4d4d3e51cd..70d6abec1b 100644
--- a/meta-oe/recipes-connectivity/libndp/libndp_1.8.bb
+++ b/meta-oe/recipes-connectivity/libndp/libndp_1.8.bb
@@ -4,6 +4,7 @@ LICENSE = "LGPL-2.1-only"
4LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" 4LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
5 5
6SRC_URI = "git://github.com/jpirko/libndp;branch=master;protocol=https \ 6SRC_URI = "git://github.com/jpirko/libndp;branch=master;protocol=https \
7 file://CVE-2024-5564.patch \
7 " 8 "
8# tag for v1.8 9# tag for v1.8
9SRCREV = "009ce9cd9b950ffa1f4f94c9436027b936850d0c" 10SRCREV = "009ce9cd9b950ffa1f4f94c9436027b936850d0c"