From: "Jan Beulich" Subject: Re: out of bounds handling for get_mfn_from_gpfn() Date: Wed, 26 Apr 2006 16:28:28 +0200 Message-ID: <444F9FAC.76E4.0078.0@novell.com> References: <444F7D2C.76E4.0078.0@novell.com> <444F8FFE.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >Okay, maybe we need to be more restrictive: 20 bits for 32b (4GB), 22 >bits for 32b-pae (16GB), and some suitable large value for 64b (31 >would be fine, it's good for up to 8TB). Then perhaps the way to go would be to really check against ((RO_MPT_VIRT_END - RO_MPT_VIRT_START) / sizeof(*phys_to_machine_mapping)). This wouldn't be 31 bits for x86-64, but it seems to me that allowing 35-bit gpfn-s wouldn't be that bad an idea (and the fact that the array currently may only get populated up to 31-bit gpfn-s wouldn't seem to cause any problems). I'll prepare a patch... Jan