Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178897
b: refs/heads/master
c: 409d02e
h: refs/heads/master
i:
  178895: c104389
v: v3
  • Loading branch information
Heiko Carstens authored and H. Peter Anvin committed Jan 5, 2010
1 parent c6c785a commit d7b81ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 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: f4b825bde98938f160315d655597bc9731521cae
refs/heads/master: 409d02ef6d74f5e91f5ea4c587b2ee1375f106fc
5 changes: 2 additions & 3 deletions trunk/arch/x86/include/asm/uaccess_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,13 @@ static inline unsigned long __must_check copy_from_user(void *to,
unsigned long n)
{
int sz = __compiletime_object_size(to);
int ret = -EFAULT;

if (likely(sz == -1 || sz >= n))
ret = _copy_from_user(to, from, n);
n = _copy_from_user(to, from, n);
else
copy_from_user_overflow();

return ret;
return n;
}

long __must_check strncpy_from_user(char *dst, const char __user *src,
Expand Down
5 changes: 2 additions & 3 deletions trunk/arch/x86/include/asm/uaccess_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ static inline unsigned long __must_check copy_from_user(void *to,
unsigned long n)
{
int sz = __compiletime_object_size(to);
int ret = -EFAULT;

might_fault();
if (likely(sz == -1 || sz >= n))
ret = _copy_from_user(to, from, n);
n = _copy_from_user(to, from, n);
#ifdef CONFIG_DEBUG_VM
else
WARN(1, "Buffer overflow detected!\n");
#endif
return ret;
return n;
}

static __always_inline __must_check
Expand Down

0 comments on commit d7b81ff

Please sign in to comment.