From 3fa1484908b009bbd387d2509394e05e37976dd9 Mon Sep 17 00:00:00 2001 From: liuh Date: Mon, 29 Apr 2024 16:02:30 +0800 Subject: [PATCH] lsfd: fix memory leak in append_filter_expr() (cherry picked from commit f90264c6409a9e41d1130bc4be6b1a5bdc37cd96) --- ...ix-memory-leak-in-append_filter_expr.patch | 25 +++++++++++++++++++ util-linux.spec | 9 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 backport-lsfd-fix-memory-leak-in-append_filter_expr.patch diff --git a/backport-lsfd-fix-memory-leak-in-append_filter_expr.patch b/backport-lsfd-fix-memory-leak-in-append_filter_expr.patch new file mode 100644 index 0000000..0242d42 --- /dev/null +++ b/backport-lsfd-fix-memory-leak-in-append_filter_expr.patch @@ -0,0 +1,25 @@ +From 53bcec4b25a60c125403a80a18ca3aacf1dc8269 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 25 Apr 2024 15:12:56 +0800 +Subject: [PATCH] lsfd: fix memory leak in append_filter_expr() + +--- + misc-utils/lsfd.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c +index 9f74862..56c0f7a 100644 +--- a/misc-utils/lsfd.c ++++ b/misc-utils/lsfd.c +@@ -1590,6 +1590,8 @@ static void append_filter_expr(char **a, const char *b, bool and) + xstrappend(a, "or("); + xstrappend(a, b); + xstrappend(a, ")"); ++ ++ free(tmp); + } + + static struct lsfd_filter *new_filter(const char *expr, bool debug, const char *err_prefix, struct lsfd_control *ctl) +-- +2.27.0 + diff --git a/util-linux.spec b/util-linux.spec index 9c2f5f8..a3d455d 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -3,7 +3,7 @@ Name: util-linux Version: 2.39.1 -Release: 6 +Release: 7 Summary: A random collection of Linux utilities License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git @@ -30,6 +30,7 @@ Patch6008: backport-CVE-2024-28085.patch Patch6009: backport-tests-test_mkfds-netlink-pass-a-correct-file-descrip.patch Patch6010: backport-tests-functions.sh-add-a-helper-funcion-making-a-dev.patch Patch6011: backport-tests-lsfd-don-t-refer-on-the-line-follwoing-the-use.patch +Patch6012: backport-lsfd-fix-memory-leak-in-append_filter_expr.patch Patch9000: SKIPPED-no-root-permissions-test.patch %ifarch sw_64 @@ -414,6 +415,12 @@ fi %endif %changelog +* Thu Apr 25 2024 liuh - 2.39.1-7 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix memory leak in append_filter_expr() + * Mon Apr 15 2024 zhangyao - 2.39.1-6 - Type:bugfix - CVE:NA