maccess: rename probe_user_{read,write} to copy_{from,to}_user_nofault
Better describe what these functions do. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
fe557319aa
commit
c0ee37e85e
12
mm/maccess.c
12
mm/maccess.c
@@ -194,7 +194,7 @@ long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count)
|
||||
#endif /* HAVE_GET_KERNEL_NOFAULT */
|
||||
|
||||
/**
|
||||
* probe_user_read(): safely attempt to read from a user-space location
|
||||
* copy_from_user_nofault(): safely attempt to read from a user-space location
|
||||
* @dst: pointer to the buffer that shall take the data
|
||||
* @src: address to read from. This must be a user address.
|
||||
* @size: size of the data chunk
|
||||
@@ -202,7 +202,7 @@ long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count)
|
||||
* Safely read from user address @src to the buffer at @dst. If a kernel fault
|
||||
* happens, handle that and return -EFAULT.
|
||||
*/
|
||||
long probe_user_read(void *dst, const void __user *src, size_t size)
|
||||
long copy_from_user_nofault(void *dst, const void __user *src, size_t size)
|
||||
{
|
||||
long ret = -EFAULT;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
@@ -219,10 +219,10 @@ long probe_user_read(void *dst, const void __user *src, size_t size)
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(probe_user_read);
|
||||
EXPORT_SYMBOL_GPL(copy_from_user_nofault);
|
||||
|
||||
/**
|
||||
* probe_user_write(): safely attempt to write to a user-space location
|
||||
* copy_to_user_nofault(): safely attempt to write to a user-space location
|
||||
* @dst: address to write to
|
||||
* @src: pointer to the data that shall be written
|
||||
* @size: size of the data chunk
|
||||
@@ -230,7 +230,7 @@ EXPORT_SYMBOL_GPL(probe_user_read);
|
||||
* Safely write to address @dst from the buffer at @src. If a kernel fault
|
||||
* happens, handle that and return -EFAULT.
|
||||
*/
|
||||
long probe_user_write(void __user *dst, const void *src, size_t size)
|
||||
long copy_to_user_nofault(void __user *dst, const void *src, size_t size)
|
||||
{
|
||||
long ret = -EFAULT;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
@@ -247,7 +247,7 @@ long probe_user_write(void __user *dst, const void *src, size_t size)
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(probe_user_write);
|
||||
EXPORT_SYMBOL_GPL(copy_to_user_nofault);
|
||||
|
||||
/**
|
||||
* strncpy_from_user_nofault: - Copy a NUL terminated string from unsafe user
|
||||
|
||||
Reference in New Issue
Block a user