Commit d2659e58 authored by Al Viro's avatar Al Viro

efi_test: get rid of pointless access_ok()

really, people - get_user(), copy_from_user(), memdup_user(), etc.
all fail if access_ok() does.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent a38547d4
...@@ -70,9 +70,6 @@ copy_ucs2_from_user_len(efi_char16_t **dst, efi_char16_t __user *src, ...@@ -70,9 +70,6 @@ copy_ucs2_from_user_len(efi_char16_t **dst, efi_char16_t __user *src,
return 0; return 0;
} }
if (!access_ok(src, 1))
return -EFAULT;
buf = memdup_user(src, len); buf = memdup_user(src, len);
if (IS_ERR(buf)) { if (IS_ERR(buf)) {
*dst = NULL; *dst = NULL;
...@@ -91,9 +88,6 @@ copy_ucs2_from_user_len(efi_char16_t **dst, efi_char16_t __user *src, ...@@ -91,9 +88,6 @@ copy_ucs2_from_user_len(efi_char16_t **dst, efi_char16_t __user *src,
static inline int static inline int
get_ucs2_strsize_from_user(efi_char16_t __user *src, size_t *len) get_ucs2_strsize_from_user(efi_char16_t __user *src, size_t *len)
{ {
if (!access_ok(src, 1))
return -EFAULT;
*len = user_ucs2_strsize(src); *len = user_ucs2_strsize(src);
if (*len == 0) if (*len == 0)
return -EFAULT; return -EFAULT;
...@@ -118,9 +112,6 @@ copy_ucs2_from_user(efi_char16_t **dst, efi_char16_t __user *src) ...@@ -118,9 +112,6 @@ copy_ucs2_from_user(efi_char16_t **dst, efi_char16_t __user *src)
{ {
size_t len; size_t len;
if (!access_ok(src, 1))
return -EFAULT;
len = user_ucs2_strsize(src); len = user_ucs2_strsize(src);
if (len == 0) if (len == 0)
return -EFAULT; return -EFAULT;
...@@ -142,9 +133,6 @@ copy_ucs2_to_user_len(efi_char16_t __user *dst, efi_char16_t *src, size_t len) ...@@ -142,9 +133,6 @@ copy_ucs2_to_user_len(efi_char16_t __user *dst, efi_char16_t *src, size_t len)
if (!src) if (!src)
return 0; return 0;
if (!access_ok(dst, 1))
return -EFAULT;
return copy_to_user(dst, src, len); return copy_to_user(dst, src, len);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment