From c982a980e98fb7cfed4ded75e82be31eff0e8bd1 Mon Sep 17 00:00:00 2001 From: Peter Marko Date: Sat, 12 Jul 2025 14:55:12 +0200 Subject: spdlog: patch CVE-2025-6140 Pick commit [1] mentioned in [2] as listed in [3]. [1] https://github.com/gabime/spdlog/commit/10320184df1eb4638e253a34b1eb44ce78954094 [2] https://github.com/gabime/spdlog/issues/3360 [3] https://nvd.nist.gov/vuln/detail/CVE-2025-6140 Signed-off-by: Peter Marko Signed-off-by: Armin Kuster --- .../spdlog/spdlog/CVE-2025-6140.patch | 35 ++++++++++++++++++++++ meta-oe/recipes-support/spdlog/spdlog_1.9.2.bb | 4 ++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-support/spdlog/spdlog/CVE-2025-6140.patch diff --git a/meta-oe/recipes-support/spdlog/spdlog/CVE-2025-6140.patch b/meta-oe/recipes-support/spdlog/spdlog/CVE-2025-6140.patch new file mode 100644 index 0000000000..01e4558ff2 --- /dev/null +++ b/meta-oe/recipes-support/spdlog/spdlog/CVE-2025-6140.patch @@ -0,0 +1,35 @@ +From 10320184df1eb4638e253a34b1eb44ce78954094 Mon Sep 17 00:00:00 2001 +From: Gabi Melman +Date: Mon, 17 Mar 2025 15:46:31 +0200 +Subject: [PATCH] Fixed issue #3360 (#3361) + +CVE: CVE-2025-6140 +Upstream-Status: Backport [https://github.com/gabime/spdlog/commit/10320184df1eb4638e253a34b1eb44ce78954094] +Signed-off-by: Peter Marko +--- + include/spdlog/pattern_formatter-inl.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/include/spdlog/pattern_formatter-inl.h b/include/spdlog/pattern_formatter-inl.h +index b53d8051..fd408ed5 100644 +--- a/include/spdlog/pattern_formatter-inl.h ++++ b/include/spdlog/pattern_formatter-inl.h +@@ -76,6 +76,9 @@ public: + else if (padinfo_.truncate_) + { + long new_size = static_cast(dest_.size()) + remaining_pad_; ++ if (new_size < 0) { ++ new_size = 0; ++ } + dest_.resize(static_cast(new_size)); + } + } +@@ -303,7 +306,7 @@ public: + + void format(const details::log_msg &, const std::tm &tm_time, memory_buf_t &dest) override + { +- const size_t field_size = 10; ++ const size_t field_size = 8; + ScopedPadder p(field_size, padinfo_, dest); + + fmt_helper::pad2(tm_time.tm_mon + 1, dest); diff --git a/meta-oe/recipes-support/spdlog/spdlog_1.9.2.bb b/meta-oe/recipes-support/spdlog/spdlog_1.9.2.bb index 6362fc7a4b..4110ba8a11 100644 --- a/meta-oe/recipes-support/spdlog/spdlog_1.9.2.bb +++ b/meta-oe/recipes-support/spdlog/spdlog_1.9.2.bb @@ -5,7 +5,9 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ad SRCREV = "eb3220622e73a4889eee355ffa37972b3cac3df5" SRC_URI = "git://github.com/gabime/spdlog.git;protocol=https;branch=v1.x; \ - file://0001-Enable-use-of-external-fmt-library.patch" + file://0001-Enable-use-of-external-fmt-library.patch \ + file://CVE-2025-6140.patch \ +" DEPENDS += "fmt" -- cgit v1.2.3-54-g00ecf