Aha, that sounds logical. So you think the message:
random: udevd: uninitialized urandom read (16 bytes read)
Has been thrown 7 more times?
Yes, I am also quite sure it is a summary after it happened.
edit: I tried to find examples of this behaviour of suppressing repeating warnings, and could not find any. So not proven yet. If I look at the code, which is actually quite fun to do, I notice the following:
Some snippets from the description of random.c:
https://elixir.bootlin.com/linux/v5.4.4 ... r/random.c
* Computers are very predictable devices. Hence it is extremely hard
* to produce truly random numbers on a computer
So instead, we must try to
* gather "environmental noise" from the computer's environment, which
* must be hard for outside attackers to observe, and use that to
* generate random numbers.
Randomness from these sources are
* added to an "entropy pool"
* When random bytes are desired, they are obtained by taking the SHA
* hash of the contents of the "entropy pool"
* The userspace interfaces are two character devices /dev/random and
* /dev/urandom.
/dev/random is suitable for use when very high
* quality randomness is desired ..., as it will only return a maximum of the number of
* bits of randomness
* The /dev/urandom device does not have this limit, and will return
* as many bytes as are requested.
Then in the code I see the following happening:
First it creates a ratelimit state, called urandom_warning:
ratelimit_state urandom_warning =
Code: Select all
RATELIMIT_STATE_INIT("warn_urandom_randomness", HZ, 3);
Then after some time is checks if there are missed warnings, and throws the message:
Code: Select all
if (urandom_warning.missed) {
pr_notice("random: %d urandom warning(s) missed "
"due to ratelimiting\n",
urandom_warning.missed);
urandom_warning.missed = 0;
}
While looking how a warning is thrown I noticed this code:
Code: Select all
static int maxwarn = 10;
int ret;
if (!crng_ready() && maxwarn > 0) {
maxwarn--;
if (__ratelimit(&urandom_warning))
printk(KERN_NOTICE "random: %s: uninitialized "
"urandom read (%zd bytes read)\n",
current->comm, nbytes);
So I guess this is where at __ratelimit(&urandom_warning), the magic is happening
https://elixir.bootlin.com/linux/v5.4.4 ... imit.c#L27
That function, I think (?), is called from ratelimit.c. That is stating the following:
Code: Select all
/*
* If we contend on this state's lock then almost
* by definition we are too busy to print a message,
* in addition to the one that will be printed by
* the entity that is holding the lock already:
*/
And setting missed:
Question that remains: how can I see the missed warnings? Could you, the one reading this

, help me answer this?
Copyright notice on random.c in kernel 5.4.48: (I think I have to include this here

)
* Copyright (C) 2017 Jason A. Donenfeld <
Jason@zx2c4.com>. All
* Rights Reserved.
*
* Copyright Matt Mackall <
mpm@selenic.com>, 2003, 2004, 2005
*
* Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999. All
* rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, and the entire permission notice in its entirety,
* including the disclaimer of warranties.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* ALTERNATIVELY, this product may be distributed under the terms of
* the GNU General Public License, in which case the provisions of the GPL are
* required INSTEAD OF the above restrictions. (This clause is
* necessary due to a potential bad interaction between the GPL and
* the restrictions contained in a BSD-style copyright.)
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
* WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.