Skip to content

Commit

Permalink
x86: some lock annotations for user copy paths, v3
Browse files Browse the repository at this point in the history
- add annotation back to clear_user()
- change probe_kernel_address() to _inatomic*() method

Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Sep 11, 2008
1 parent 3ee1afa commit 1d18ef4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions arch/x86/lib/usercopy_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ do { \
unsigned long
clear_user(void __user *to, unsigned long n)
{
might_fault();
if (access_ok(VERIFY_WRITE, to, n))
__do_clear_user(to, n);
return n;
Expand Down
2 changes: 0 additions & 2 deletions include/asm-x86/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ extern void __put_user_8(void);
#define __put_user_size(x, ptr, size, retval, errret) \
do { \
retval = 0; \
might_fault(); \
__chk_user_ptr(ptr); \
switch (size) { \
case 1: \
Expand Down Expand Up @@ -320,7 +319,6 @@ do { \
#define __get_user_size(x, ptr, size, retval, errret) \
do { \
retval = 0; \
might_fault(); \
__chk_user_ptr(ptr); \
switch (size) { \
case 1: \
Expand Down
2 changes: 1 addition & 1 deletion include/linux/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static inline unsigned long __copy_from_user_nocache(void *to,
\
set_fs(KERNEL_DS); \
pagefault_disable(); \
ret = __get_user(retval, (__force typeof(retval) __user *)(addr)); \
ret = __copy_from_user_inatomic((__force typeof(retval) __user *)(addr), &(retval), sizeof(retval)); \
pagefault_enable(); \
set_fs(old_fs); \
ret; \
Expand Down

0 comments on commit 1d18ef4

Please sign in to comment.