diff options
author | 2017-08-14 14:07:03 +0200 | |
---|---|---|
committer | 2017-08-14 15:35:42 +0200 | |
commit | c6a8fda5117616d36874aff862fc8093953e5e44 (patch) | |
tree | 8dfee98fda1b47a3bbaa06c6be0adf355408e82f /sys-apps/rng-tools/files | |
parent | net-libs/ntirpc: Bump to version 1.5.2 (diff) | |
download | gentoo-c6a8fda5117616d36874aff862fc8093953e5e44.tar.gz gentoo-c6a8fda5117616d36874aff862fc8093953e5e44.tar.bz2 gentoo-c6a8fda5117616d36874aff862fc8093953e5e44.zip |
sys-apps/rng-tools: Bump to version 6
Package-Manager: Portage-2.3.7, Repoman-2.3.3
Diffstat (limited to 'sys-apps/rng-tools/files')
5 files changed, 53 insertions, 8 deletions
diff --git a/sys-apps/rng-tools/files/rng-tools-5-fix-noctty.patch b/sys-apps/rng-tools/files/rng-tools-5-fix-noctty.patch index a48b235ac17c..568ebe04589d 100644 --- a/sys-apps/rng-tools/files/rng-tools-5-fix-noctty.patch +++ b/sys-apps/rng-tools/files/rng-tools-5-fix-noctty.patch @@ -32,8 +32,8 @@ pinpointing the issue as well as confirming the fix. Gentoo-Bug-URL: https://bugs.gentoo.org/556456 Reported-By: John Bowler <jbowler@acm.org> ---- rngd_entsource.c -+++ rngd_entsource.c +--- a/rngd_entsource.c ++++ b/rngd_entsource.c @@ -175,7 +175,7 @@ */ int init_entropy_source(struct rng *ent_src) diff --git a/sys-apps/rng-tools/files/rng-tools-5-man-fill-watermark.patch b/sys-apps/rng-tools/files/rng-tools-5-man-fill-watermark.patch index 4cedf8fc97d3..ea249a5ebdfb 100644 --- a/sys-apps/rng-tools/files/rng-tools-5-man-fill-watermark.patch +++ b/sys-apps/rng-tools/files/rng-tools-5-man-fill-watermark.patch @@ -2,8 +2,8 @@ https://bugs.gentoo.org/555094 patch by Gokturk Yuksek <gokturk@binghamton.edu> ---- rngd.8.in -+++ rngd.8.in +--- a/rngd.8.in ++++ b/rngd.8.in @@ -66,7 +66,9 @@ .TP \fB\-W\fI n\fR, \fB\-\-fill\-watermark=\fInnn\fR diff --git a/sys-apps/rng-tools/files/rng-tools-5-man-rng-device.patch b/sys-apps/rng-tools/files/rng-tools-5-man-rng-device.patch index fd6b97eff326..82a0cf295765 100644 --- a/sys-apps/rng-tools/files/rng-tools-5-man-rng-device.patch +++ b/sys-apps/rng-tools/files/rng-tools-5-man-rng-device.patch @@ -2,8 +2,8 @@ https://bugs.gentoo.org/555106 patch by Gokturk Yuksek <gokturk@binghamton.edu> ---- rngd.8.in -+++ rngd.8.in +--- a/rngd.8.in ++++ b/rngd.8.in @@ -59,7 +59,7 @@ .TP \fB\-r\fI file\fR, \fB\-\-rng-device=\fIfile\fR diff --git a/sys-apps/rng-tools/files/rng-tools-6-fix-noctty.patch b/sys-apps/rng-tools/files/rng-tools-6-fix-noctty.patch new file mode 100644 index 000000000000..e915150adb58 --- /dev/null +++ b/sys-apps/rng-tools/files/rng-tools-6-fix-noctty.patch @@ -0,0 +1,45 @@ +From: Gokturk Yuksek <gokturk@binghamton.edu> +Subject: [PATCH] Fix rngd to open the entropy source with 'O_NOCTTY' flag + +When start-stop-daemon starts a rngd instance configured to use a tty +device as its entropy source, the application crashes due to not being +able to read from the entropy device. This is caused by +start-stop-daemon calling setsid() before executing rngd, which +disassociates the controlling terminal. When rngd attempts to open a +hardware entropy source that's a tty device, per POSIX rules, the +device becomes the controlling terminal for the process. Then rngd +calls daemon(), which internally calls setsid(), and consequently +disassociates the controlling terminal for the child. Meanwhile the +parent rngd process exits. This results in tty device hanging up. By +looking at the strace logs attached to the bug, it can be observed +that although the parent rngd process is able to read() from the +entropy source successfully, further attempts to read() by the child +rngd process return 0. This complies with the POSIX, which states that +read() calls on a hung up terminal shall return 0. + +Note that when rngd is started without start-stop-daemon, this problem +does not happen because at the time of opening the entropy source rngd +already has a controlling terminal. + +Prevent the entropy source from becoming the controlling terminal by +passing 'O_NOCTTY' flag to open() when opening an entropy source. This +flag prevents a tty device from becoming the controlling terminal for +a process without a controlling terminal at the time of open(). + +Thanks to John Bowler <jbowler@acm.org> for debugging the problem and +pinpointing the issue as well as confirming the fix. + +Gentoo-Bug-URL: https://bugs.gentoo.org/556456 +Reported-By: John Bowler <jbowler@acm.org> + +--- rng-tools-rng-tools-6/rngd_entsource.c ++++ rng-tools-rng-tools-6/rngd_entsource.c +@@ -162,7 +162,7 @@ + struct sysfs_attribute *rngavail; + char buf[16]; + +- ent_src->rng_fd = open(ent_src->rng_fname, O_RDONLY); ++ ent_src->rng_fd = open(ent_src->rng_fname, O_RDONLY | O_NOCTTY); + if (ent_src->rng_fd == -1) { + message(LOG_DAEMON|LOG_DEBUG, "Unable to open file: %s", ent_src->rng_fname); + return 1; diff --git a/sys-apps/rng-tools/files/test-for-argp.patch b/sys-apps/rng-tools/files/test-for-argp.patch index 129a522e5686..4ed2aa40b6df 100644 --- a/sys-apps/rng-tools/files/test-for-argp.patch +++ b/sys-apps/rng-tools/files/test-for-argp.patch @@ -10,8 +10,8 @@ Reported-by: Ed Wildgoose <gentoo@wildgooses.com> Signed-off-by: Anthony G. Basile <blueness@gentoo.org> ---- configure.ac.orig 2012-05-26 22:45:42.753478198 +0000 -+++ configure.ac 2012-05-27 00:36:23.175844081 +0000 +--- a/configure.ac ++++ b/configure.ac @@ -47,6 +47,28 @@ dnl Checks for optional library functions dnl ------------------------------------- |