Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80435
b: refs/heads/master
c: 4c3c4b4
h: refs/heads/master
i:
  80433: fc4ea58
  80431: 49ffdf0
v: v3
  • Loading branch information
Andi Kleen authored and Ingo Molnar committed Jan 30, 2008
1 parent e3c1579 commit 3306e04
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e66a95127dc4273d3573eb03657991f7bbd5dca3
refs/heads/master: 4c3c4b4513a361cc6ac5ee8677695260c4f0f25f
2 changes: 1 addition & 1 deletion trunk/arch/x86/mm/fault_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
if (error_code & PF_INSTR) {
pte_t *pte = lookup_address(address);

if (pte && pte_present(*pte) && !pte_exec_kernel(*pte))
if (pte && pte_present(*pte) && !pte_exec(*pte))
printk(KERN_CRIT "kernel tried to execute "
"NX-protected page - exploit attempt? "
"(uid: %d)\n", current->uid);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ int __init set_kernel_exec(unsigned long vaddr, int enable)
pte = lookup_address(vaddr);
BUG_ON(!pte);

if (!pte_exec_kernel(*pte))
if (!pte_exec(*pte))
ret = 0;

if (enable)
Expand Down
8 changes: 0 additions & 8 deletions trunk/include/asm-x86/pgtable-2level.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp)
#define pte_none(x) (!(x).pte_low)
#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)

/*
* All present pages are kernel-executable:
*/
static inline int pte_exec_kernel(pte_t pte)
{
return 1;
}

/*
* Bits 0, 6 and 7 are taken, split up the 29 bits of offset
* into this range:
Expand Down
8 changes: 0 additions & 8 deletions trunk/include/asm-x86/pgtable-3level.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@
#define pud_bad(pud) 0
#define pud_present(pud) 1

/*
* All present pages with !NX bit are kernel-executable:
*/
static inline int pte_exec_kernel(pte_t pte)
{
return !(pte_val(pte) & _PAGE_NX);
}

/* Rules for using set_pte: the pte being assigned *must* be
* either not present or in a state where the hardware will
* not attempt to update the pte. In places where this is
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;
static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; }
static inline int pte_exec(pte_t pte) { return !(pte_val(pte) & _PAGE_NX); }

static inline int pmd_large(pmd_t pte) {
return (pmd_val(pte) & (_PAGE_PSE|_PAGE_PRESENT)) ==
Expand Down

0 comments on commit 3306e04

Please sign in to comment.