Skip to content

Commit

Permalink
efi_test: get rid of pointless access_ok()
Browse files Browse the repository at this point in the history
really, people - get_user(), copy_from_user(), memdup_user(), etc.
all fail if access_ok() does.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 29, 2020
1 parent a38547d commit d2659e5
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions drivers/firmware/efi/test/efi_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ copy_ucs2_from_user_len(efi_char16_t **dst, efi_char16_t __user *src,
return 0;
}

if (!access_ok(src, 1))
return -EFAULT;

buf = memdup_user(src, len);
if (IS_ERR(buf)) {
*dst = NULL;
Expand All @@ -91,9 +88,6 @@ copy_ucs2_from_user_len(efi_char16_t **dst, efi_char16_t __user *src,
static inline int
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);
if (*len == 0)
return -EFAULT;
Expand All @@ -118,9 +112,6 @@ copy_ucs2_from_user(efi_char16_t **dst, efi_char16_t __user *src)
{
size_t len;

if (!access_ok(src, 1))
return -EFAULT;

len = user_ucs2_strsize(src);
if (len == 0)
return -EFAULT;
Expand All @@ -142,9 +133,6 @@ copy_ucs2_to_user_len(efi_char16_t __user *dst, efi_char16_t *src, size_t len)
if (!src)
return 0;

if (!access_ok(dst, 1))
return -EFAULT;

return copy_to_user(dst, src, len);
}

Expand Down

0 comments on commit d2659e5

Please sign in to comment.