diff --git a/0001-ndctl-namespace-fix-a-resource-leak-in-file_write_in.patch b/0001-ndctl-namespace-fix-a-resource-leak-in-file_write_in.patch deleted file mode 100644 index a0104baf816a70081d832b34bd7088c454f79668..0000000000000000000000000000000000000000 --- a/0001-ndctl-namespace-fix-a-resource-leak-in-file_write_in.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b0d9cad81f2e811608b898922643f655043361aa Mon Sep 17 00:00:00 2001 -From: Vishal Verma -Date: Tue, 21 Jul 2020 23:17:27 -0600 -Subject: [PATCH 1/2] ndctl/namespace: fix a resource leak in - file_write_infoblock() - -Static analysis showed that we might leak 'fd' in the given function. -Fix the error path to close(fd) if 'fd >= 0' rather than just 'fd > 0'. - -Fixes: 7787807bcffe ("ndctl/namespace: Add write-infoblock command") -Cc: Dan Williams -Signed-off-by: Vishal Verma ---- - ndctl/namespace.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ndctl/namespace.c b/ndctl/namespace.c -index 0550580..17e67c9 100644 ---- a/ndctl/namespace.c -+++ b/ndctl/namespace.c -@@ -1977,7 +1977,7 @@ static int file_write_infoblock(const char *path) - - free(buf); - out: -- if (fd > 0 && fd != STDOUT_FILENO) -+ if (fd >= 0 && fd != STDOUT_FILENO) - close(fd); - return rc; - } --- -1.8.3.1 - diff --git a/0002-libndctl-fix-a-potential-buffer-overflow.patch b/0002-libndctl-fix-a-potential-buffer-overflow.patch deleted file mode 100644 index 485d225323bdaa45025cce7aa2d1096a2b15531e..0000000000000000000000000000000000000000 --- a/0002-libndctl-fix-a-potential-buffer-overflow.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 2f99e11812e6a4d9814bfc8ef038ca845db5394c Mon Sep 17 00:00:00 2001 -From: Vishal Verma -Date: Thu, 1 Oct 2020 11:10:00 -0600 -Subject: [PATCH 2/2] libndctl: fix a potential buffer overflow - -Static analysis points out that the 'buf' in ndctl_dimm_is_active was -inappropriately sized. We already have 'SYSFS_ATTR_SIZE' for such -buffers, and it looks like this was just an oversight. - -Fixes: 0a4509d7de2f ("ndctl: enumerate interleave sets") -Cc: Dan Williams -Signed-off-by: Vishal Verma ---- - ndctl/lib/libndctl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c -index ee737cb..5b276a7 100644 ---- a/ndctl/lib/libndctl.c -+++ b/ndctl/lib/libndctl.c -@@ -3292,8 +3292,8 @@ NDCTL_EXPORT int ndctl_dimm_is_active(struct ndctl_dimm *dimm) - { - struct ndctl_ctx *ctx = ndctl_dimm_get_ctx(dimm); - char *path = dimm->dimm_buf; -+ char buf[SYSFS_ATTR_SIZE]; - int len = dimm->buf_len; -- char buf[20]; - - if (snprintf(path, len, "%s/state", dimm->dimm_path) >= len) { - err(ctx, "%s: buffer too small!\n", --- -1.8.3.1 - diff --git a/ndctl-68.tar.gz b/ndctl-68.tar.gz deleted file mode 100644 index b26992dd39e813d65f0e023da262b62d7e893b89..0000000000000000000000000000000000000000 Binary files a/ndctl-68.tar.gz and /dev/null differ diff --git a/ndctl-71.1.tar.gz b/ndctl-71.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7a913a2b7b296e07b07ce9f809268bff3bfc0d3c Binary files /dev/null and b/ndctl-71.1.tar.gz differ diff --git a/ndctl.spec b/ndctl.spec index 644e530bc64ddad8b35ac6b6db3020fc3885799b..faefd9cd6316d7a54e276a15bb021643f222606b 100644 --- a/ndctl.spec +++ b/ndctl.spec @@ -1,15 +1,12 @@ Name: ndctl -Version: 68 -Release: 2 +Version: 71.1 +Release: 1 Summary: Manage "libnvdimm" subsystem devices (Non-volatile Memory) -License: GPLv2 +License: GPL-2, LGPL-2.1, MIT, CC0-1.0 Group: System Environment/Base Url: https://github.com/pmem/ndctl Source0: https://github.com/pmem/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -Patch1: 0001-ndctl-namespace-fix-a-resource-leak-in-file_write_in.patch -Patch2: 0002-libndctl-fix-a-potential-buffer-overflow.patch - Requires: ndctl-libs%{?_isa} = %{version}-%{release} Requires: daxctl-libs%{?_isa} = %{version}-%{release} BuildRequires: autoconf @@ -116,7 +113,7 @@ make check %define bashcompdir %(pkg-config --variable=completionsdir bash-completion) %files -%license util/COPYING licenses/BSD-MIT licenses/CC0 +%license LICENSES/preferred/GPL-2.0 LICENSES/other/MIT LICENSES/other/CC0-1.0 %{_bindir}/ndctl %{_mandir}/man1/ndctl* %{bashcompdir}/ @@ -126,35 +123,38 @@ make check %{_sysconfdir}/modprobe.d/nvdimm-security.conf %files -n daxctl -%license util/COPYING licenses/BSD-MIT licenses/CC0 +%license LICENSES/preferred/GPL-2.0 LICENSES/other/MIT LICENSES/other/CC0-1.0 %{_bindir}/daxctl %{_mandir}/man1/daxctl* %{_datadir}/daxctl/daxctl.conf %files -n ndctl-libs %doc README.md -%license COPYING licenses/BSD-MIT licenses/CC0 +%license LICENSES/preferred/LGPL-2.1 LICENSES/other/MIT LICENSES/other/CC0-1.0 %{_libdir}/libndctl.so.* %files -n daxctl-libs %doc README.md -%license COPYING licenses/BSD-MIT licenses/CC0 +%license LICENSES/preferred/LGPL-2.1 LICENSES/other/MIT LICENSES/other/CC0-1.0 %{_libdir}/libdaxctl.so.* %files -n ndctl-devel -%license COPYING +%license LICENSES/preferred/LGPL-2.1 %{_includedir}/ndctl/ %{_libdir}/libndctl.so %{_libdir}/pkgconfig/libndctl.pc %files -n daxctl-devel -%license COPYING +%license LICENSES/preferred/LGPL-2.1 %{_includedir}/daxctl/ %{_libdir}/libdaxctl.so %{_libdir}/pkgconfig/libdaxctl.pc %changelog +* Thu Jan 28 2021 Zhiqiang Liu - 71.1-1 +- update ndctl to v71.1 latest version + * Fri Oct 30 2020 Zhiqiang Liu - 68-2 - backport upstream patches to fix some potential problems