diff --git a/backport-check-whether-savedptr-is-NULL-before-invoking-strle.patch b/backport-check-whether-savedptr-is-NULL-before-invoking-strle.patch new file mode 100644 index 0000000..1057ba1 --- /dev/null +++ b/backport-check-whether-savedptr-is-NULL-before-invoking-strle.patch @@ -0,0 +1,31 @@ +From 522883505d3b02e3294f045f49007b61c00e2c31 Mon Sep 17 00:00:00 2001 +From: Chao Liu +Date: Wed, 8 Jun 2022 10:04:02 +0800 +Subject: [PATCH] check whether savedptr is NULL before invoking strlen + +Reference: https://github.com/Irqbalance/irqbalance/commit/522883505d3b02e3294f045f49007b61c00e2c31 +Conflict: NA + +savedptr can be null in musl libc, so the strlen(NULL) will segfault + +Signed-off-by: Chao Liu +--- + procinterrupts.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/procinterrupts.c b/procinterrupts.c +index 9015177..57c8801 100644 +--- a/procinterrupts.c ++++ b/procinterrupts.c +@@ -178,7 +178,7 @@ void init_irq_class_and_type(char *savedline, struct irq_info *info, int irq) + } + + #ifdef AARCH64 +- if (strlen(savedptr) > 0) { ++ if (savedptr && strlen(savedptr) > 0) { + snprintf(irq_fullname, PATH_MAX, "%s %s", last_token, savedptr); + tmp = strchr(irq_fullname, '\n'); + if (tmp) +-- +2.33.0 + diff --git a/irqbalance.spec b/irqbalance.spec index e6c97e8..0bd3a15 100644 --- a/irqbalance.spec +++ b/irqbalance.spec @@ -1,7 +1,7 @@ Summary: A dynamic adaptive IRQ balancing daemon Name: irqbalance Version: 1.7.0 -Release: 18 +Release: 19 Epoch: 3 License: GPLv2 Source0: https://github.com/Irqbalance/irqbalance/archive/irqbalance-%{version}.tar.gz @@ -37,6 +37,7 @@ Patch6012: backport-Add-0-to-the-end-of-strings-to-avoid-heap-buffer-ove.patch Patch6013: backport-Fix-parse_proc_interrupts-fix-parsing-interrupt-counts.patch Patch6014: backport-Fix-add-keep_going-check-to-prevent-irqbalance-from-failing-to-exit-after-SIGTERM.patch Patch6015: backport-fix-opendir-fails-in-check_platform_device.patch +Patch6016: backport-check-whether-savedptr-is-NULL-before-invoking-strle.patch %description Irqbalance is a daemon to help balance the cpu load generated by @@ -94,6 +95,12 @@ fi /sbin/chkconfig --del %{name} >/dev/null 2>&1 || : %changelog +* Thu Jan 5 2023 qinyu - 3:1.7.0-19 +- Type:bugfix +- ID:NA +- SUG:restart +- DESC: check whether savedptr is NULL before invoking strlen + * Thu Jan 5 2023 qinyu - 3:1.7.0-18 - Type:bugfix - ID:NA