Compare commits

...

11 Commits

Author SHA1 Message Date
openeuler-ci-bot
0ffa745512
!40 [sync] PR-36: enable make check
From: @openeuler-sync-bot 
Reviewed-by: @lvying6 
Signed-off-by: @lvying6
2023-04-04 02:46:19 +00:00
fly_fzc
46cfbfb7bf enable make check
(cherry picked from commit eec966b9f3fe7f16a368222f5251b4368a6ff48a)
2023-04-04 08:49:13 +08:00
openeuler-ci-bot
79141c734f
!29 fix changelog to make it in descending chronological order
From: @panxh_purple 
Reviewed-by: @lvying6 
Signed-off-by: @lvying6
2022-09-02 07:40:47 +00:00
panxiaohe
72f135e8ae fix changelog to make it in descending chronological order 2022-09-02 10:53:52 +08:00
openeuler-ci-bot
ca6d7b20c1 !19 fix rngd.service coredump
From: @yang_zhuang_zhuang
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2020-12-21 09:30:51 +08:00
yang_zhuang_zhuang
b1dd8d3b29 fix rngd.service coredump 2020-12-19 17:09:46 +08:00
openeuler-ci-bot
5eebb00fcc !14 fix rngd.service coredump
From: @yang_zhuang_zhuang
Reviewed-by: @overweight,@small_leek
Signed-off-by: @overweight,@small_leek
2020-12-11 16:56:10 +08:00
yang_zhuang_zhuang
a5d957ea86 fic rngd.service coredump 2020-12-10 19:12:22 +08:00
openeuler-ci-bot
571f8ad39c !8 update to 6.5
Merge pull request !8 from pengyq/openEuler-20.03-LTS
2020-08-29 15:54:40 +08:00
pengyq
84c94d1674 update to 6.5 2020-08-29 11:39:48 +08:00
openeuler-ci-bot
4bfeeba639 !6 update to 6.10
Merge pull request !6 from pengyq/openEuler-20.03-LTS
2020-08-06 11:39:32 +08:00
7 changed files with 94 additions and 8 deletions

View File

@ -0,0 +1,34 @@
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

@ -0,0 +1,32 @@
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,7 +1,7 @@
diff --git a/jitterentropy-library-2.2.0/Makefile b/jitterentropy-library-2.2.0/Makefile
diff --git a/jitterentropy-library/Makefile b/jitterentropy-library/Makefile
index 4ff069b..503be5c 100644
--- a/jitterentropy-library-2.2.0/Makefile
+++ b/jitterentropy-library-2.2.0/Makefile
--- a/jitterentropy-library/Makefile
+++ b/jitterentropy-library/Makefile
@@ -56,17 +56,6 @@ cppcheck:
cppcheck --force -q --enable=performance --enable=warning --enable=portability *.h *.c

View File

@ -1,6 +1,6 @@
Name: rng-tools
Version: 6.10
Release: 1
Version: 6.5
Release: 5
Summary: Random number generator daemon
License: GPLv2+
URL: https://github.com/nhorman/rng-tools
@ -9,11 +9,12 @@ 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
BuildRequires: libp11-devel jansson-devel
Requires: libgcrypt libsysfs openssl libxml2 libcurl
%{?systemd_requires}
@ -28,7 +29,7 @@ and supplies entropy from them to the system kernel's /dev/random machinery.
%build
./autogen.sh
%configure --without-rtlsdr
%configure
%make_build
%install
@ -36,6 +37,9 @@ and supplies entropy from them to the system kernel's /dev/random machinery.
install -D -t $RPM_BUILD_ROOT%{_unitdir} -m 0644 %{SOURCE1}
%check
%make_build check
%pre
%post
@ -60,10 +64,26 @@ install -D -t $RPM_BUILD_ROOT%{_unitdir} -m 0644 %{SOURCE1}
%{_mandir}/man8/rngd.8.*
%changelog
* Fri Mar 31 2023 fuanan <fuanan3@h-partners.com> - 6.5-5
- enable make check
* Fri Sep 2 2022 panxiaohe <panxh.life@foxmail.com> - 6.5-4
- fix changelog to make it in descending chronological order
* Sat Dec 19 2020 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 6.5-3
- fix rngd.service coredump
* Thu Dec 10 2020 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 6.5-2
- fix rngd.service coredump
* Sat Aug 29 2020 Yeqing Peng <pengyeqing@huawei.com> - 6.5-1
- since 6.6, jitterentropy-library is independed from rng-tools,
no any entropy source will lead to rng-tools service fail.
* Mon Aug 03 2020 Yeqing Peng <pengyeqing@huawei.com> - 6.10-1
- update to 6.10
* Fri Oct 11 2019 openEuler Buildteam <buildteam@openeuler.org> - 6.3.1-4
* Sat Feb 29 2020 openEuler Buildteam <buildteam@openeuler.org> - 6.3.1-4
- add jitterentropy support
* Wed Feb 19 2020 wanjiankang <wanjiankang@huawei.com> - 6.3.1-3

Binary file not shown.

BIN
v6.5.tar.gz Normal file

Binary file not shown.