!23 update version to 6.14

Merge pull request !23 from 杨壮壮/master
This commit is contained in:
openeuler-ci-bot 2021-12-29 08:45:48 +00:00 committed by Gitee
commit c482f2eea5
7 changed files with 11 additions and 99 deletions

View File

@ -1,34 +0,0 @@
From d2b4876231ac9c2e26880ebe428bfb41e60e098e Mon Sep 17 00:00:00 2001
From: Neil Horman <nhorman@tuxdriver.com>
Date: Wed, 19 Dec 2018 10:10:44 -0500
Subject: [PATCH] Default to one thread if getaffinity returns an error
Its possible on virt systems, for sched_getaffinity to return an error
if the vm has cpus, but cgroup placement restricts that set to 0
physical processors. In that event, just default to 1 thread on cpu 0
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
---
rngd_jitter.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/rngd_jitter.c b/rngd_jitter.c
index 4e4b348..d14a3ba 100644
--- a/rngd_jitter.c
+++ b/rngd_jitter.c
@@ -421,7 +421,11 @@ int init_jitter_entropy_source(struct rng *ent_src)
cpus = CPU_ALLOC(i);
cpusize = CPU_ALLOC_SIZE(i);
CPU_ZERO_S(cpusize, cpus);
- sched_getaffinity(0, cpusize, cpus);
+ if (sched_getaffinity(0, cpusize, cpus) < 0) {
+ message(LOG_DAEMON|LOG_DEBUG, "Can not determine affinity of process, defaulting to 1 thread\n");
+ CPU_SET(0,cpus);
+ }
+
num_threads = CPU_COUNT_S(cpusize, cpus);
if (num_threads >= ent_src->rng_options[JITTER_OPT_THREADS].int_val)
--
2.17.2

View File

@ -1,32 +0,0 @@
From 5244d384e706a546fd1a72cc004a9d6551f0d84b Mon Sep 17 00:00:00 2001
From: Lon Willett <xgit@lonw.net>
Date: Sun, 30 Sep 2018 21:25:07 +0200
Subject: [PATCH 005/113] Obey restrictions on x86_rdrand_bytes usage
---
rngd_rdrand.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/rngd_rdrand.c b/rngd_rdrand.c
index ffb9e74..4529587 100644
--- a/rngd_rdrand.c
+++ b/rngd_rdrand.c
@@ -246,7 +246,14 @@ int xread_drng(void *buf, size_t size, struct rng *ent_src)
if (ent_src->rng_options[DRNG_OPT_AES].int_val)
return xread_drng_with_aes(buf, size, ent_src);
- x86_rdrand_bytes(buf, size);
+ /* NB: x86_rdrand_bytes might overrun end of buffer, if not a multiple of 8 */
+ if (size > 7)
+ x86_rdrand_bytes(buf, (size&~7));
+ if ((size&7) != 0) {
+ unsigned char tempbuf[8];
+ x86_rdrand_bytes(tempbuf, (size&7));
+ memcpy((unsigned char *)buf+(size&~7), tempbuf, (size&7));
+ }
return 0;
}
--
1.8.3.1

Binary file not shown.

View File

@ -1,22 +0,0 @@
diff --git a/jitterentropy-library/Makefile b/jitterentropy-library/Makefile
index 4ff069b..503be5c 100644
--- a/jitterentropy-library/Makefile
+++ b/jitterentropy-library/Makefile
@@ -56,17 +56,6 @@ cppcheck:
cppcheck --force -q --enable=performance --enable=warning --enable=portability *.h *.c
install:
- install -d -m 0755 $(DESTDIR)$(PREFIX)/share/man/man3
- install -m 644 doc/$(NAME).3 $(DESTDIR)$(PREFIX)/share/man/man3/
- gzip -9 $(DESTDIR)$(PREFIX)/share/man/man3/$(NAME).3
- install -d -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR)
- install -m 0755 -s lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/
- install -d -m 0755 $(DESTDIR)$(PREFIX)/$(INCDIR)
- install -m 0644 jitterentropy.h $(DESTDIR)$(PREFIX)/$(INCDIR)/
- install -m 0644 jitterentropy-base-user.h $(DESTDIR)$(PREFIX)/$(INCDIR)/
- $(RM) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so.$(LIBMAJOR)
- ln -s lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so.$(LIBMAJOR)
- ln -s lib$(NAME).so.$(LIBMAJOR) $(DESTDIR)$(PREFIX)/$(LIBDIR)/lib$(NAME).so
clean:
@- $(RM) $(NAME)

View File

@ -1,21 +1,17 @@
Name: rng-tools
Version: 6.5
Release: 3
Version: 6.14
Release: 1
Summary: Random number generator daemon
License: GPLv2+
URL: https://github.com/nhorman/rng-tools
Source0: https://github.com/nhorman/rng-tools/archive/v%{version}.tar.gz
Source1: rngd.service
Source2: jitterentropy-library-2.2.0.tar.gz
Patch0: jitterentropy-remove-install.patch
Patch1: backport-Default-to-one-thread-if-getaffinity-returns-an-erro.patch
Patch2: backport-Obey-restrictions-on-x86_rdrand_bytes-usage.patch
#Dependency
BuildRequires: gcc make gettext systemd autoconf automake
BuildRequires: libgcrypt-devel libsysfs-devel libcurl-devel libxml2-devel openssl-devel
Requires: libgcrypt libsysfs openssl libxml2 libcurl
BuildRequires: libgcrypt-devel libcurl-devel libxml2-devel openssl-devel
BuildRequires: libp11-devel jitterentropy-library-devel jansson-devel
Requires: libgcrypt libsysfs openssl libxml2 libcurl jitterentropy-library openssl-pkcs11
%{?systemd_requires}
%description
@ -25,11 +21,11 @@ and supplies entropy from them to the system kernel's /dev/random machinery.
%package_help
%prep
%autosetup -n %{name}-%{version} -a 2 -p1
%autosetup -n %{name}-%{version} -p1
%build
./autogen.sh
%configure
%configure --without-rtlsdr
%make_build
%install
@ -53,6 +49,7 @@ install -D -t $RPM_BUILD_ROOT%{_unitdir} -m 0644 %{SOURCE1}
%license COPYING
%doc AUTHORS NEWS README
%{_bindir}/rngtest
%{_bindir}/randstat
%{_sbindir}/rngd
%attr(0644,root,root) %{_unitdir}/rngd.service
@ -61,6 +58,9 @@ install -D -t $RPM_BUILD_ROOT%{_unitdir} -m 0644 %{SOURCE1}
%{_mandir}/man8/rngd.8.*
%changelog
* Wed Dec 29 2021 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 6.14-1
- update version to 6.14
* Sat Dec 19 2020 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 6.5-3
- fix rngd.service coredump

BIN
v6.14.tar.gz Normal file

Binary file not shown.

Binary file not shown.