[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/MTRR: fix range check in mtrr_add_page()


  • To: Jan Beulich <JBeulich@xxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Tue, 13 Aug 2013 18:34:44 +0100
  • Delivery-date: Tue, 13 Aug 2013 17:35:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac6YS2XoC2mJ7H7YH02FxmXLwU7XKQ==
  • Thread-topic: [PATCH] x86/MTRR: fix range check in mtrr_add_page()

On 13/08/2013 16:45, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> Extracted from Yinghai Lu's Linux commit d5c78673 ("x86: Fix /proc/mtrr
> with base/size more than 44bits").
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Keir Fraser <keir@xxxxxxx>

> --- a/xen/arch/x86/cpu/mtrr/main.c
> +++ b/xen/arch/x86/cpu/mtrr/main.c
> @@ -340,7 +340,7 @@ int mtrr_add_page(unsigned long base, un
> return -EINVAL;
> }
>  
> - if (base & size_or_mask || size & size_or_mask) {
> + if ((base | (base + size - 1)) >> (paddr_bits - PAGE_SHIFT)) {
> printk(KERN_WARNING "mtrr: base or size exceeds the MTRR width\n");
> return -EINVAL;
> }
> 
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.