lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Oct 2012 18:26:02 +0100
From:	Stefano Stabellini <stefano.stabellini@...citrix.com>
To:	Yinghai Lu <yinghai@...nel.org>
CC:	Stefano Stabellini <Stefano.Stabellini@...citrix.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	Jacob Shin <jacob.shin@....com>, Tejun Heo <tj@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 6/7] x86, mm: setup page table from top-down

On Wed, 10 Oct 2012, Yinghai Lu wrote:
> On Wed, Oct 10, 2012 at 9:38 AM, Stefano Stabellini
> <stefano.stabellini@...citrix.com> wrote:
> >> -     if (pfn >= pgt_buf_top)
> >> -             panic("alloc_low_page: ran out of memory");
> >> +     if ((pgt_buf_end + 1) >= pgt_buf_top) {
> >> +             unsigned long ret;
> >> +             if (min_pfn_mapped >= max_pfn_mapped)
> >> +                     panic("alloc_low_page: ran out of memory");
> >> +             ret = memblock_find_in_range(min_pfn_mapped << PAGE_SHIFT,
> >> +                                     max_pfn_mapped << PAGE_SHIFT,
> >> +                                     PAGE_SIZE, PAGE_SIZE);
> >> +             if (!ret)
> >> +                     panic("alloc_low_page: can not alloc memory");
> >> +             memblock_reserve(ret, PAGE_SIZE);
> >> +             pfn = ret >> PAGE_SHIFT;
> >
> > This cannot be right: you are allocating another page to be used as
> > pagetable page, outside the range pgt_buf_start-pgt_buf_top.
> >
> > When that page is going to be hooked into the live pagetable, the kernel
> > is going to panic on Xen because the page wasn't marked RO.
> >
> > If you want to do that you need to tell the Xen subsystem of the new
> > page. pagetable_reserve is not the right call, we need a new one (see
> > past emails).
> 
> ok, will change that interface and call in from alloc_low_page.
> 
> how about the pages from BRK, do we need to call xen hooks to mark it as RO?
> 

It doesn't matter whether they come from BRK or other memory: Xen
assumes that all the pagetable pages come from
pgt_buf_start-pgt_buf_top, so if you are going to use another range you
need to tell Xen about it.

Alternatively, you can follow Peter's suggestion and replace the current
hooks with a new one with a more precise and well defined semantic.
Something along the lines of "this pagetable page is about to be hooked
into the live pagetable". Xen would use the hook to mark it RO.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ