<html dir="ltr"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="text-align:left; direction:ltr;"><div>We had seen something similar to thison another project when we switched from go 1.8 to 1.9.</div><div><br></div><div>On Linux, Go now calls the <code>getrandom</code> system call
without the <code>GRND_NONBLOCK</code> flag; it will now block
until the kernel has sufficient randomness. On kernels predating
the <code>getrandom</code> system call, Go continues to read
 from <code>/dev/urandom</code>.</div><div><br></div><div><br></div><div>We had to implement something along the lines of <a href="https://github.com/ciao-project/ciao/commit/30ddabb9e201a7985100750e64172ae4b518d1e6">https://github.com/ciao-project/ciao/commit/30ddabb9e201a7985100750e64172ae4b518d1e6</a> to work around this issue.</div><div><br></div><div>Is something like this happening within the VM in the agent which is written in go?</div><div><br></div><div><br></div><div><br></div><div>We had to modify our go code to sample </div><div>On Mon, 2018-09-24 at 16:40 -0700, Jon Olson via kata-dev wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">+<a href="mailto:tytso@mit.edu">tytso@mit.edu</a> -- Ted, I know you had some thoughts on seeding virtio-rng from /dev/urandom (not sure the listserv will let you post, but it should catch at least Sebastien and I). </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Jon</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 24, 2018 at 3:21 PM Boeuf, Sebastien <<a href="mailto:sebastien.boeuf@intel.com">sebastien.boeuf@intel.com</a>> wrote:<br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div>Hi folks,</div>
<div><br>
</div>
<div>Following the discussion from this morning during the Arch committee meeting, I have investigated the sporadic issue
<a href="https://github.com/kata-containers/runtime/issues/702" target="_blank">https://github.com/kata-containers/runtime/issues/702</a> preventing from starting some Kata containers.</div>
<div><br>
</div>
<div>I have been able to reproduce it pretty easily and I have identified it is related to the entropy of the host being almost entirely consumed by the first containers, leaving no time for the host to regenerate new entropy for the next containers.</div>
<div><br>
</div>
<div>Currently, the virtio-rng device exposed by Qemu relies on /dev/random on the host, and because this device will block any access to it until some more entropy is ready, that's why we end up getting the timeout from the gRPC client as the agent is not
 ready, hence the gRPC server does not run yet (the guest is blocked on getting new entropy from /dev/random).</div>
<div>One way to workaround this issue is to tweak the parameters of the virtio-rng device such as max-bytes=10, limiting the amount of entropy that can be consumed by the guest each period. This means that starting one container will not consume all host's
 entropy, but eventually, if we run a lot of containers, we'll be very likely to hit this same issue.</div>
<div><br>
</div>
<div>The long term solution seems to rely on /dev/urandom device as this one will not block if no entropy is ready yet. But from what we can read online, it seems that some people have some security concerns about it. I'd like to understand if those worries
 are valid or not, and if we should keep thinking about another way to fix this issue.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Sebastien<br>
</div>
</div>
</div>

_______________________________________________<br>
kata-dev mailing list<br>
<a href="mailto:kata-dev@lists.katacontainers.io" target="_blank">kata-dev@lists.katacontainers.io</a><br>
<a href="http://lists.katacontainers.io/cgi-bin/mailman/listinfo/kata-dev" rel="noreferrer" target="_blank">http://lists.katacontainers.io/cgi-bin/mailman/listinfo/kata-dev</a><br>
</blockquote></div>
<pre>_______________________________________________</pre><pre>kata-dev mailing list</pre><pre><a href="mailto:kata-dev@lists.katacontainers.io">kata-dev@lists.katacontainers.io</a></pre><pre><a href="http://lists.katacontainers.io/cgi-bin/mailman/listinfo/kata-dev">http://lists.katacontainers.io/cgi-bin/mailman/listinfo/kata-dev</a></pre><pre><br></pre></blockquote></body></html>