Skip to content

Commit d2659e5

Browse files
author
Al Viro
committed
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: Al Viro <[email protected]>
1 parent a38547d commit d2659e5

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

drivers/firmware/efi/test/efi_test.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ copy_ucs2_from_user_len(efi_char16_t **dst, efi_char16_t __user *src,
7070
return 0;
7171
}
7272

73-
if (!access_ok(src, 1))
74-
return -EFAULT;
75-
7673
buf = memdup_user(src, len);
7774
if (IS_ERR(buf)) {
7875
*dst = NULL;
@@ -91,9 +88,6 @@ copy_ucs2_from_user_len(efi_char16_t **dst, efi_char16_t __user *src,
9188
static inline int
9289
get_ucs2_strsize_from_user(efi_char16_t __user *src, size_t *len)
9390
{
94-
if (!access_ok(src, 1))
95-
return -EFAULT;
96-
9791
*len = user_ucs2_strsize(src);
9892
if (*len == 0)
9993
return -EFAULT;
@@ -118,9 +112,6 @@ copy_ucs2_from_user(efi_char16_t **dst, efi_char16_t __user *src)
118112
{
119113
size_t len;
120114

121-
if (!access_ok(src, 1))
122-
return -EFAULT;
123-
124115
len = user_ucs2_strsize(src);
125116
if (len == 0)
126117
return -EFAULT;
@@ -142,9 +133,6 @@ copy_ucs2_to_user_len(efi_char16_t __user *dst, efi_char16_t *src, size_t len)
142133
if (!src)
143134
return 0;
144135

145-
if (!access_ok(dst, 1))
146-
return -EFAULT;
147-
148136
return copy_to_user(dst, src, len);
149137
}
150138

0 commit comments

Comments
 (0)