[SPARC64]: Simplify user fault fixup handling.

Instead of doing byte-at-a-time user accesses to figure
out where the fault occurred, read the saved fault_address
from the current thread structure.

For the sake of defensive programming, if the fault_address
does not fall into the user buffer range, simply assume the
whole area faulted.  This will cause the fixup for
copy_from_user() to clear the entire kernel side buffer.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2005-09-28 21:06:47 -07:00
parent 5fd29752f0
commit efdc1e2083
3 changed files with 35 additions and 46 deletions

View File

@ -457,7 +457,7 @@ good_area:
}
up_read(&mm->mmap_sem);
goto fault_done;
return;
/*
* Something tried to access memory that isn't in our memory map..
@ -469,8 +469,7 @@ bad_area:
handle_kernel_fault:
do_kernel_fault(regs, si_code, fault_code, insn, address);
goto fault_done;
return;
/*
* We ran out of memory, or some other thing happened to us that made
@ -501,9 +500,4 @@ do_sigbus:
/* Kernel mode? Handle exceptions or die */
if (regs->tstate & TSTATE_PRIV)
goto handle_kernel_fault;
fault_done:
/* These values are no longer needed, clear them. */
set_thread_fault_code(0);
current_thread_info()->fault_address = 0;
}