summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended
diff options
context:
space:
mode:
authorUrade, Yogita <Yogita.Urade@windriver.com>2023-07-19 08:58:27 +0000
committerArmin Kuster <akuster808@gmail.com>2023-07-25 07:23:15 -0400
commit3d16ba16fdcb1b5d7eb893c9254063fdf277c9b2 (patch)
tree849e073247af02a9e50a5a2e344740e224666476 /meta-oe/recipes-extended
parent8ab74bed48e882b880f2e9c2e195f4b1c95c0b0e (diff)
downloadmeta-openembedded-3d16ba16fdcb1b5d7eb893c9254063fdf277c9b2.tar.gz
libyang: fix CVE-2023-26917
libyang from v2.0.164 to v2.1.30 was discovered to contain a NULL pointer dereference via the function lysp_stmt_validate_value at lys_parse_mem.c. References: https://github.com/CESNET/libyang/issues/1987 Signed-off-by: Yogita Urade <yogita.urade@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended')
-rw-r--r--meta-oe/recipes-extended/libyang/libyang/CVE-2023-26917.patch40
-rw-r--r--meta-oe/recipes-extended/libyang/libyang_2.0.164.bb1
2 files changed, 41 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/libyang/libyang/CVE-2023-26917.patch b/meta-oe/recipes-extended/libyang/libyang/CVE-2023-26917.patch
new file mode 100644
index 0000000000..d7ba2fb9a0
--- /dev/null
+++ b/meta-oe/recipes-extended/libyang/libyang/CVE-2023-26917.patch
@@ -0,0 +1,40 @@
1From cfa1a965a429e4bfc5ae1539a8e87a9cf71c3090 Mon Sep 17 00:00:00 2001
2From: Michal Vasko <mvasko@cesnet.cz>
3Date: Tue, 18 Jul 2023 10:41:21 +0000
4Subject: [PATCH] parser common BUGFIX handle missing YANG strings
5
6Fixes #1987
7
8CVE: CVE-2023-26917
9
10Upstream-Status:
11Backport[https://github.com/CESNET/libyang/commit/cfa1a965a429e4bfc5ae1539a8e87a9cf71c3090]
12
13Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
14---
15 src/parser_stmt.c | 10 ++++++++++
16 1 file changed, 10 insertions(+)
17
18diff --git a/src/parser_stmt.c b/src/parser_stmt.c
19index 81ccbfca6..2ebf822ab 100644
20--- a/src/parser_stmt.c
21+++ b/src/parser_stmt.c
22@@ -52,6 +52,16 @@ lysp_stmt_validate_value(struct lys_parser_ctx *ctx, enum yang_arg val_type, con
23 uint32_t c;
24 size_t utf8_char_len;
25
26+ if (!val) {
27+ if (val_type == Y_MAYBE_STR_ARG) {
28+ /* fine */
29+ return LY_SUCCESS;
30+ }
31+
32+ LOGVAL_PARSER(ctx, LYVE_SYNTAX, "Missing an expected string.");
33+ return LY_EVALID;
34+ }
35+
36 while (*val) {
37 LY_CHECK_ERR_RET(ly_getutf8(&val, &c, &utf8_char_len),
38 LOGVAL_PARSER(ctx, LY_VCODE_INCHAR, (val)[-utf8_char_len]), LY_EVALID);
39--
402.35.5
diff --git a/meta-oe/recipes-extended/libyang/libyang_2.0.164.bb b/meta-oe/recipes-extended/libyang/libyang_2.0.164.bb
index 7875c1ef79..eb3f322519 100644
--- a/meta-oe/recipes-extended/libyang/libyang_2.0.164.bb
+++ b/meta-oe/recipes-extended/libyang/libyang_2.0.164.bb
@@ -12,6 +12,7 @@ SRC_URI = "git://github.com/CESNET/libyang.git;branch=master;protocol=https \
12 file://libyang-add-stdint-h.patch \ 12 file://libyang-add-stdint-h.patch \
13 file://run-ptest \ 13 file://run-ptest \
14 file://CVE-2023-26916.patch \ 14 file://CVE-2023-26916.patch \
15 file://CVE-2023-26917.patch \
15 " 16 "
16 17
17S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"