From: ankur.tyagi85@gmail.com
To: openembedded-devel@lists.openembedded.org
Cc: Ankur Tyagi <ankur.tyagi85@gmail.com>
Subject: [oe][meta-oe][wrynose][PATCH 13/28] editorconfig-core-c: patch CVE-2026-40489
Date: Wed, 2 Sep 2026 22:04:55 +1200 [thread overview]
Message-ID: <20260902100511.2105916-13-ankur.tyagi85@gmail.com> (raw)
In-Reply-To: <20260902100511.2105916-1-ankur.tyagi85@gmail.com>
From: Ankur Tyagi <ankur.tyagi85@gmail.com>
Details:
https://nvd.nist.gov/vuln/detail/cve-2026-40489
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
.../editorconfig-core-c/CVE-2026-40489.patch | 39 +++++++++++++++++++
.../editorconfig-core-c_0.12.9.bb | 4 +-
2 files changed, 42 insertions(+), 1 deletion(-)
create mode 100644 meta-oe/recipes-devtools/editorconfig/editorconfig-core-c/CVE-2026-40489.patch
diff --git a/meta-oe/recipes-devtools/editorconfig/editorconfig-core-c/CVE-2026-40489.patch b/meta-oe/recipes-devtools/editorconfig/editorconfig-core-c/CVE-2026-40489.patch
new file mode 100644
index 0000000000..e328052314
--- /dev/null
+++ b/meta-oe/recipes-devtools/editorconfig/editorconfig-core-c/CVE-2026-40489.patch
@@ -0,0 +1,39 @@
+From 4d5fcd42739f0ae349efe4e9208c0f109bb7c141 Mon Sep 17 00:00:00 2001
+From: Hong Xu <hong@topbug.net>
+Date: Tue, 14 Apr 2026 23:11:39 -0700
+Subject: [PATCH] Merge commit from fork
+
+Completes the buffer-overflow fix from #87, which bounded writes into
+`pcre_str` but left the initial `strcpy` of `pattern` into `l_pattern`
+at the top of `ec_glob` unguarded. Sufficiently long patterns smash the
+stack before any of the bounds-checked code runs.
+
+Fix CVE-2026-40489
+
+(cherry picked from commit 5159be88ad50641d9843289adda791ba300421ff)
+
+CVE: CVE-2026-40489
+Upstream-Status: Backport [https://github.com/editorconfig/editorconfig-core-c/commit/5159be88ad50641d9843289adda791ba300421ff]
+Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
+---
+ src/lib/ec_glob.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib/ec_glob.c b/src/lib/ec_glob.c
+index d36076d..0e7f7ac 100644
+--- a/src/lib/ec_glob.c
++++ b/src/lib/ec_glob.c
+@@ -96,8 +96,12 @@ int ec_glob(const char *pattern, const char *string)
+ _Bool are_braces_paired = 1;
+ UT_array * nums; /* number ranges */
+ int ret = 0;
++ size_t pattern_len = strlen(pattern);
+
+- strcpy(l_pattern, pattern);
++ /* Reject patterns that would overflow l_pattern in the copy below. */
++ if (pattern_len >= sizeof(l_pattern))
++ return -1;
++ memcpy(l_pattern, pattern, pattern_len + 1);
+ p_pcre = pcre_str + 1;
+ pcre_str_end = pcre_str + 2 * PATTERN_MAX;
+
diff --git a/meta-oe/recipes-devtools/editorconfig/editorconfig-core-c_0.12.9.bb b/meta-oe/recipes-devtools/editorconfig/editorconfig-core-c_0.12.9.bb
index 319c1724c0..8d182d0cd0 100644
--- a/meta-oe/recipes-devtools/editorconfig/editorconfig-core-c_0.12.9.bb
+++ b/meta-oe/recipes-devtools/editorconfig/editorconfig-core-c_0.12.9.bb
@@ -4,7 +4,9 @@ SECTION = "libs"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=38f617473e9f7373b5e79baf437accf8"
-SRC_URI = "git://github.com/editorconfig/editorconfig-core-c.git;protocol=https;branch=master"
+SRC_URI = "git://github.com/editorconfig/editorconfig-core-c.git;protocol=https;branch=master \
+ file://CVE-2026-40489.patch \
+"
SRCREV = "e082c947e7f7b14240195d55c060a6e1eda1b0a1"
next prev parent reply other threads:[~2026-09-02 10:05 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 10:04 [oe][meta-oe][wrynose][PATCH 1/28] libmxml: upgrade 4.0.4 -> 4.0.5 ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-oe][wrynose][PATCH 2/28] asyncmqtt: upgrade 10.3.0 -> 10.3.1 ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-oe][wrynose][PATCH 3/28] php: upgrade 8.5.9 -> 8.5.10 ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-networking][wrynose][PATCH 4/28] proftpd: upgrade 1.3.9c -> 1.3.9d ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-oe][wrynose][PATCH 5/28] capnproto: ignore CVE-2026-59704 ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-oe][wrynose][PATCH 6/28] bubblewrap: mark CVE-2026-41163 patched ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-oe][wrynose][PATCH 7/28] bcc: mark CVE-2024-2314 patched ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-webserver][wrynose][PATCH 8/28] cockpit: mark CVE-2024-2947 patched ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-oe][wrynose][PATCH 9/28] dool: patch CVE-2026-56651 ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-oe][wrynose][PATCH 10/28] dool: patch CVE-2026-56652 ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-networking][wrynose][PATCH 11/28] dovecot: ignore already fixed CVEs ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-oe][wrynose][PATCH 12/28] editorconfig-core-c: ignore CVE-2024-53849 ankur.tyagi85
2026-09-02 10:04 ` ankur.tyagi85 [this message]
2026-09-02 10:04 ` [oe][meta-networking][wrynose][PATCH 14/28] civetweb: ignore CVE-2026-5789 ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-oe][wrynose][PATCH 15/28] eject: ignore CVE-2026-28065 ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-networking][wrynose][PATCH 16/28] firewalld: patch CVE-2026-4948 ankur.tyagi85
2026-09-02 10:04 ` [oe][meta-oe][wrynose][PATCH 17/28] freeipmi: patch CVE-2026-50031 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-oe][wrynose][PATCH 18/28] haveged: ignore CVE-2026-41054 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-oe][wrynose][PATCH 19/28] gpm: ignore CVE-2025-4558 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-oe][wrynose][PATCH 20/28] gpsd: patch CVE-2026-58459 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-multimedia][wrynose][PATCH 21/28] gerbera: ignore CVE-2025-23386 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-oe][wrynose][PATCH 22/28] hostapd: patch CVE-2026-58374 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-oe][wrynose][PATCH 23/28] hdf5: patch CVE-2026-17572 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-oe][wrynose][PATCH 24/28] hdf5: patch CVE-2026-17573 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-oe][wrynose][PATCH 25/28] hdf5: patch CVE-2026-17574 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-oe][wrynose][PATCH 26/28] hdf5: patch CVE-2026-19025 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-networking][wrynose][PATCH 27/28] iftop: ignore CVE-2026-3824, CVE-2026-3825 and CVE-2026-3826 ankur.tyagi85
2026-09-02 10:05 ` [oe][meta-oe][wrynose][PATCH 28/28] iniparser: mark CVE-2025-0633 pached ankur.tyagi85
2026-09-15 1:34 ` [oe][meta-oe][wrynose][PATCH 1/28] libmxml: upgrade 4.0.4 -> 4.0.5 Anuj Mittal
2026-09-15 1:54 ` Ankur Tyagi
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=20260902100511.2105916-13-ankur.tyagi85@gmail.com \
--to=ankur.tyagi85@gmail.com \
--cc=openembedded-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.