From nobody Fri Sep 20 22:16:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1562167962; cv=none; d=zoho.com; s=zohoarc; b=Us2ZJQ0s4z277b8C9LVMzcURA6jn6Km4oEmsx8OBTpOhAj5InRfc1QmQIK/2LfLDz6E993+sf3bhf/1YCUStXxtA4tVvDOpcCFI4Dbjc2m1zafQT6w+Vtxsfh7m2U5JnsbCpWfOhIHAMzwmDLAV0EUgyHfnhWNi2CnqL2FqcJ8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562167962; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=iwFAPZ2l1R+58yR25FJ4SJAYFQJcDeqMlXXMpucEHHs=; b=NrqSmTlby7auiwBppaCv5kOGfj8Irnq5d7rEHsQ4p91lnWp8JIVn454hSrWrfA2i0pjnwSQ7SyjnUd+nP9LFfw7XKOLkA8C9SzGaFmcq4Tv3c8Z90MyVTc1aO6I7/JRBb4z7Toh/Q9njTYnhOHUl4/i6V0tNEfbYbtwDNeqqecw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562167962571675.6565541156898; Wed, 3 Jul 2019 08:32:42 -0700 (PDT) Received: from localhost ([::1]:36908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hihFR-0006df-K7 for importer@patchew.org; Wed, 03 Jul 2019 11:32:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40006) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hih8p-0000Nq-QS for qemu-devel@nongnu.org; Wed, 03 Jul 2019 11:25:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hih8n-0007c4-RQ for qemu-devel@nongnu.org; Wed, 03 Jul 2019 11:25:51 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:44739) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hih8m-0007b3-8j; Wed, 03 Jul 2019 11:25:48 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MStT6-1i6J3w0BHa-00UM6v; Wed, 03 Jul 2019 17:25:18 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 3 Jul 2019 17:25:12 +0200 Message-Id: <20190703152513.29166-2-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190703152513.29166-1-laurent@vivier.eu> References: <20190703152513.29166-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:JcaF5sjwHTFCt7aHzuKIJ0KCl4QgWlIzcfph3RCg81DUWUmrX69 eR8qDI9rxShWmJepn9PJthE1svivmyONywZACPDy+FTlpbOmnx0O3POyUfMmgmARr95lXZo zGrgJypDvtiDzJn4PJSTwF4VuK7m71jF9ISIpRibMf488EfO7etAu+xe6ZDKQVSicAMht6s oJjpetiF9bLXhiQjCYNlw== X-UI-Out-Filterresults: notjunk:1;V03:K0:74keQtL+OR8=:KBsknnQfnpANKM6ZOdFTXk so2pcTbNZab8lWa2zgjemHNvHFraTX3mkNj5Z9sQWw50l3u+DcLmQ84hqbhYQMGcpGZMnVDYH yK5oyKX6hkVRplIQVebNuAvsnEfMTsyXfPDMIlGf39+0S9hGKxDlWq8zYtadF6w8/9EC/FQg3 q2QN+sSdF7yR2hK/9EDvYhCGjZ+blKylkw10nj63yn2+LsVIIle5Ul//Yv4nWCZRA9Q2+vi9x IVkWbLiDa8ydmUiacj66ux5naM+5ZQh2fpepjZSyCn74u1Neyna1QqAzmJ55M3JbF3K8O6E7k TQ5mqqv4pXNnyLpRRxyGrfKAepKhC8flqAN3+eG1FchFvDZbfd79Y5nlueBEBDT4MCO6ayK4z ZKYe+uFd0Y7XdOG14BH3eovnXk1IMTB7HFpRn4R2DVXm2r2rFcAQY9cr92dJzet0anWw5tXpt CNwF11Xzot3K2vPaiAzsD+4X+/AyLsqF9attxbGy+roM8TDZ1KrhT3lJ5Ajh42riJ/MZ090fR aVgS+sIimG/ckqFVpBr6SarVm+b4Nuz4j+5rkIPaMOg5yy8k++RO4tl3mPHNkaq0Yctms3tgZ C2rpAH06sGlKqFAQAc874EL1UbOT7TvVWPf7j+sxVFnIakwGTIwfdOlR4vzAW8gOX0ntwKUIR 6qytn3at1IXi0mXX2Z9rucfqq53oCFWf7JFVmbrryBD5bBxhwui4zamuxUqG4Lh6SUPmlqVZc 4Qgu/znARPVHZI+c7hadDwGR9676dGcyExOuq0K+t1GHZQCpIni6ARwg+GQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.13 Subject: [Qemu-devel] [PULL v2 1/2] VirtIO-RNG: Update default entropy source to `/dev/urandom` X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Kashyap Chamarthy , qemu-trivial@nongnu.org, Amit Shah , Michael Tokarev , Laurent Vivier , Markus Armbruster , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Kashyap Chamarthy When QEMU exposes a VirtIO-RNG device to the guest, that device needs a source of entropy, and that source needs to be "non-blocking", like `/dev/urandom`. However, currently QEMU defaults to the problematic `/dev/random`, which on Linux is "blocking" (as in, it waits until sufficient entropy is available). Why prefer `/dev/urandom` over `/dev/random`? Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Markus Armbruster Reviewed-by: Stefan Hajnoczi --------------------------------------------- The man pages of urandom(4) and random(4) state: "The /dev/random device is a legacy interface which dates back to a time where the cryptographic primitives used in the implementation of /dev/urandom were not widely trusted. It will return random bytes only within the estimated number of bits of fresh noise in the entropy pool, blocking if necessary. /dev/random is suitable for applications that need high quality randomness, and can afford indeterminate delays." Further, the "Usage" section of the said man pages state: "The /dev/random interface is considered a legacy interface, and /dev/urandom is preferred and sufficient in all use cases, with the exception of applications which require randomness during early boot time; for these applications, getrandom(2) must be used instead, because it will block until the entropy pool is initialized. "If a seed file is saved across reboots as recommended below (all major Linux distributions have done this since 2000 at least), the output is cryptographically secure against attackers without local root access as soon as it is reloaded in the boot sequence, and perfectly adequate for network encryption session keys. Since reads from /dev/random may block, users will usually want to open it in nonblocking mode (or perform a read with timeout), and provide some sort of user notification if the desired entropy is not immediately available." And refer to random(7) for a comparison of `/dev/random` and `/dev/urandom`. What about other OSes? ---------------------- `/dev/urandom` exists and works on OS-X, FreeBSD, DragonFlyBSD, NetBSD and OpenBSD, which cover all the non-Linux platforms we explicitly support, aside from Windows. On Windows `/dev/random` doesn't work either so we don't regress. This is actually another argument in favour of using the newly proposed 'rng-builtin' backend by default, as that will work on Windows. - - - Given the above, change the entropy source for VirtIO-RNG device to `/dev/urandom`. Related discussion in these[1][2] past threads. [1] https://lists.nongnu.org/archive/html/qemu-devel/2018-06/msg08335.html -- "RNG: Any reason QEMU doesn't default to `/dev/urandom`?" [2] https://lists.nongnu.org/archive/html/qemu-devel/2018-09/msg02724.html -- "[RFC] Virtio RNG: Consider changing the default entropy source to /dev/urandom" Signed-off-by: Kashyap Chamarthy Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Markus Armbruster Signed-off-by: Laurent Vivier Message-Id: <20190529143106.11789-2-lvivier@redhat.com> Signed-off-by: Laurent Vivier --- backends/rng-random.c | 2 +- qemu-options.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/rng-random.c b/backends/rng-random.c index aa5b9285f04d..a81058139330 100644 --- a/backends/rng-random.c +++ b/backends/rng-random.c @@ -113,7 +113,7 @@ static void rng_random_init(Object *obj) rng_random_set_filename, NULL); =20 - s->filename =3D g_strdup("/dev/random"); + s->filename =3D g_strdup("/dev/urandom"); s->fd =3D -1; } =20 diff --git a/qemu-options.hx b/qemu-options.hx index 0d8beb4afdef..2aae19b0f925 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4328,7 +4328,7 @@ Creates a random number generator backend which obtai= ns entropy from a device on the host. The @option{id} parameter is a unique ID that will be used to reference this entropy backend from the @option{virtio-rng} device. The @option{filename} parameter specifies which file to obtain -entropy from and if omitted defaults to @option{/dev/random}. +entropy from and if omitted defaults to @option{/dev/urandom}. =20 @item -object rng-egd,id=3D@var{id},chardev=3D@var{chardevid} =20 --=20 2.21.0 From nobody Fri Sep 20 22:16:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1562167767; cv=none; d=zoho.com; s=zohoarc; b=jCgcxASV1TSCGSyZKipiFWVkHBSu8ZQQHsqfCeYpDwoQqAQzA9GTjzud89zgXdEV4GbB6axPV6QWzeaH+j0WBKVlli4n+mzqyDuMRgX+S/oJyjAyqFDJICpjIlX7FvgRWACJEb3M8TFqKN5CArWNhsJaTr54xOnt2SUdBeH6KXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562167767; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=D+m7xVdBvDEoZ8mA/slyC1uvqhj26XZgJ5yG0pMBe3I=; b=CPyBL+N2gIiE8fIngMHM65tOTDHd4vDpCjZZW3cZ/ijHhr+R1VdxFcnztW4eugm20iC5woi0fp5/H22KOrxmknqJtfgqbA6srqJXQOtB8rQgnyRkaZg/9kxUowZdoa1PPKe//fzdc3xV9s6EJl42iI7aDuqevL2CRpeDbl4GqNs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156216776713275.32658432845653; Wed, 3 Jul 2019 08:29:27 -0700 (PDT) Received: from localhost ([::1]:36876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hihCE-0003rA-5X for importer@patchew.org; Wed, 03 Jul 2019 11:29:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39980) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hih8n-0000MR-Si for qemu-devel@nongnu.org; Wed, 03 Jul 2019 11:25:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hih8m-0007bJ-6H for qemu-devel@nongnu.org; Wed, 03 Jul 2019 11:25:49 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:58737) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hih8l-0007aW-TW; Wed, 03 Jul 2019 11:25:48 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MGygv-1hnySj3sYt-00E5F2; Wed, 03 Jul 2019 17:25:19 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 3 Jul 2019 17:25:13 +0200 Message-Id: <20190703152513.29166-3-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190703152513.29166-1-laurent@vivier.eu> References: <20190703152513.29166-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:CFwtnTstsssEAZxEab7dPL1/l04v+e+hSWnQdqzA7gsy6P8nMpC F3sq1A0e2hSp4A7W0+Qj/BUjeCkyfASVqo98aA1mpzHsvyavWuSuuq9nI+P5OzHbKeKh5QP qecSmGKsmUPfMcpYG1x70BWhoMU7N3qSjHVNUl/3pmmyBEmj37XtpWr/h3gP2JWIYGO0Mbd tH/3I9kkaC3wOj+RmrnOw== X-UI-Out-Filterresults: notjunk:1;V03:K0:vRnzmMuTWqQ=:0WC3lvtOnfNZJeWqWZrTlg ruPqzNnSf2KRgcwOiRf1sQscwNUanVtk76jj19RxskOPM+MMk/cE0IzIaOtqO52BDniTzx7IQ pFucYXZRne1r+hU6RH6zENEPD8WKBGqUNcX5mkrhYK/4n0drMqf5ZljadCLk4TTqeW5qAtYWT q2sZGw0EdsBQKEgFAPbuHzITCqfrVIxcWx4CaZZz3o9fCmVwn6IlimfEMufjVnqrV+jkG2O6v d7EU6A8uWpyt5WIL5CclL9knZDU5CpvoShAhIaBFMGBN7YQNA9GnTrP4S3R45Z7I17IMDCA5K XiqyIbAYAv6myJrZxJ79A6o2/+aQsDjKC1y213lVfbStvymTyjCljLaV4HNBcsb8zToyz5wKm e84lhGqa9/T39m1ktmDysdKX5hiHGEnMVfc83sSTvEBt1ouJ7jXsv2hoQDeoqelk667G+gqqX fwiH5CuosXCgU2IbthFjWLyX2B9L9TGb4SqAC6j9j45UZZLXB+7WeHbtTcgYnYkHiNUpVlO4+ Fspf5piZfms6nI4e27Q/d+hXtazh3cKJjj/KhonvHn3wbnaEvfbamQpN7gN1Zv8QD0zsD7nj0 9nvGGDLVNqig3uoVwvDeDqtvuVVJqmsF5itWDudLCmcOHsQwI4+5v9vrZN10i64RO8ELZLvZk coyKxPLGJ9576cMNRH6bpbm40hmMR397H8wBw8O7cJoamTflzfr4wNZBbQ1wPsBjOuq5RyTuq qbRLd0b9Yj4qnB7+ZxmvGEcNXQaZ9I6mqqTYSSMcThR6cDSlHIbhzrqFaIQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.74 Subject: [Qemu-devel] [PULL v2 2/2] docs/devel/testing: Fix typo in dockerfile path X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang , Amit Shah , qemu-trivial@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Michael Tokarev , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Liam Merwick Signed-off-by: Liam Merwick Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Li Qiang Message-Id: <1561727317-30655-1-git-send-email-liam.merwick@oracle.com> Signed-off-by: Laurent Vivier --- docs/devel/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index da2d0fc9646f..3ef50a61db4d 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -327,7 +327,7 @@ Images ------ =20 Along with many other images, the ``min-glib`` image is defined in a Docke= rfile -in ``tests/docker/dockefiles/``, called ``min-glib.docker``. ``make docker= `` +in ``tests/docker/dockerfiles/``, called ``min-glib.docker``. ``make docke= r`` command will list all the available images. =20 To add a new image, simply create a new ``.docker`` file under the --=20 2.21.0