1 |
commit: 7df0cdad2656f7efa75b490355fb5db8a3ba057a |
2 |
Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Mar 30 15:58:15 2019 +0000 |
4 |
Commit: Aaron Bauman <bman <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 4 21:16:18 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7df0cdad |
7 |
|
8 |
sys-apps/rng-tools: remove unused patch |
9 |
|
10 |
Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail.com> |
11 |
Closes: https://github.com/gentoo/gentoo/pull/11552 |
12 |
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org> |
13 |
|
14 |
.../rng-tools/files/rng-tools-6-fix-noctty.patch | 45 ---------------------- |
15 |
1 file changed, 45 deletions(-) |
16 |
|
17 |
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 |
18 |
deleted file mode 100644 |
19 |
index e915150adb5..00000000000 |
20 |
--- a/sys-apps/rng-tools/files/rng-tools-6-fix-noctty.patch |
21 |
+++ /dev/null |
22 |
@@ -1,45 +0,0 @@ |
23 |
-From: Gokturk Yuksek <gokturk@××××××××××.edu> |
24 |
-Subject: [PATCH] Fix rngd to open the entropy source with 'O_NOCTTY' flag |
25 |
- |
26 |
-When start-stop-daemon starts a rngd instance configured to use a tty |
27 |
-device as its entropy source, the application crashes due to not being |
28 |
-able to read from the entropy device. This is caused by |
29 |
-start-stop-daemon calling setsid() before executing rngd, which |
30 |
-disassociates the controlling terminal. When rngd attempts to open a |
31 |
-hardware entropy source that's a tty device, per POSIX rules, the |
32 |
-device becomes the controlling terminal for the process. Then rngd |
33 |
-calls daemon(), which internally calls setsid(), and consequently |
34 |
-disassociates the controlling terminal for the child. Meanwhile the |
35 |
-parent rngd process exits. This results in tty device hanging up. By |
36 |
-looking at the strace logs attached to the bug, it can be observed |
37 |
-that although the parent rngd process is able to read() from the |
38 |
-entropy source successfully, further attempts to read() by the child |
39 |
-rngd process return 0. This complies with the POSIX, which states that |
40 |
-read() calls on a hung up terminal shall return 0. |
41 |
- |
42 |
-Note that when rngd is started without start-stop-daemon, this problem |
43 |
-does not happen because at the time of opening the entropy source rngd |
44 |
-already has a controlling terminal. |
45 |
- |
46 |
-Prevent the entropy source from becoming the controlling terminal by |
47 |
-passing 'O_NOCTTY' flag to open() when opening an entropy source. This |
48 |
-flag prevents a tty device from becoming the controlling terminal for |
49 |
-a process without a controlling terminal at the time of open(). |
50 |
- |
51 |
-Thanks to John Bowler <jbowler@×××.org> for debugging the problem and |
52 |
-pinpointing the issue as well as confirming the fix. |
53 |
- |
54 |
-Gentoo-Bug-URL: https://bugs.gentoo.org/556456 |
55 |
-Reported-By: John Bowler <jbowler@×××.org> |
56 |
- |
57 |
---- rng-tools-rng-tools-6/rngd_entsource.c |
58 |
-+++ rng-tools-rng-tools-6/rngd_entsource.c |
59 |
-@@ -162,7 +162,7 @@ |
60 |
- struct sysfs_attribute *rngavail; |
61 |
- char buf[16]; |
62 |
- |
63 |
-- ent_src->rng_fd = open(ent_src->rng_fname, O_RDONLY); |
64 |
-+ ent_src->rng_fd = open(ent_src->rng_fname, O_RDONLY | O_NOCTTY); |
65 |
- if (ent_src->rng_fd == -1) { |
66 |
- message(LOG_DAEMON|LOG_DEBUG, "Unable to open file: %s", ent_src->rng_fname); |
67 |
- return 1; |