Skip to content

Commit

Permalink
microblaze: Fix do_page_fault for no context
Browse files Browse the repository at this point in the history
Calling fixup when we are in kernel mode. This
prevent fault for copy_to/from_user. This fault
was find thanks to writev01/03/04 LTP tests.

Signed-off-by: Michal Simek <monstr@monstr.eu>
  • Loading branch information
Michal Simek committed Jul 27, 2009
1 parent f14d6f7 commit f10eca6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions arch/microblaze/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
}
#endif /* CONFIG_KGDB */

if (in_atomic() || mm == NULL) {
/* FIXME */
if (kernel_mode(regs)) {
printk(KERN_EMERG
"Page fault in kernel mode - Oooou!!! pid %d\n",
current->pid);
_exception(SIGSEGV, regs, code, address);
return;
}
if (in_atomic() || !mm) {
if (kernel_mode(regs))
goto bad_area_nosemaphore;

/* in_atomic() in user mode is really bad,
as is current->mm == NULL. */
printk(KERN_EMERG "Page fault in user mode with "
Expand Down

0 comments on commit f10eca6

Please sign in to comment.