Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80140
b: refs/heads/master
c: c4aba4a
h: refs/heads/master
v: v3
  • Loading branch information
Harvey Harrison authored and Ingo Molnar committed Jan 30, 2008
1 parent 7354053 commit 955d346
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 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: 1dc85be087d6645575847dc23c37147a2352312b
refs/heads/master: c4aba4a8ec795124394bc79e3e8dbbc319338a98
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 @@ -249,7 +249,7 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr,
return prefetch;
}

static noinline void force_sig_info_fault(int si_signo, int si_code,
static void force_sig_info_fault(int si_signo, int si_code,
unsigned long address, struct task_struct *tsk)
{
siginfo_t info;
Expand Down
31 changes: 18 additions & 13 deletions trunk/arch/x86/mm/fault_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,18 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr,
return prefetch;
}

static void force_sig_info_fault(int si_signo, int si_code,
unsigned long address, struct task_struct *tsk)
{
siginfo_t info;

info.si_signo = si_signo;
info.si_errno = 0;
info.si_code = si_code;
info.si_addr = (void __user *)address;
force_sig_info(si_signo, &info, tsk);
}

static int bad_address(void *p)
{
unsigned long dummy;
Expand Down Expand Up @@ -415,7 +427,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
unsigned long address;
int write, fault;
unsigned long flags;
siginfo_t info;
int si_code;

/*
* We can fault from pretty much anywhere, with unknown IRQ state.
Expand All @@ -429,7 +441,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
/* get the address */
address = read_cr2();

info.si_code = SEGV_MAPERR;
si_code = SEGV_MAPERR;


/*
Expand Down Expand Up @@ -532,7 +544,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
* we can handle it..
*/
good_area:
info.si_code = SEGV_ACCERR;
si_code = SEGV_ACCERR;
write = 0;
switch (error_code & (PF_PROT|PF_WRITE)) {
default: /* 3: write, present */
Expand Down Expand Up @@ -611,11 +623,8 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
/* Kernel addresses are always protection faults */
tsk->thread.error_code = error_code | (address >= TASK_SIZE);
tsk->thread.trap_no = 14;
info.si_signo = SIGSEGV;
info.si_errno = 0;
/* info.si_code has been set above */
info.si_addr = (void __user *)address;
force_sig_info(SIGSEGV, &info, tsk);

force_sig_info_fault(SIGSEGV, si_code, address, tsk);
return;
}

Expand Down Expand Up @@ -682,11 +691,7 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
tsk->thread.cr2 = address;
tsk->thread.error_code = error_code;
tsk->thread.trap_no = 14;
info.si_signo = SIGBUS;
info.si_errno = 0;
info.si_code = BUS_ADRERR;
info.si_addr = (void __user *)address;
force_sig_info(SIGBUS, &info, tsk);
force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk);
return;
}

Expand Down

0 comments on commit 955d346

Please sign in to comment.