diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2015-05-11 11:52:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 02:39:14 -0400 |
commit | b3c395ef5556a6c60f4426cc060f5b7bdcf82d5b (patch) | |
tree | 55e89d5396f6a42444f91973ed65884530ad45e9 /arch/m32r | |
parent | 9ec23531fd48031d1b6ca5366f5f967d17a8bc28 (diff) |
mm/uaccess, mm/fault: Clarify that uaccess may only sleep if pagefaults are enabled
In general, non-atomic variants of user access functions must not sleep
if pagefaults are disabled.
Let's update all relevant comments in uaccess code. This also reflects
the might_sleep() checks in might_fault().
Reviewed-and-tested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: David.Laight@ACULAB.COM
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: airlied@linux.ie
Cc: akpm@linux-foundation.org
Cc: benh@kernel.crashing.org
Cc: bigeasy@linutronix.de
Cc: borntraeger@de.ibm.com
Cc: daniel.vetter@intel.com
Cc: heiko.carstens@de.ibm.com
Cc: herbert@gondor.apana.org.au
Cc: hocko@suse.cz
Cc: hughd@google.com
Cc: mst@redhat.com
Cc: paulus@samba.org
Cc: ralf@linux-mips.org
Cc: schwidefsky@de.ibm.com
Cc: yang.shi@windriver.com
Link: http://lkml.kernel.org/r/1431359540-32227-4-git-send-email-dahi@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/m32r')
-rw-r--r-- | arch/m32r/include/asm/uaccess.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/arch/m32r/include/asm/uaccess.h b/arch/m32r/include/asm/uaccess.h index 71adff209405..cac7014daef3 100644 --- a/arch/m32r/include/asm/uaccess.h +++ b/arch/m32r/include/asm/uaccess.h | |||
@@ -91,7 +91,8 @@ static inline void set_fs(mm_segment_t s) | |||
91 | * @addr: User space pointer to start of block to check | 91 | * @addr: User space pointer to start of block to check |
92 | * @size: Size of block to check | 92 | * @size: Size of block to check |
93 | * | 93 | * |
94 | * Context: User context only. This function may sleep. | 94 | * Context: User context only. This function may sleep if pagefaults are |
95 | * enabled. | ||
95 | * | 96 | * |
96 | * Checks if a pointer to a block of memory in user space is valid. | 97 | * Checks if a pointer to a block of memory in user space is valid. |
97 | * | 98 | * |
@@ -155,7 +156,8 @@ extern int fixup_exception(struct pt_regs *regs); | |||
155 | * @x: Variable to store result. | 156 | * @x: Variable to store result. |
156 | * @ptr: Source address, in user space. | 157 | * @ptr: Source address, in user space. |
157 | * | 158 | * |
158 | * Context: User context only. This function may sleep. | 159 | * Context: User context only. This function may sleep if pagefaults are |
160 | * enabled. | ||
159 | * | 161 | * |
160 | * This macro copies a single simple variable from user space to kernel | 162 | * This macro copies a single simple variable from user space to kernel |
161 | * space. It supports simple types like char and int, but not larger | 163 | * space. It supports simple types like char and int, but not larger |
@@ -175,7 +177,8 @@ extern int fixup_exception(struct pt_regs *regs); | |||
175 | * @x: Value to copy to user space. | 177 | * @x: Value to copy to user space. |
176 | * @ptr: Destination address, in user space. | 178 | * @ptr: Destination address, in user space. |
177 | * | 179 | * |
178 | * Context: User context only. This function may sleep. | 180 | * Context: User context only. This function may sleep if pagefaults are |
181 | * enabled. | ||
179 | * | 182 | * |
180 | * This macro copies a single simple value from kernel space to user | 183 | * This macro copies a single simple value from kernel space to user |
181 | * space. It supports simple types like char and int, but not larger | 184 | * space. It supports simple types like char and int, but not larger |
@@ -194,7 +197,8 @@ extern int fixup_exception(struct pt_regs *regs); | |||
194 | * @x: Variable to store result. | 197 | * @x: Variable to store result. |
195 | * @ptr: Source address, in user space. | 198 | * @ptr: Source address, in user space. |
196 | * | 199 | * |
197 | * Context: User context only. This function may sleep. | 200 | * Context: User context only. This function may sleep if pagefaults are |
201 | * enabled. | ||
198 | * | 202 | * |
199 | * This macro copies a single simple variable from user space to kernel | 203 | * This macro copies a single simple variable from user space to kernel |
200 | * space. It supports simple types like char and int, but not larger | 204 | * space. It supports simple types like char and int, but not larger |
@@ -274,7 +278,8 @@ do { \ | |||
274 | * @x: Value to copy to user space. | 278 | * @x: Value to copy to user space. |
275 | * @ptr: Destination address, in user space. | 279 | * @ptr: Destination address, in user space. |
276 | * | 280 | * |
277 | * Context: User context only. This function may sleep. | 281 | * Context: User context only. This function may sleep if pagefaults are |
282 | * enabled. | ||
278 | * | 283 | * |
279 | * This macro copies a single simple value from kernel space to user | 284 | * This macro copies a single simple value from kernel space to user |
280 | * space. It supports simple types like char and int, but not larger | 285 | * space. It supports simple types like char and int, but not larger |
@@ -568,7 +573,8 @@ unsigned long __generic_copy_from_user(void *, const void __user *, unsigned lon | |||
568 | * @from: Source address, in kernel space. | 573 | * @from: Source address, in kernel space. |
569 | * @n: Number of bytes to copy. | 574 | * @n: Number of bytes to copy. |
570 | * | 575 | * |
571 | * Context: User context only. This function may sleep. | 576 | * Context: User context only. This function may sleep if pagefaults are |
577 | * enabled. | ||
572 | * | 578 | * |
573 | * Copy data from kernel space to user space. Caller must check | 579 | * Copy data from kernel space to user space. Caller must check |
574 | * the specified block with access_ok() before calling this function. | 580 | * the specified block with access_ok() before calling this function. |
@@ -588,7 +594,8 @@ unsigned long __generic_copy_from_user(void *, const void __user *, unsigned lon | |||
588 | * @from: Source address, in kernel space. | 594 | * @from: Source address, in kernel space. |
589 | * @n: Number of bytes to copy. | 595 | * @n: Number of bytes to copy. |
590 | * | 596 | * |
591 | * Context: User context only. This function may sleep. | 597 | * Context: User context only. This function may sleep if pagefaults are |
598 | * enabled. | ||
592 | * | 599 | * |
593 | * Copy data from kernel space to user space. | 600 | * Copy data from kernel space to user space. |
594 | * | 601 | * |
@@ -606,7 +613,8 @@ unsigned long __generic_copy_from_user(void *, const void __user *, unsigned lon | |||
606 | * @from: Source address, in user space. | 613 | * @from: Source address, in user space. |
607 | * @n: Number of bytes to copy. | 614 | * @n: Number of bytes to copy. |
608 | * | 615 | * |
609 | * Context: User context only. This function may sleep. | 616 | * Context: User context only. This function may sleep if pagefaults are |
617 | * enabled. | ||
610 | * | 618 | * |
611 | * Copy data from user space to kernel space. Caller must check | 619 | * Copy data from user space to kernel space. Caller must check |
612 | * the specified block with access_ok() before calling this function. | 620 | * the specified block with access_ok() before calling this function. |
@@ -626,7 +634,8 @@ unsigned long __generic_copy_from_user(void *, const void __user *, unsigned lon | |||
626 | * @from: Source address, in user space. | 634 | * @from: Source address, in user space. |
627 | * @n: Number of bytes to copy. | 635 | * @n: Number of bytes to copy. |
628 | * | 636 | * |
629 | * Context: User context only. This function may sleep. | 637 | * Context: User context only. This function may sleep if pagefaults are |
638 | * enabled. | ||
630 | * | 639 | * |
631 | * Copy data from user space to kernel space. | 640 | * Copy data from user space to kernel space. |
632 | * | 641 | * |
@@ -677,7 +686,8 @@ unsigned long clear_user(void __user *mem, unsigned long len); | |||
677 | * strlen_user: - Get the size of a string in user space. | 686 | * strlen_user: - Get the size of a string in user space. |
678 | * @str: The string to measure. | 687 | * @str: The string to measure. |
679 | * | 688 | * |
680 | * Context: User context only. This function may sleep. | 689 | * Context: User context only. This function may sleep if pagefaults are |
690 | * enabled. | ||
681 | * | 691 | * |
682 | * Get the size of a NUL-terminated string in user space. | 692 | * Get the size of a NUL-terminated string in user space. |
683 | * | 693 | * |