Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42806
b: refs/heads/master
c: 20aa7b2
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Dec 7, 2006
1 parent 8a06f46 commit ccdc75b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c140e110019f25ffa1c6f3f365b0c9103d0b8475
refs/heads/master: 20aa7b21b1cbd1aa3fbf5fc14da5f7484a61a824
8 changes: 8 additions & 0 deletions trunk/include/linux/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,22 @@ static inline unsigned long __copy_from_user_nocache(void *to,
* do_page_fault() doesn't attempt to take mmap_sem. This makes
* probe_kernel_address() suitable for use within regions where the caller
* already holds mmap_sem, or other locks which nest inside mmap_sem.
* This must be a macro because __get_user() needs to know the types of the
* args.
*
* We don't include enough header files to be able to do the set_fs(). We
* require that the probe_kernel_address() caller will do that.
*/
#define probe_kernel_address(addr, retval) \
({ \
long ret; \
mm_segment_t old_fs = get_fs(); \
\
set_fs(KERNEL_DS); \
pagefault_disable(); \
ret = __get_user(retval, addr); \
pagefault_enable(); \
set_fs(old_fs); \
ret; \
})

Expand Down

0 comments on commit ccdc75b

Please sign in to comment.