From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH v3 3/3] tools: introduce parameter max_wp_ram_ranges. Date: Mon, 1 Feb 2016 12:02:44 +0000 Message-ID: <20160201120244.GT25660@citrix.com> References: <1454064314-7799-1-git-send-email-yu.c.zhang@linux.intel.com> <1454064314-7799-4-git-send-email-yu.c.zhang@linux.intel.com> <56ABA26C02000078000CC7CD@prv-mh.provo.novell.com> <56ACCAD5.8030503@linux.intel.com> <56AF1CE302000078000CCBBD@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <56AF1CE302000078000CCBBD@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: kevin.tian@intel.com, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, Paul.Durrant@citrix.com, Zhang Yu , zhiyuan.lv@intel.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org On Mon, Feb 01, 2016 at 12:52:51AM -0700, Jan Beulich wrote: > >>> On 30.01.16 at 15:38, wrote: > > > On 1/30/2016 12:33 AM, Jan Beulich wrote: > >>>>> On 29.01.16 at 11:45, wrote: > >>> --- a/xen/arch/x86/hvm/hvm.c > >>> +++ b/xen/arch/x86/hvm/hvm.c > >>> @@ -940,6 +940,8 @@ static int hvm_ioreq_server_alloc_rangesets(struct hvm_ioreq_server *s, > >>> { > >>> unsigned int i; > >>> int rc; > >>> + unsigned int max_wp_ram_ranges = > >>> + s->domain->arch.hvm_domain.params[HVM_PARAM_MAX_WP_RAM_RANGES]; > >> > >> You're still losing the upper 32 bits here. Iirc you agreed to range > >> check the value before storing into params[]... > > > > Thanks, Jan. :) > > In this version, the check is added in routine parse_config_data(). > > If option 'max_wp_ram_ranges' is configured with an unreasonable value, > > the xl will terminate, before calling xc_hvm_param_set(). Does this > > change meet your requirement? Or maybe did I have some misunderstanding > > on this issue? > > Checking in the tools is desirable, but the hypervisor shouldn't rely > on any tool side checking. > As in hypervisor needs to sanitise all input from toolstack? I don't think Xen does that today. What is the difference between this particular configuration option and all other options in the same hvm_set_conf_params function? Wei. > Jan >