Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=674d67269e79f6697c3480363b28c9b9934fa60c
Commit:     674d67269e79f6697c3480363b28c9b9934fa60c
Parent:     6faa4c53b2f06fd271060761ce27f4f53289175c
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:34:03 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:34:03 2008 +0100

    x86: clean up differences between 64-bit and 32-bit
    
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/mm/pageattr_64.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c
index 1397950..60cfb68 100644
--- a/arch/x86/mm/pageattr_64.c
+++ b/arch/x86/mm/pageattr_64.c
@@ -126,30 +126,36 @@ out_unlock:
 static int
 __change_page_attr(unsigned long address, struct page *page, pgprot_t prot)
 {
-       pgprot_t ref_prot2, oldprot;
        struct page *kpte_page;
        int level, err = 0;
        pte_t *kpte;
 
+       BUG_ON(PageHighMem(page));
+
 repeat:
        kpte = lookup_address(address, &level);
        if (!kpte)
                return 0;
 
        kpte_page = virt_to_page(kpte);
-       oldprot = pte_pgprot(*kpte);
        BUG_ON(PageLRU(kpte_page));
        BUG_ON(PageCompound(kpte_page));
-       prot = canon_pgprot(prot);
+
+       /*
+        * Better fail early if someone sets the kernel text to NX.
+        * Does not cover __inittext
+        */
+       BUG_ON(address >= (unsigned long)&_text &&
+               address < (unsigned long)&_etext &&
+              (pgprot_val(prot) & _PAGE_NX));
 
        if (level == 4) {
-               set_pte_atomic(kpte, mk_pte(page, prot));
+               set_pte_atomic(kpte, mk_pte(page, canon_pgprot(prot)));
        } else {
                err = split_large_page(kpte, address);
                if (!err)
                        goto repeat;
        }
-
        return err;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to