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]
Message-ID: <20080509200519.GA10897@linux-os.sc.intel.com>
Date:	Fri, 9 May 2008 13:05:19 -0700
From:	Venki Pallipadi <venkatesh.pallipadi@...el.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Venki Pallipadi <venkatesh.pallipadi@...el.com>,
	Hugh Dickins <hugh@...itas.com>, Frans Pop <elendil@...net.nl>,
	Jesse Barnes <jesse.barnes@...el.com>,
	linux-kernel@...r.kernel.org,
	"Packard, Keith" <keith.packard@...el.com>,
	Yinghai Lu <yhlu.kernel@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Nick Piggin <npiggin@...e.de>,
	Jesse Barnes <jbarnes@...tuousgeek.org>
Subject: Re: [git head] X86_PAT & mprotect

On Fri, May 09, 2008 at 12:08:18PM +0200, Ingo Molnar wrote:
> 
> * Venki Pallipadi <venkatesh.pallipadi@...el.com> wrote:
> 
> > > I've tried doing it slightly differently below, don't know whether 
> > > you'll consider it an improvement or not.
> > 
> > Hugh: Thanks for looking into this. Yes. I like your modified patch. 
> > Simpler and smaller.
> 
> i have stuck your original patch into testing and nothing blew up so 
> far. Due to the mm/ bits this is not for the scope of x86.git, but 
> obviously it all looks good and is .26-worthy to me:
> 
>  Acked-by: Ingo Molnar <mingo@...e.hu>
>  Tested-by: Ingo Molnar <mingo@...e.hu>
> 
> Venki, could you please send a full patch against -git that has 
> everything from Hugh included, with an updated changelog, for 
> Linus/Andrew to ack/apply?
> 

Ingo,

Split up the patch into two parts as the pci part was unrelated to mprotect
problem in a sense.

Here is the first patch.

Thanks,
Venki


Some versions of X used the mprotect workaround to change caching type from
UC to WB, so that it can then use mtrr to program WC for that region [1].
Change the mmap of pci space through /sys or /proc interfaces from UC to
UC_MINUS. With this change, X will not need to use mprotect
workaround to get WC type.
Also the bug with mprotect which lets caller to change PAT bits is fixed in
the follow on patch. So, this X workaround will stop working as well.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@...el.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>

---
 arch/x86/pci/i386.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Index: linux-2.6/arch/x86/pci/i386.c
===================================================================
--- linux-2.6.orig/arch/x86/pci/i386.c	2008-05-06 15:45:47.000000000 -0700
+++ linux-2.6/arch/x86/pci/i386.c	2008-05-09 10:05:45.000000000 -0700
@@ -301,15 +301,13 @@ int pci_mmap_page_range(struct pci_dev *
 	prot = pgprot_val(vma->vm_page_prot);
 	if (pat_wc_enabled && write_combine)
 		prot |= _PAGE_CACHE_WC;
-	else if (pat_wc_enabled)
+	else if (pat_wc_enabled || boot_cpu_data.x86 > 3)
 		/*
 		 * ioremap() and ioremap_nocache() defaults to UC MINUS for now.
 		 * To avoid attribute conflicts, request UC MINUS here
 		 * aswell.
 		 */
 		prot |= _PAGE_CACHE_UC_MINUS;
-	else if (boot_cpu_data.x86 > 3)
-		prot |= _PAGE_CACHE_UC;
 
 	vma->vm_page_prot = __pgprot(prot);
 
--
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