ndctl: upgrade to latest version v71.1
upgrade to latest version v71.1. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
This commit is contained in:
parent
9a67f950af
commit
cdcaa3dd25
@ -1,32 +0,0 @@
|
|||||||
From b0d9cad81f2e811608b898922643f655043361aa Mon Sep 17 00:00:00 2001
|
|
||||||
From: Vishal Verma <vishal.l.verma@intel.com>
|
|
||||||
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 <dan.j.williams@intel.com>
|
|
||||||
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
From 2f99e11812e6a4d9814bfc8ef038ca845db5394c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Vishal Verma <vishal.l.verma@intel.com>
|
|
||||||
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 <dan.j.williams@intel.com>
|
|
||||||
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
||||||
BIN
ndctl-68.tar.gz
BIN
ndctl-68.tar.gz
Binary file not shown.
BIN
ndctl-71.1.tar.gz
Normal file
BIN
ndctl-71.1.tar.gz
Normal file
Binary file not shown.
24
ndctl.spec
24
ndctl.spec
@ -1,15 +1,12 @@
|
|||||||
Name: ndctl
|
Name: ndctl
|
||||||
Version: 68
|
Version: 71.1
|
||||||
Release: 2
|
Release: 1
|
||||||
Summary: Manage "libnvdimm" subsystem devices (Non-volatile Memory)
|
Summary: Manage "libnvdimm" subsystem devices (Non-volatile Memory)
|
||||||
License: GPLv2
|
License: GPL-2, LGPL-2.1, MIT, CC0-1.0
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Url: https://github.com/pmem/ndctl
|
Url: https://github.com/pmem/ndctl
|
||||||
Source0: https://github.com/pmem/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
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: ndctl-libs%{?_isa} = %{version}-%{release}
|
||||||
Requires: daxctl-libs%{?_isa} = %{version}-%{release}
|
Requires: daxctl-libs%{?_isa} = %{version}-%{release}
|
||||||
BuildRequires: autoconf
|
BuildRequires: autoconf
|
||||||
@ -116,7 +113,7 @@ make check
|
|||||||
%define bashcompdir %(pkg-config --variable=completionsdir bash-completion)
|
%define bashcompdir %(pkg-config --variable=completionsdir bash-completion)
|
||||||
|
|
||||||
%files
|
%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
|
%{_bindir}/ndctl
|
||||||
%{_mandir}/man1/ndctl*
|
%{_mandir}/man1/ndctl*
|
||||||
%{bashcompdir}/
|
%{bashcompdir}/
|
||||||
@ -126,35 +123,38 @@ make check
|
|||||||
%{_sysconfdir}/modprobe.d/nvdimm-security.conf
|
%{_sysconfdir}/modprobe.d/nvdimm-security.conf
|
||||||
|
|
||||||
%files -n daxctl
|
%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
|
%{_bindir}/daxctl
|
||||||
%{_mandir}/man1/daxctl*
|
%{_mandir}/man1/daxctl*
|
||||||
%{_datadir}/daxctl/daxctl.conf
|
%{_datadir}/daxctl/daxctl.conf
|
||||||
|
|
||||||
%files -n ndctl-libs
|
%files -n ndctl-libs
|
||||||
%doc README.md
|
%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.*
|
%{_libdir}/libndctl.so.*
|
||||||
|
|
||||||
%files -n daxctl-libs
|
%files -n daxctl-libs
|
||||||
%doc README.md
|
%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.*
|
%{_libdir}/libdaxctl.so.*
|
||||||
|
|
||||||
%files -n ndctl-devel
|
%files -n ndctl-devel
|
||||||
%license COPYING
|
%license LICENSES/preferred/LGPL-2.1
|
||||||
%{_includedir}/ndctl/
|
%{_includedir}/ndctl/
|
||||||
%{_libdir}/libndctl.so
|
%{_libdir}/libndctl.so
|
||||||
%{_libdir}/pkgconfig/libndctl.pc
|
%{_libdir}/pkgconfig/libndctl.pc
|
||||||
|
|
||||||
%files -n daxctl-devel
|
%files -n daxctl-devel
|
||||||
%license COPYING
|
%license LICENSES/preferred/LGPL-2.1
|
||||||
%{_includedir}/daxctl/
|
%{_includedir}/daxctl/
|
||||||
%{_libdir}/libdaxctl.so
|
%{_libdir}/libdaxctl.so
|
||||||
%{_libdir}/pkgconfig/libdaxctl.pc
|
%{_libdir}/pkgconfig/libdaxctl.pc
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jan 28 2021 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 71.1-1
|
||||||
|
- update ndctl to v71.1 latest version
|
||||||
|
|
||||||
* Fri Oct 30 2020 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 68-2
|
* Fri Oct 30 2020 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 68-2
|
||||||
- backport upstream patches to fix some potential problems
|
- backport upstream patches to fix some potential problems
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user