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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 09 Sep 2008 11:05:52 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Alex Nixon <alex.nixon@...rix.com>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH] Xen: Fix pte unpin BUG when !CONFIG_SMP

Alex Nixon wrote:
> We still need to pin PTEs, even if there are no PTE locks.  Otherwise we'll BUG whenever there aren't PTE locks (i.e. whenever NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS), as we try to unpin PTEs which were never pinned in the first place.
>   

Where does the unpin happen?  xen_unpin_page() also checks to see if it
took the lock before trying to unpin, symmetric with xen_pin_page().

    J
> Signed-off-by: Alex Nixon <alex.nixon@...rix.com>
> Cc: Jeremy Fitzhardinge <jeremy@...p.org>
> Cc: Ingo Molnar <mingo@...e.hu>
> ---
>  arch/x86/xen/mmu.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
> index f5af913..1239bda 100644
> --- a/arch/x86/xen/mmu.c
> +++ b/arch/x86/xen/mmu.c
> @@ -819,9 +819,10 @@ static int xen_pin_page(struct page *page, enum pt_level level)
>  					pfn_pte(pfn, PAGE_KERNEL_RO),
>  					level == PT_PGD ? UVMF_TLB_FLUSH : 0);
>  
> -		if (ptl) {
> +		if (level == PT_PTE)
>  			xen_do_pin(MMUEXT_PIN_L1_TABLE, pfn);
>  
> +		if (ptl) {
>  			/* Queue a deferred unlock for when this batch
>  			   is completed. */
>  			xen_mc_callback(xen_pte_unlock, ptl);
> @@ -924,9 +925,7 @@ static int xen_unpin_page(struct page *page, enum pt_level level)
>  		 */
>  		if (level == PT_PTE) {
>  			ptl = xen_pte_lock(page);
> -
> -			if (ptl)
> -				xen_do_pin(MMUEXT_UNPIN_TABLE, pfn);
> +			xen_do_pin(MMUEXT_UNPIN_TABLE, pfn);
>  		}
>  
>  		mcs = __xen_mc_entry(0);
>   

--
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