From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zmuuq-0006gW-PR for qemu-devel@nongnu.org; Thu, 15 Oct 2015 22:38:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zmuum-0000MF-ON for qemu-devel@nongnu.org; Thu, 15 Oct 2015 22:38:44 -0400 Received: from mga09.intel.com ([134.134.136.24]:11961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zmuum-0000M3-Hl for qemu-devel@nongnu.org; Thu, 15 Oct 2015 22:38:40 -0400 References: <1444535584-18220-1-git-send-email-guangrong.xiao@linux.intel.com> <1444535584-18220-28-git-send-email-guangrong.xiao@linux.intel.com> <20151014094134.GC14874@stefanha-thinkpad> <561E6C1F.2000502@linux.intel.com> <20151015150143.GC21733@stefanha-thinkpad.redhat.com> From: Xiao Guangrong Message-ID: <562061B7.8060307@linux.intel.com> Date: Fri, 16 Oct 2015 10:32:23 +0800 MIME-Version: 1.0 In-Reply-To: <20151015150143.GC21733@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 27/32] nvdimm: support DSM_CMD_IMPLEMENTED function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, Stefan Hajnoczi , mtosatti@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com, imammedo@redhat.com, dan.j.williams@intel.com, rth@twiddle.net On 10/15/2015 11:01 PM, Stefan Hajnoczi wrote: > On Wed, Oct 14, 2015 at 10:52:15PM +0800, Xiao Guangrong wrote: >> On 10/14/2015 05:41 PM, Stefan Hajnoczi wrote: >>> On Sun, Oct 11, 2015 at 11:52:59AM +0800, Xiao Guangrong wrote: >>>> + out->len = sizeof(out->status); >>> >>> out->len is uint16_t, it needs cpu_to_le16(). There may be other >>> instances in this patch series. >>> >> >> out->len is internally used only which is invisible to guest OS, i,e, >> we write this value and read this value by ourself. I think it is >> okay. > > 'out' points to guest memory. Guest memory is untrusted so QEMU cannot > stash values there - an evil guest could modify them. > > Please put the len variable on the QEMU stack or heap where the guest > cannot access it. okay okay.