Skip to content

Commit 646e84d

Browse files
author
Al Viro
committed
binfmt_elf: don't bother with __{put,copy_to}_user()
Signed-off-by: Al Viro <[email protected]>
1 parent 7e71609 commit 646e84d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

fs/binfmt_elf.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec,
202202
size_t len = strlen(k_platform) + 1;
203203

204204
u_platform = (elf_addr_t __user *)STACK_ALLOC(p, len);
205-
if (__copy_to_user(u_platform, k_platform, len))
205+
if (copy_to_user(u_platform, k_platform, len))
206206
return -EFAULT;
207207
}
208208

@@ -215,7 +215,7 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec,
215215
size_t len = strlen(k_base_platform) + 1;
216216

217217
u_base_platform = (elf_addr_t __user *)STACK_ALLOC(p, len);
218-
if (__copy_to_user(u_base_platform, k_base_platform, len))
218+
if (copy_to_user(u_base_platform, k_base_platform, len))
219219
return -EFAULT;
220220
}
221221

@@ -225,7 +225,7 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec,
225225
get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes));
226226
u_rand_bytes = (elf_addr_t __user *)
227227
STACK_ALLOC(p, sizeof(k_rand_bytes));
228-
if (__copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes)))
228+
if (copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes)))
229229
return -EFAULT;
230230

231231
/* Create the ELF interpreter info */
@@ -308,36 +308,36 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec,
308308
return -EFAULT;
309309

310310
/* Now, let's put argc (and argv, envp if appropriate) on the stack */
311-
if (__put_user(argc, sp++))
311+
if (put_user(argc, sp++))
312312
return -EFAULT;
313313

314314
/* Populate list of argv pointers back to argv strings. */
315315
p = mm->arg_end = mm->arg_start;
316316
while (argc-- > 0) {
317317
size_t len;
318-
if (__put_user((elf_addr_t)p, sp++))
318+
if (put_user((elf_addr_t)p, sp++))
319319
return -EFAULT;
320320
len = strnlen_user((void __user *)p, MAX_ARG_STRLEN);
321321
if (!len || len > MAX_ARG_STRLEN)
322322
return -EINVAL;
323323
p += len;
324324
}
325-
if (__put_user(0, sp++))
325+
if (put_user(0, sp++))
326326
return -EFAULT;
327327
mm->arg_end = p;
328328

329329
/* Populate list of envp pointers back to envp strings. */
330330
mm->env_end = mm->env_start = p;
331331
while (envc-- > 0) {
332332
size_t len;
333-
if (__put_user((elf_addr_t)p, sp++))
333+
if (put_user((elf_addr_t)p, sp++))
334334
return -EFAULT;
335335
len = strnlen_user((void __user *)p, MAX_ARG_STRLEN);
336336
if (!len || len > MAX_ARG_STRLEN)
337337
return -EINVAL;
338338
p += len;
339339
}
340-
if (__put_user(0, sp++))
340+
if (put_user(0, sp++))
341341
return -EFAULT;
342342
mm->env_end = p;
343343

0 commit comments

Comments
 (0)