From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa76Q-0003z2-6I for qemu-devel@nongnu.org; Mon, 02 Jul 2018 18:15:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa76M-0006xM-6u for qemu-devel@nongnu.org; Mon, 02 Jul 2018 18:15:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36154 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fa76M-0006x2-1O for qemu-devel@nongnu.org; Mon, 02 Jul 2018 18:15:18 -0400 Date: Mon, 2 Jul 2018 18:15:16 -0400 From: Andrea Arcangeli Message-ID: <20180702221516.GB8790@redhat.com> References: <20180331084500.33313-1-jiangshanlai@gmail.com> <20180702131054.GE2155@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] migration: add capability to bypass the shared memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peng Tao Cc: Stefan Hajnoczi , Marcelo Tosatti , Samuel Ortiz , Xu Wang , "James O . D . Hunt" , Juan Quintela , Lai Jiangshan , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" , Sebastien Boeuf , Xiao Guangrong , Paolo Bonzini , Markus Armbruster , Xiao Guangrong Hello, On Mon, Jul 02, 2018 at 09:52:08PM +0800, Peng Tao wrote: > I think we can write some host generated random seeds to guest's > urandom device, when cloning VMs from the same template before handing > it to users. Is it enough or do you think there are more to do w/ > re-randomizing? That may be enough, but it's critically important to get right. Reusing the same /dev/urandom number just twice on two different operations, can lead to leak of the entire private key even if the reused random number itself is not predictable. You may want to look into the upstream random number generator that can be configured at build time to printk() a warning if it's being used at boot before it had its "shutdown" state restored. It would sound safer if you could re-trigger such warning post vmrestore of a cloned image if userland uses random number before the random number has been re-seeded post vmrestore. With a full loaded userland running immediately post vmrestore, an userland race condition would otherwise risk to go unnoticed. Thanks, Andrea