alg: drbg: could not allocate DRNG handle for ...
I only see this error on the console during the boot process of virtual machines we create. EDIT: 2/5/16 - I see it on some bare-metal installations, too. (It does proceed to boot completely.) I assume it has something to do with the virtualized hardware and lack of a (compatible) random number generator. The problem is I can't assess the severity. Is the encryption strength compromised? (Should I even care about this error?) How can I fix it?
We are using QEMU/KVM under CentOS 6.7. I can do a virsh dumpxml
of a example system if you really think it will help. We are using the Anaconda default cipher/key size. (aes-xts-plain64/512)
This is the earliest reference I found on the linux-crypto mailing list. Unfortunately, it's a bit over my head.
http://www.mail-archive.com/linux-crypto%40vger.kernel.org/msg10398.html
Consicely, I do not believe it affects the strength of your encryption.
I've checked the source code and as long as I'm interpreting what I read right, you dont necessarily have to worry about this.
This code belongs to the module 'stdrng'. At least on Fedora 23 this is built into the kernel rather than exported as a kernel module.
When stdrng is initialized for the first time the following calls occur.
In crypto/drbg.c initialization starts here.
This registers all the drbgs known to the system..
It then passes it to a helper function that performs the initialization:
In
crypto/rng.c
this just iterates through each rng to register it..This function does a bunch of initialization steps then calls another function for allocation.
Whats not so obvious is what happens during register.
Another module called
tcrypt
also built into the kernel receives notifications of new algorithms being inserted. Once it sees a new registered algorithm it schedules a test of it. This is what produces the output you see on your screen.When the test is finished, the algorithm goes into a TESTED state. If the test fails, I imagine (I couldnt find the bit that produces this behaviour) it isn't selectable for searching if you pass the right flags.
Whether or not the test passes is definitely internally stored.
In addition to this, calling the psudeo random number generator causes a list of algorithms to be iterated of prngs in order of strength as dictated by this note in
crypto/drbg.c
Since the strongest one does not fail (hmac sha256) its unlikely you are using the failed ones even if they could be selected.
To summarize -
stdrng
module is required for something.stdrng
hopefully should not use these algorithms as the basis for their PRNG source.You can see which algos have succeeded and passed the tests using the following command:
You can also see the selection priority with the 'priority' field. The higher the value the stronger the PRNG according to the module author.
So, happy to be wrong here as I dont consider myself a kernel programmer but, in conclusion -
When
stdrng
loads it appears to select other algorithms from the list of acceptable algos which are considered stronger than the failed ones, plus the failed ones aren't likely selected anyway.As such, I believe that this no additional risk to you when using luks.
Per Red Hat Knowledge Base, you must add 'ctr' Kernel module to your initrd. Their instructions also say to include 'ecb' though it seems the issue is with the 'ctr' module not being loaded.
Subscribers can see the full information. I am not sure if I am permitted to republish the rest here so I have paraphrased the full solution.
https://access.redhat.com/solutions/2249181
Edit 9/29/2016:
You can also add these drivers to
/etc/dracut.conf
so that they are added to the new initramfs on Kernel upgrades. Otherwise, your symptoms mysteriously reappear many months later. ;)