From: "Jan Beulich" Subject: Re: [v8][PATCH 03/17] introduce XENMEM_reserved_device_memory_map Date: Mon, 08 Dec 2014 10:00:25 +0000 Message-ID: <548584C9020000780004DAB2@mail.emea.novell.com> References: <1417425875-9634-1-git-send-email-tiejun.chen@intel.com> <1417425875-9634-4-git-send-email-tiejun.chen@intel.com> <20141202194709.GD357@laptop.dumpdata.com> <5485427C.1070903@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5485427C.1070903@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tiejun Chen , dgdegra@tycho.nsa.gov Cc: kevin.tian@intel.com, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, tim@xen.org, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, yang.z.zhang@intel.com List-Id: xen-devel@lists.xenproject.org >>> On 08.12.14 at 07:17, wrote: > On 2014/12/3 3:47, Konrad Rzeszutek Wilk wrote: >> On Mon, Dec 01, 2014 at 05:24:21PM +0800, Tiejun Chen wrote: >>> @@ -1101,6 +1129,29 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg) >>> break; >>> } >>> >>> +#ifdef HAS_PASSTHROUGH >>> + case XENMEM_reserved_device_memory_map: >>> + { >>> + struct get_reserved_device_memory grdm; >>> + >>> + if ( copy_from_guest(&grdm.map, arg, 1) || >>> + !guest_handle_okay(grdm.map.buffer, grdm.map.nr_entries) ) >>> + return -EFAULT; >>> + >> >> Shouldn't there be an XSM check here? > > I'm not sure, and Jan should be the author for this patch, so Jan can > give you a correct reply. Hmm, not sure: Daniel, does an operation like this need an XSM check? It's not clear whether the absence of such a check in e.g. the handling of XENMEM_memory_map, XENMEM_machphys_mapping, or XENMEM_maximum_ram_page is intentional (and can be used as justification for it to be absent here too - after all the operation is for a domain to find out information about only itself). Jan