Bug 1079799 - bind doesn't start in a VM
Summary: bind doesn't start in a VM
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: bind
Version: 20
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Tomáš Hozza
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-24 03:22 UTC by Samuel Sieb
Modified: 2014-07-23 02:59 UTC (History)
5 users (show)

Fixed In Version: bind-9.9.4-15.P2.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-23 02:59:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Samuel Sieb 2014-03-24 03:22:21 UTC
I installed freeipa-server in a VM and ran the installer. But in the end it wouldn't start.  Through the logs I found out it was timing out.  The strange thing was that it appeared to start as soon as systemd tried to kill it for taking too long.  Using strace I found the problem.  rndc-confgen tries to read from /dev/random, but this doesn't work or at least takes too long.  I ran rndc-confgen manually with the keyboard option then updated the permissions that the script does.  Now bind starts with no problem.

I'm not sure what the proper solution here should be.  Maybe it could have a timeout on reading /dev/random and switch to /dev/urandom if it's taking too long?

Comment 1 Tomáš Hozza 2014-03-25 15:47:44 UTC
(In reply to Samuel Sieb from comment #0)
> I installed freeipa-server in a VM and ran the installer. But in the end it
> wouldn't start.  Through the logs I found out it was timing out.  The
> strange thing was that it appeared to start as soon as systemd tried to kill
> it for taking too long.  Using strace I found the problem.  rndc-confgen
> tries to read from /dev/random, but this doesn't work or at least takes too
> long.  I ran rndc-confgen manually with the keyboard option then updated the
> permissions that the script does.  Now bind starts with no problem.
> 
> I'm not sure what the proper solution here should be.  Maybe it could have a
> timeout on reading /dev/random and switch to /dev/urandom if it's taking too
> long?

Hi.

I don't think we want to trade the cryptographic strength of the generated key
for the speed. You can always prolong the timeout in named.service or generate
the key manually.

What we could do here is to add some reasonable log message so it is simpler
to find out what is happening.

Comment 2 Samuel Sieb 2014-03-26 05:39:19 UTC
Sure, I understand.  Maybe if I had let the VM run a bit longer before installing FreeIPA it would have been ok, but it's quite likely that someone would be setting it up right after creating the VM like I did.  And it provided a pretty bad experience.  I expect that most people wouldn't have been able to figure out what happened.

Comment 3 Tomáš Hozza 2014-06-09 11:31:25 UTC
Hi.

After discussing with our Security Engineer I'll switch to using /dev/urandom
when generating the rndc.key.

Comment 4 Petr Spacek 2014-06-09 12:11:30 UTC
Please don't do that. FreeIPA already solved that problem in newer version of installer.

Comment 5 Tomáš Hozza 2014-06-09 13:21:07 UTC
It is not FreeIPA-only issue. It happens also on VMs after installation, when 
there is not enough entropy. I discussed this with  Florian Weimer...

Comment 6 Tomáš Hozza 2014-06-09 14:18:06 UTC
Fixed in:

bind-9.9.4-13.P2.fc20
bind-9.9.5-5.fc21

Comment 7 Harald Reindl 2014-06-09 18:26:35 UTC
the proper solution in a virtual machine would be

yum install haveged
systemctl enable haveged
systemctl start haveged

using /dev/urandom only *burries* the real problem that you don't have cryptographic useable, unpredictable random numbers inside a VM

frankly for fedora cloud-images "haveged" should be part of the default install

Comment 8 Samuel Sieb 2014-06-09 19:04:57 UTC
Harald, thanks for the info.  I hadn't heard of that package before and may use it in the future.  However, the issue here is not that the VM can't generate enough entropy, it's just that at initial bootup there isn't any to start with.  I don't see how haveged would solve that issue since it would still require some time as well.  Or does it have some way of generating it that much quicker?

Comment 9 Harald Reindl 2014-06-09 19:10:25 UTC
haveged generates random numbers *very quickly*
i would say constantly 2 MB per second is enough for nearly anything 

[root@south:/data]$ dd if=/dev/random of=random.bin
^C0+189499 records in
30334+0 records out
15531008 bytes (16 MB) copied, 7.282 s, 2.1 MB/s

[root@south:/data]$ dd if=/dev/random of=random.bin
^C0+229088 records in
36673+0 records out
18776576 bytes (19 MB) copied, 8.72872 s, 2.2 MB/s

Comment 10 Samuel Sieb 2014-06-09 19:22:49 UTC
If that is good quality random data, then that would certainly solve the issue for me and would be better than /dev/urandom.  Now I'm kind of curious how they are able to do that.

Comment 11 Harald Reindl 2014-06-09 19:24:43 UTC
why not simply use Google? :-)

http://www.issihosts.com/haveged/
http://www.irisa.fr/caps/projects/hipsor/

Comment 12 Fedora Update System 2014-07-18 14:30:53 UTC
bind-9.9.4-15.P2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/bind-9.9.4-15.P2.fc20

Comment 13 Fedora Update System 2014-07-19 05:57:06 UTC
Package bind-9.9.4-15.P2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing bind-9.9.4-15.P2.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-8477/bind-9.9.4-15.P2.fc20
then log in and leave karma (feedback).

Comment 14 Fedora Update System 2014-07-23 02:59:46 UTC
bind-9.9.4-15.P2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.