diff --git a/0002-fix-coredump-in-bl_add_disk.patch b/0002-fix-coredump-in-bl_add_disk.patch new file mode 100644 index 0000000000000000000000000000000000000000..beb277189c83199549d58a942c319cfc1647fb49 --- /dev/null +++ b/0002-fix-coredump-in-bl_add_disk.patch @@ -0,0 +1,44 @@ +From c7e995c8a4a3985d1b315814d29e8d9211d6dc5e Mon Sep 17 00:00:00 2001 +From: lixiaokeng +Date: Tue, 30 Nov 2021 16:38:02 +0800 +Subject: [PATCH 1/2] fix coredump in bl_add_disk + +The serial->data is not malloced separately, so it can't be freed. +Just free(serial). + +Signed-off-by: Lixiaokeng +--- + utils/blkmapd/device-discovery.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c +index f5f9b10..2c50205 100644 +--- a/utils/blkmapd/device-discovery.c ++++ b/utils/blkmapd/device-discovery.c +@@ -188,7 +188,6 @@ static void bl_add_disk(char *filepath) + + if (disk && diskpath) { + if (serial) { +- free(serial->data); + free(serial); + } + return; +@@ -229,7 +228,6 @@ static void bl_add_disk(char *filepath) + disk->valid_path = path; + } + if (serial) { +- free(serial->data); + free(serial); + } + } +@@ -242,7 +240,6 @@ static void bl_add_disk(char *filepath) + free(path); + } + if (serial) { +- free(serial->data); + free(serial); + } + return; +-- +2.26.1.windows.1 + diff --git a/nfs-utils.spec b/nfs-utils.spec index 66aacaff8be31d6486d9b6267c543dcf21d45388..3b863cc31bc756b9df18abac00843c6b2ab909cc 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -4,7 +4,7 @@ Name: nfs-utils Version: 2.5.1 -Release: 2 +Release: 4 Epoch: 1 Summary: The Linux NFS userland utility package License: MIT and GPLv2 and GPLv2+ and BSD @@ -14,6 +14,7 @@ Source0: https://www.kernel.org/pub/linux/utils/nfs-utils/%{version}/%{name}-%{v Patch0: 0000-systemd-idmapd-require-rpc-pipefs.patch Patch1: 0001-correct-the-statd-path-in-man.patch +Patch2: 0002-fix-coredump-in-bl_add_disk.patch BuildRequires: libevent-devel,libcap-devel, libtirpc-devel libblkid-devel BuildRequires: krb5-libs >= 1.4 autoconf >= 2.57 openldap-devel >= 2.2 @@ -222,6 +223,12 @@ fi %{_mandir}/*/* %changelog +* Tue Nov 30 2021 yanglongkang - 2.5.1-4 +- fix nfs-blkmapd service core dump + +* Wed Nov 11 2020 lixiaokeng - 2.5.1-3 +- add epoch to the version of help package required + * Thu Dec 17 2020 yanglongkang - 2.5.1-2 - set help package as install requires