@@ -435,9 +435,10 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
435435 struct elf_fdpic_params * interp_params )
436436{
437437 unsigned long sp , csp , nitems ;
438- elf_caddr_t * argv , * envp ;
438+ elf_caddr_t __user * argv , * envp ;
439439 size_t platform_len = 0 , len ;
440- char * k_platform , * u_platform , * p ;
440+ char * k_platform ;
441+ char __user * u_platform , * p ;
441442 long hwcap ;
442443 int loop ;
443444
@@ -462,12 +463,11 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
462463 if (k_platform ) {
463464 platform_len = strlen (k_platform ) + 1 ;
464465 sp -= platform_len ;
466+ u_platform = (char __user * ) sp ;
465467 if (__copy_to_user (u_platform , k_platform , platform_len ) != 0 )
466468 return - EFAULT ;
467469 }
468470
469- u_platform = (char * ) sp ;
470-
471471#if defined(__i386__ ) && defined(CONFIG_SMP )
472472 /* in some cases (e.g. Hyper-Threading), we want to avoid L1 evictions
473473 * by the processes running on the same package. One thing we can do
@@ -490,7 +490,7 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
490490 sp = (sp - len ) & ~7UL ;
491491 exec_params -> map_addr = sp ;
492492
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 )
494494 return - EFAULT ;
495495
496496 current -> mm -> context .exec_fdpic_loadmap = (unsigned long ) sp ;
@@ -501,7 +501,7 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
501501 sp = (sp - len ) & ~7UL ;
502502 interp_params -> map_addr = sp ;
503503
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 )
505505 return - EFAULT ;
506506
507507 current -> mm -> context .interp_fdpic_loadmap = (unsigned long ) sp ;
@@ -527,7 +527,7 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
527527 /* put the ELF interpreter info on the stack */
528528#define NEW_AUX_ENT (nr , id , val ) \
529529 do { \
530- struct { unsigned long _id, _val; } *ent = (void *) csp; \
530+ struct { unsigned long _id, _val; } __user *ent = (void __user *) csp; \
531531 __put_user((id), &ent[nr]._id); \
532532 __put_user((val), &ent[nr]._val); \
533533 } while (0)
@@ -564,13 +564,13 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
564564
565565 /* allocate room for argv[] and envv[] */
566566 csp -= (bprm -> envc + 1 ) * sizeof (elf_caddr_t );
567- envp = (elf_caddr_t * ) csp ;
567+ envp = (elf_caddr_t __user * ) csp ;
568568 csp -= (bprm -> argc + 1 ) * sizeof (elf_caddr_t );
569- argv = (elf_caddr_t * ) csp ;
569+ argv = (elf_caddr_t __user * ) csp ;
570570
571571 /* stack argc */
572572 csp -= sizeof (unsigned long );
573- __put_user (bprm -> argc , (unsigned long * ) csp );
573+ __put_user (bprm -> argc , (unsigned long __user * ) csp );
574574
575575 BUG_ON (csp != sp );
576576
@@ -581,7 +581,7 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
581581 current -> mm -> arg_start = current -> mm -> start_stack - (MAX_ARG_PAGES * PAGE_SIZE - bprm -> p );
582582#endif
583583
584- p = (char * ) current -> mm -> arg_start ;
584+ p = (char __user * ) current -> mm -> arg_start ;
585585 for (loop = bprm -> argc ; loop > 0 ; loop -- ) {
586586 __put_user ((elf_caddr_t ) p , argv ++ );
587587 len = strnlen_user (p , PAGE_SIZE * MAX_ARG_PAGES );
@@ -1025,7 +1025,7 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
10251025 /* clear the bit between beginning of mapping and beginning of PT_LOAD */
10261026 if (prot & PROT_WRITE && disp > 0 ) {
10271027 kdebug ("clear[%d] ad=%lx sz=%lx" , loop , maddr , disp );
1028- clear_user ((void * ) maddr , disp );
1028+ clear_user ((void __user * ) maddr , disp );
10291029 maddr += disp ;
10301030 }
10311031
@@ -1059,7 +1059,7 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
10591059 if (prot & PROT_WRITE && excess1 > 0 ) {
10601060 kdebug ("clear[%d] ad=%lx sz=%lx" ,
10611061 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 );
10631063 }
10641064
10651065#else
0 commit comments