Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] frv: binfmt_elf_fdpic __user annotations

Add __user annotations to binfmt_elf_fdpic.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Al Viro and committed by
Linus Torvalds
530018bf 7ab76d72

+13 -13
+13 -13
fs/binfmt_elf_fdpic.c
··· 435 435 struct elf_fdpic_params *interp_params) 436 436 { 437 437 unsigned long sp, csp, nitems; 438 - elf_caddr_t *argv, *envp; 438 + elf_caddr_t __user *argv, *envp; 439 439 size_t platform_len = 0, len; 440 - char *k_platform, *u_platform, *p; 440 + char *k_platform; 441 + char __user *u_platform, *p; 441 442 long hwcap; 442 443 int loop; 443 444 ··· 463 462 if (k_platform) { 464 463 platform_len = strlen(k_platform) + 1; 465 464 sp -= platform_len; 465 + u_platform = (char __user *) sp; 466 466 if (__copy_to_user(u_platform, k_platform, platform_len) != 0) 467 467 return -EFAULT; 468 468 } 469 - 470 - u_platform = (char *) sp; 471 469 472 470 #if defined(__i386__) && defined(CONFIG_SMP) 473 471 /* in some cases (e.g. Hyper-Threading), we want to avoid L1 evictions ··· 490 490 sp = (sp - len) & ~7UL; 491 491 exec_params->map_addr = sp; 492 492 493 - if (copy_to_user((void *) sp, exec_params->loadmap, len) != 0) 493 + if (copy_to_user((void __user *) sp, exec_params->loadmap, len) != 0) 494 494 return -EFAULT; 495 495 496 496 current->mm->context.exec_fdpic_loadmap = (unsigned long) sp; ··· 501 501 sp = (sp - len) & ~7UL; 502 502 interp_params->map_addr = sp; 503 503 504 - if (copy_to_user((void *) sp, interp_params->loadmap, len) != 0) 504 + if (copy_to_user((void __user *) sp, interp_params->loadmap, len) != 0) 505 505 return -EFAULT; 506 506 507 507 current->mm->context.interp_fdpic_loadmap = (unsigned long) sp; ··· 527 527 /* put the ELF interpreter info on the stack */ 528 528 #define NEW_AUX_ENT(nr, id, val) \ 529 529 do { \ 530 - struct { unsigned long _id, _val; } *ent = (void *) csp; \ 530 + struct { unsigned long _id, _val; } __user *ent = (void __user *) csp; \ 531 531 __put_user((id), &ent[nr]._id); \ 532 532 __put_user((val), &ent[nr]._val); \ 533 533 } while (0) ··· 564 564 565 565 /* allocate room for argv[] and envv[] */ 566 566 csp -= (bprm->envc + 1) * sizeof(elf_caddr_t); 567 - envp = (elf_caddr_t *) csp; 567 + envp = (elf_caddr_t __user *) csp; 568 568 csp -= (bprm->argc + 1) * sizeof(elf_caddr_t); 569 - argv = (elf_caddr_t *) csp; 569 + argv = (elf_caddr_t __user *) csp; 570 570 571 571 /* stack argc */ 572 572 csp -= sizeof(unsigned long); 573 - __put_user(bprm->argc, (unsigned long *) csp); 573 + __put_user(bprm->argc, (unsigned long __user *) csp); 574 574 575 575 BUG_ON(csp != sp); 576 576 ··· 581 581 current->mm->arg_start = current->mm->start_stack - (MAX_ARG_PAGES * PAGE_SIZE - bprm->p); 582 582 #endif 583 583 584 - p = (char *) current->mm->arg_start; 584 + p = (char __user *) current->mm->arg_start; 585 585 for (loop = bprm->argc; loop > 0; loop--) { 586 586 __put_user((elf_caddr_t) p, argv++); 587 587 len = strnlen_user(p, PAGE_SIZE * MAX_ARG_PAGES); ··· 1025 1025 /* clear the bit between beginning of mapping and beginning of PT_LOAD */ 1026 1026 if (prot & PROT_WRITE && disp > 0) { 1027 1027 kdebug("clear[%d] ad=%lx sz=%lx", loop, maddr, disp); 1028 - clear_user((void *) maddr, disp); 1028 + clear_user((void __user *) maddr, disp); 1029 1029 maddr += disp; 1030 1030 } 1031 1031 ··· 1059 1059 if (prot & PROT_WRITE && excess1 > 0) { 1060 1060 kdebug("clear[%d] ad=%lx sz=%lx", 1061 1061 loop, maddr + phdr->p_filesz, excess1); 1062 - clear_user((void *) maddr + phdr->p_filesz, excess1); 1062 + clear_user((void __user *) maddr + phdr->p_filesz, excess1); 1063 1063 } 1064 1064 1065 1065 #else