BACKPORT: maccess: rename probe_user_{read,write} to copy_{from,to}_user_nofault

Better describe what these functions do.

Suggested-by: Linus Torvalds <[email protected]>
Change-Id: Ia98042e3b7989d7f88093d2869253e4bac828ed2
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Christoph Hellwig 2020-06-17 09:37:54 +02:00 • committed by basamaryan
commit e9c4c7ccc6
No known key found for this signature in database
GPG key ID: 210D5384FB2A5885
9 changed files with 23 additions and 19 deletions

View file

@ -124,7 +124,7 @@ long copy_from_kernel_nofault(void *dst, const void *src, size_t size)
EXPORT_SYMBOL_GPL(copy_from_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
@ -132,7 +132,7 @@ EXPORT_SYMBOL_GPL(copy_from_kernel_nofault);
* 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();
@ -149,7 +149,7 @@ 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_kernel_write(): safely attempt to write to a location
@ -177,7 +177,7 @@ long copy_to_kernel_nofault(void *dst, const void *src, size_t size)
}
/**
* 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
@ -185,7 +185,7 @@ long copy_to_kernel_nofault(void *dst, const void *src, size_t size)
* 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();
@ -202,7 +202,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_kernel_nofault: - Copy a NUL terminated string from unsafe