From 09f75d6c740b7fcb78d138fedbe9c54860620bff Mon Sep 17 00:00:00 2001 From: luckky Date: Mon, 2 Dec 2024 06:45:25 +0000 Subject: [PATCH] backport patches from upstream Signed-off-by: luckky --- ...-config-env-is-greater-than-ulong_ma.patch | 38 +++++++++++++++++++ rasdaemon.spec | 9 ++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 backport-Fix-the-bug-that-config-env-is-greater-than-ulong_ma.patch diff --git a/backport-Fix-the-bug-that-config-env-is-greater-than-ulong_ma.patch b/backport-Fix-the-bug-that-config-env-is-greater-than-ulong_ma.patch new file mode 100644 index 0000000..1ee7ac2 --- /dev/null +++ b/backport-Fix-the-bug-that-config-env-is-greater-than-ulong_ma.patch @@ -0,0 +1,38 @@ +From 683feacf378db0217b8ab421e0a694b0b68188c9 Mon Sep 17 00:00:00 2001 +From: zhuofeng +Date: Thu, 7 Dec 2023 14:37:50 +0800 +Subject: [PATCH] Fix the bug that `config->env` is greater than `ulong_max` + when units->val=1 + +Reference:https://github.com/mchehab/rasdaemon/commit/683feacf378db0217b8ab421e0a694b0b68188c9 +Conflict: NA + +Signed-off-by: Mauro Carvalho Chehab +--- + ras-page-isolation.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/ras-page-isolation.c b/ras-page-isolation.c +index f074b45..341f2cf 100644 +--- a/ras-page-isolation.c ++++ b/ras-page-isolation.c +@@ -188,6 +188,17 @@ parse: + value *= units->val; + if (tmp != 0 && value / tmp != units->val) + config->overflow = true; ++ /** ++ * if units->val is 1, config->env is greater than ulong_max, so it is can strtoul ++ * if failed, the value is greater than ulong_max, set config->overflow = true ++ */ ++ if (units->val == 1) { ++ char *endptr; ++ unsigned long converted_value = strtoul(config->env, &endptr, 10); ++ if (errno == ERANGE || *endptr != '\0') ++ config->overflow = true; ++ } ++ unit_matched = 0; + } + } + config->val = value; +-- +2.33.0 diff --git a/rasdaemon.spec b/rasdaemon.spec index a28b98d..9e06d22 100644 --- a/rasdaemon.spec +++ b/rasdaemon.spec @@ -1,6 +1,6 @@ Name: rasdaemon Version: 0.8.0 -Release: 7 +Release: 8 License: GPLv2 Summary: Utility to get Platform Reliability, Availability and Serviceability (RAS) reports via the Kernel tracing events URL: https://github.com/mchehab/rasdaemon.git @@ -37,6 +37,7 @@ Patch9010: bugfix-fix-cpu-isolate-errors-when-some-cpus-are-.patch Patch9011: backport-ras-events-quit-loop-in-read_ras_event-when-kbuf-data-is-broken.patch Patch9012: backport-Rasdaemon-Fix-autoreconf-build-error.patch Patch9013: backport-mce-amd-smca-update-smca_hwid-to-use-smca_bank_types.patch +Patch9014: backport-Fix-the-bug-that-config-env-is-greater-than-ulong_ma.patch %description The rasdaemon program is a daemon which monitors the platform @@ -88,6 +89,12 @@ fi /usr/bin/systemctl disable rasdaemon.service >/dev/null 2>&1 || : %changelog +* Mon Dec 2 2024 guodashun - 0.8.0-8 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:backport patches from upstream + * Tue Jul 16 2024 wangziliang - 0.8.0-7 - Type:bugfix - ID:NA -- Gitee