summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2005-09-29 08:06:47 +0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-09-29 08:06:47 +0400
commitefdc1e2083e04cc70721d55803889b346c1a3de2 (patch)
tree9f24fab33f795a69bb2dc43a8f3613392762ff02 /include
parent5fd29752f09cabff582f65c0ce35518db4c64937 (diff)
downloadlinux-efdc1e2083e04cc70721d55803889b346c1a3de2.tar.xz
[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>
Diffstat (limited to 'include')
-rw-r--r--include/asm-sparc64/uaccess.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h
index bc8ddbb1cbed..203e8eee6351 100644
--- a/include/asm-sparc64/uaccess.h
+++ b/include/asm-sparc64/uaccess.h
@@ -251,7 +251,7 @@ copy_from_user(void *to, const void __user *from, unsigned long size)
{
unsigned long ret = ___copy_from_user(to, from, size);
- if (ret)
+ if (unlikely(ret))
ret = copy_from_user_fixup(to, from, size);
return ret;
}
@@ -267,7 +267,7 @@ copy_to_user(void __user *to, const void *from, unsigned long size)
{
unsigned long ret = ___copy_to_user(to, from, size);
- if (ret)
+ if (unlikely(ret))
ret = copy_to_user_fixup(to, from, size);
return ret;
}
@@ -283,7 +283,7 @@ copy_in_user(void __user *to, void __user *from, unsigned long size)
{
unsigned long ret = ___copy_in_user(to, from, size);
- if (ret)
+ if (unlikely(ret))
ret = copy_in_user_fixup(to, from, size);
return ret;
}