Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80289
b: refs/heads/master
c: 6f4d368
h: refs/heads/master
i:
  80287: a67a748
v: v3
  • Loading branch information
Harvey Harrison authored and Ingo Molnar committed Jan 30, 2008
1 parent 7107143 commit b957586
Show file tree
Hide file tree
Showing 3 changed files with 32 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: 608566b4edda5079c7812c2108a89c0fcf2894bb
refs/heads/master: 6f4d368ef9e9f91aa0019c11e90773ea32d94625
20 changes: 12 additions & 8 deletions trunk/arch/x86/mm/fault_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
* bit 3 == 1 means use of reserved bit detected
* bit 4 == 1 means fault was an instruction fetch
*/
#define PF_PROT (1<<0)
#define PF_PROT (1<<0)
#define PF_WRITE (1<<1)
#define PF_USER (1<<2)
#define PF_RSVD (1<<3)
#define PF_USER (1<<2)
#define PF_RSVD (1<<3)
#define PF_INSTR (1<<4)

static inline int notify_page_fault(struct pt_regs *regs)
Expand Down Expand Up @@ -460,11 +460,15 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)

if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
printk_ratelimit()) {
printk("%s%s[%d]: segfault at %08lx ip %08lx "
"sp %08lx error %lx\n",
task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
tsk->comm, task_pid_nr(tsk), address, regs->ip,
regs->sp, error_code);
printk(
#ifdef CONFIG_X86_32
"%s%s[%d]: segfault at %08lx ip %08lx sp %08lx error %lx\n",
#else
"%s%s[%d]: segfault at %lx ip %lx sp %lx error %lx\n",
#endif
task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
tsk->comm, task_pid_nr(tsk), address, regs->ip,
regs->sp, error_code);
}
tsk->thread.cr2 = address;
/* Kernel addresses are always protection faults */
Expand Down
29 changes: 19 additions & 10 deletions trunk/arch/x86/mm/fault_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,11 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
if (!(vma->vm_flags & VM_GROWSDOWN))
goto bad_area;
if (error_code & PF_USER) {
/* Allow userspace just enough access below the stack pointer
* to let the 'enter' instruction work.
/*
* Accessing the stack below %sp is always a bug.
* The large cushion allows instructions like enter
* and pusha to work. ("enter $65535,$31" pushes
* 32 pointers and then decrements %sp by 65535.)
*/
if (address + 65536 + 32 * sizeof(unsigned long) < regs->sp)
goto bad_area;
Expand Down Expand Up @@ -522,10 +525,14 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
printk_ratelimit()) {
printk(
"%s%s[%d]: segfault at %lx ip %lx sp %lx error %lx\n",
tsk->pid > 1 ? KERN_INFO : KERN_EMERG,
tsk->comm, tsk->pid, address, regs->ip,
regs->sp, error_code);
#ifdef CONFIG_X86_32
"%s%s[%d]: segfault at %08lx ip %08lx sp %08lx error %lx\n",
#else
"%s%s[%d]: segfault at %lx ip %lx sp %lx error %lx\n",
#endif
task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
tsk->comm, task_pid_nr(tsk), address, regs->ip,
regs->sp, error_code);
}

tsk->thread.cr2 = address;
Expand Down Expand Up @@ -609,10 +616,12 @@ LIST_HEAD(pgd_list);

void vmalloc_sync_all(void)
{
/* Note that races in the updates of insync and start aren't
problematic:
insync can only get set bits added, and updates to start are only
improving performance (without affecting correctness if undone). */
/*
* Note that races in the updates of insync and start aren't
* problematic: insync can only get set bits added, and updates to
* start are only improving performance (without affecting correctness
* if undone).
*/
static DECLARE_BITMAP(insync, PTRS_PER_PGD);
static unsigned long start = VMALLOC_START & PGDIR_MASK;
unsigned long address;
Expand Down

0 comments on commit b957586

Please sign in to comment.