diff --git a/0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch b/0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch new file mode 100644 index 0000000000000000000000000000000000000000..2409a5161a77d6c2f8ec984121541b1b6394d535 --- /dev/null +++ b/0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch @@ -0,0 +1,46 @@ +From: Xiaofei Tan +Date: Sat, 20 Aug 2022 09:49:25 +0000 +Subject: [PATCH] rasdaemon: use standard length PATH_MAX for path name + +Use standard length PATH_MAX for path name space allocation +to replace the macro MAX_PATH_LEN. + +Signed-off-by: Xiaofei Tan +--- + ras-cpu-isolation.c | 6 +++--- + ras-cpu-isolation.h | 1 - + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/ras-cpu-isolation.c b/ras-cpu-isolation.c +index ba5ccd1..24c07e9 100644 +--- a/ras-cpu-isolation.c ++++ b/ras-cpu-isolation.c +@@ -80,11 +80,11 @@ static const char * const cpu_state[] = { + static int open_sys_file(unsigned int cpu, int __oflag, const char *format) + { + int fd; +- char path[MAX_PATH_LEN + 1] = ""; +- char real_path[MAX_PATH_LEN + 1] = ""; ++ char path[PATH_MAX] = ""; ++ char real_path[PATH_MAX] = ""; + + snprintf(path, sizeof(path), format, cpu); +- if (strlen(path) > MAX_PATH_LEN || realpath(path, real_path) == NULL) { ++ if (strlen(path) > PATH_MAX || realpath(path, real_path) == NULL) { + log(TERM, LOG_ERR, "[%s]:open file: %s failed\n", __func__, path); + return -1; + } +diff --git a/ras-cpu-isolation.h b/ras-cpu-isolation.h +index 024a68b..5682106 100644 +--- a/ras-cpu-isolation.h ++++ b/ras-cpu-isolation.h +@@ -17,7 +17,6 @@ + + #include "queue.h" + +-#define MAX_PATH_LEN 100 + #define MAX_BUF_LEN 1024 + + struct param { +-- +2.17.1 diff --git a/rasdaemon.spec b/rasdaemon.spec index 1c7fb5b6c88ed9462ef4789120a1e1af2cede0d2..1be5c80072e99b9a38120704bbe861c983d624d6 100644 --- a/rasdaemon.spec +++ b/rasdaemon.spec @@ -1,6 +1,6 @@ Name: rasdaemon Version: 0.6.7 -Release: 5 +Release: 6 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 @@ Patch15: 0007-rasdaemon-ras-mc-ctl-Add-support-to-display-the-HiSi.patch Patch16: 0008-rasdaemon-ras-mc-ctl-Relocate-reading-and-display-Ku.patch Patch17: 0009-rasdaemon-ras-mc-ctl-Updated-HiSilicon-platform-name.patch Patch18: 0010-rasdaemon-Fix-for-a-memory-out-of-bounds-issue-and-o.patch +Patch19: 0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch %description The rasdaemon program is a daemon which monitors the platform @@ -82,6 +83,14 @@ rm INSTALL %{buildroot}/usr/include/*.h /usr/bin/systemctl enable rasdaemon.service >/dev/null 2>&1 || : %changelog +* Thu Aug 25 2022 Xiaofei Tan - 0.6.7-6 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: + Add the following patch to fix startup core dumped issue. + 0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch + * Mon May 23 2022 Shiju Jose - 0.6.7-5 - Type:feature - ID:NA