From: <jinfeng.wang.cn@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [scarthgap][PATCH 08/12] libxml2: Fix CVE-2026-1757
Date: Thu, 9 Apr 2026 14:16:35 +0800 [thread overview]
Message-ID: <20260409061639.1688205-9-jinfeng.wang.cn@windriver.com> (raw)
In-Reply-To: <20260409061639.1688205-1-jinfeng.wang.cn@windriver.com>
From: Mingli Yu <mingli.yu@windriver.com>
Backport patch [1] to fix CVE-2026-1757.
The shell is refactored [2], so backport the related code from shell.c
to debugXML.c.
[1] https://gitlab.gnome.org/GNOME/libxml2/-/commit/160c8a43
[2] https://gitlab.gnome.org/GNOME/libxml2/-/commit/1341deac
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Jinfeng Wang <jinfeng.wang.cn@windriver.com>
---
.../libxml/libxml2/CVE-2026-1757.patch | 49 +++++++++++++++++++
meta/recipes-core/libxml/libxml2_2.12.10.bb | 1 +
2 files changed, 50 insertions(+)
create mode 100644 meta/recipes-core/libxml/libxml2/CVE-2026-1757.patch
diff --git a/meta/recipes-core/libxml/libxml2/CVE-2026-1757.patch b/meta/recipes-core/libxml/libxml2/CVE-2026-1757.patch
new file mode 100644
index 0000000000..b6e6373ab0
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/CVE-2026-1757.patch
@@ -0,0 +1,49 @@
+From bbe186902eddca01cc2049780a1d1a37937d3862 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Wed, 25 Feb 2026 16:16:14 +0800
+Subject: [PATCH] shell: free cmdline before continue
+
+This patch frees the cmdline when it's not empty but it doesn't contain
+any actual character.
+
+If the cmdline is just whitespaces or \r and \n, the loop continues
+without freeing the cmdline string, so it's a leak.
+
+Fix #1009
+
+Reference https://gitlab.gnome.org/GNOME/libxml2/-/commit/160c8a43
+
+CVE: CVE-2026-1757
+
+Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/160c8a43]
+
+The shell is refactored [1], so backport the related code from shell.c
+to debugXML.c.
+
+[1] https://gitlab.gnome.org/GNOME/libxml2/-/commit/1341deac
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ debugXML.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/debugXML.c b/debugXML.c
+index 9d9618f..2d5c99d 100644
+--- a/debugXML.c
++++ b/debugXML.c
+@@ -2866,8 +2866,11 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
+ command[i++] = *cur++;
+ }
+ command[i] = 0;
+- if (i == 0)
++ if (i == 0) {
++ free(cmdline);
++ cmdline = NULL;
+ continue;
++ }
+
+ /*
+ * Parse the argument
+--
+2.34.1
+
diff --git a/meta/recipes-core/libxml/libxml2_2.12.10.bb b/meta/recipes-core/libxml/libxml2_2.12.10.bb
index 25da11bd2d..2bfa78324f 100644
--- a/meta/recipes-core/libxml/libxml2_2.12.10.bb
+++ b/meta/recipes-core/libxml/libxml2_2.12.10.bb
@@ -30,6 +30,7 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20130923.tar;subdir=${BP};name=testt
file://CVE-2026-0992-01.patch \
file://CVE-2026-0992-02.patch \
file://CVE-2026-0992-03.patch \
+ file://CVE-2026-1757.patch \
"
SRC_URI[archive.sha256sum] = "c3d8c0c34aa39098f66576fe51969db12a5100b956233dc56506f7a8679be995"
--
2.34.1
next prev parent reply other threads:[~2026-04-09 6:17 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 6:16 [scarthgap][PATCH 00/12] Fix multiple CVEs jinfeng.wang.cn
2026-04-09 6:16 ` [scarthgap][PATCH 01/12] gi-docgen: fix CVE-2025-11687 jinfeng.wang.cn
2026-04-09 6:16 ` [scarthgap][PATCH 02/12] libsoup: fix CVE-2025-14523/CVE-2025-32049 jinfeng.wang.cn
2026-04-23 17:09 ` [OE-core] " Yoann Congal
2026-04-24 7:16 ` Li, Changqing
2026-04-09 6:16 ` [scarthgap][PATCH 03/12] libsoup-2.4: " jinfeng.wang.cn
2026-04-23 17:13 ` [OE-core] " Yoann Congal
2026-04-24 7:37 ` Li, Changqing
2026-04-09 6:16 ` [scarthgap][PATCH 04/12] python3-ply: fix CVE-2025-56005 jinfeng.wang.cn
2026-04-24 6:45 ` [OE-core] " Yoann Congal
2026-04-27 6:20 ` Chen, Libo (CN)
[not found] ` <18AA22684C0F041F.2188217@lists.openembedded.org>
2026-05-06 8:24 ` Chen, Libo (CN)
2026-04-09 6:16 ` [scarthgap][PATCH 05/12] python3-pyasn1: fix CVE-2026-23490 jinfeng.wang.cn
2026-04-09 6:16 ` [scarthgap][PATCH 06/12] python3-wheel: fix CVE-2026-24049 jinfeng.wang.cn
2026-04-09 6:16 ` [scarthgap][PATCH 07/12] gnupg: fix CVE-2026-24882 jinfeng.wang.cn
2026-04-09 6:16 ` jinfeng.wang.cn [this message]
2026-04-09 6:16 ` [scarthgap][PATCH 09/12] python3-pyasn1: fix CVE-2026-30922 jinfeng.wang.cn
2026-04-24 7:36 ` [OE-core] " Yoann Congal
2026-04-27 6:04 ` Song, Jiaying (CN)
2026-04-09 6:16 ` [scarthgap][PATCH 10/12] busybox: fix CVE-2026-26157 and CVE-2026-26158 jinfeng.wang.cn
2026-04-09 6:16 ` [scarthgap][PATCH 11/12] zlib: upgrade 1.3.1 -> 1.3.2 jinfeng.wang.cn
2026-04-24 8:10 ` [OE-core] " Yoann Congal
2026-04-09 6:16 ` [scarthgap][PATCH 12/12] libpcap: 1.10.4 -> 1.10.6 jinfeng.wang.cn
2026-04-24 8:21 ` [OE-core] " Yoann Congal
2026-05-06 3:05 ` Kai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260409061639.1688205-9-jinfeng.wang.cn@windriver.com \
--to=jinfeng.wang.cn@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox