From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v3 27/32] nvdimm: support DSM_CMD_IMPLEMENTED function Date: Fri, 16 Oct 2015 10:32:23 +0800 Message-ID: <562061B7.8060307@linux.intel.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Stefan Hajnoczi , pbonzini@redhat.com, imammedo@redhat.com, gleb@kernel.org, mtosatti@redhat.com, mst@redhat.com, rth@twiddle.net, ehabkost@redhat.com, dan.j.williams@intel.com, kvm@vger.kernel.org, qemu-devel@nongnu.org To: Stefan Hajnoczi Return-path: Received: from mga14.intel.com ([192.55.52.115]:19752 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751855AbbJPCij (ORCPT ); Thu, 15 Oct 2015 22:38:39 -0400 In-Reply-To: <20151015150143.GC21733@stefanha-thinkpad.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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.