taglinefilesource code
bprm204fs/binfmt_aout.cstatic unsigned long * create_aout_tables(char * p, struct linux_binprm * bprm, int ibcs)
bprm208fs/binfmt_aout.cint argc = bprm->argc;
bprm209fs/binfmt_aout.cint envc = bprm->envc;
bprm216fs/binfmt_aout.cif (bprm->loader) {
bprm219fs/binfmt_aout.cput_user(bprm->loader, --sp);
bprm222fs/binfmt_aout.cput_user(bprm->exec, --sp);
bprm258fs/binfmt_aout.cdo_load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
bprm264fs/binfmt_aout.cunsigned long p = bprm->p;
bprm268fs/binfmt_aout.cex = *((struct exec *) bprm->buf);    /* exec-header */
bprm272fs/binfmt_aout.cbprm->inode->i_size < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
bprm286fs/binfmt_aout.c(fd_offset < bprm->inode->i_sb->s_blocksize)) {
bprm303fs/binfmt_aout.cflush_old_exec(bprm);
bprm314fs/binfmt_aout.ccurrent->suid = current->euid = current->fsuid = bprm->e_uid;
bprm315fs/binfmt_aout.ccurrent->sgid = current->egid = current->fsgid = bprm->e_gid;
bprm322fs/binfmt_aout.cread_exec(bprm->inode, fd_offset, (char *) N_TXTADDR(ex),
bprm328fs/binfmt_aout.cread_exec(bprm->inode, 32, (char *) 0, ex.a_text+ex.a_data, 0);
bprm334fs/binfmt_aout.cfd = open_inode(bprm->inode, O_RDONLY);
bprm344fs/binfmt_aout.cread_exec(bprm->inode, fd_offset,
bprm384fs/binfmt_aout.cp = setup_arg_pages(p, bprm);
bprm386fs/binfmt_aout.cp = (unsigned long) create_aout_tables((char *)p, bprm,
bprm399fs/binfmt_aout.cload_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
bprm404fs/binfmt_aout.cretval = do_load_aout_binary(bprm, regs);
bprm40fs/binfmt_elf.cstatic int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs);
bprm332fs/binfmt_elf.cdo_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
bprm359fs/binfmt_elf.celf_ex = *((struct elfhdr *) bprm->buf);    /* exec-header */
bprm371fs/binfmt_elf.c(!bprm->inode->i_op || !bprm->inode->i_op->default_file_ops ||
bprm372fs/binfmt_elf.c!bprm->inode->i_op->default_file_ops->mmap)){
bprm384fs/binfmt_elf.cretval = read_exec(bprm->inode, elf_ex.e_phoff, (char *) elf_phdata,
bprm396fs/binfmt_elf.celf_exec_fileno = open_inode(bprm->inode, O_RDONLY);
bprm432fs/binfmt_elf.cretval = read_exec(bprm->inode,elf_ppnt->p_offset,elf_interpreter,
bprm451fs/binfmt_elf.cretval = read_exec(interpreter_inode,0,bprm->buf,128, 1);
bprm454fs/binfmt_elf.cinterp_ex = *((struct exec *) bprm->buf);    /* exec-header */
bprm455fs/binfmt_elf.cinterp_elf_ex = *((struct elfhdr *) bprm->buf);    /* exec-header */
bprm492fs/binfmt_elf.cif (!bprm->sh_bang) {
bprm500fs/binfmt_elf.cbprm->p = copy_strings(1,&passed_p,bprm->page,bprm->p,2);
bprm501fs/binfmt_elf.cbprm->argc++;
bprm504fs/binfmt_elf.cif (!bprm->p) {
bprm514fs/binfmt_elf.cflush_old_exec(bprm);
bprm525fs/binfmt_elf.cbprm->p = setup_arg_pages(bprm->p, bprm);
bprm526fs/binfmt_elf.ccurrent->mm->start_stack = bprm->p;
bprm619fs/binfmt_elf.ccurrent->executable = bprm->inode;
bprm620fs/binfmt_elf.cbprm->inode->i_count++;
bprm625fs/binfmt_elf.ccurrent->suid = current->euid = current->fsuid = bprm->e_uid;
bprm626fs/binfmt_elf.ccurrent->sgid = current->egid = current->fsgid = bprm->e_gid;
bprm627fs/binfmt_elf.cbprm->p = (unsigned long) 
bprm628fs/binfmt_elf.ccreate_elf_tables((char *)bprm->p,
bprm629fs/binfmt_elf.cbprm->argc,
bprm630fs/binfmt_elf.cbprm->envc,
bprm641fs/binfmt_elf.ccurrent->mm->start_stack = bprm->p;
bprm677fs/binfmt_elf.cstart_thread(regs, elf_entry, bprm->p);
bprm684fs/binfmt_elf.cload_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
bprm689fs/binfmt_elf.cretval = do_load_elf_binary(bprm, regs);
bprm14fs/binfmt_script.cstatic int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs)
bprm18fs/binfmt_script.cif ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || (bprm->sh_bang)) 
bprm25fs/binfmt_script.cbprm->sh_bang++;
bprm26fs/binfmt_script.ciput(bprm->inode);
bprm27fs/binfmt_script.cbprm->dont_iput=1;
bprm29fs/binfmt_script.cbprm->buf[127] = '\0';
bprm30fs/binfmt_script.cif ((cp = strchr(bprm->buf, '\n')) == NULL)
bprm31fs/binfmt_script.ccp = bprm->buf+127;
bprm33fs/binfmt_script.cwhile (cp > bprm->buf) {
bprm40fs/binfmt_script.cfor (cp = bprm->buf+2; (*cp == ' ') || (*cp == '\t'); cp++);
bprm63fs/binfmt_script.cif (bprm->argc) {
bprm64fs/binfmt_script.coffset = bprm->p % PAGE_SIZE;
bprm65fs/binfmt_script.cpage = (char*)bprm->page[bprm->p/PAGE_SIZE];
bprm66fs/binfmt_script.cwhile(bprm->p++,*(page+offset++))
bprm69fs/binfmt_script.cpage = (char*)bprm->page[bprm->p/PAGE_SIZE];
bprm71fs/binfmt_script.cbprm->argc--;
bprm73fs/binfmt_script.cbprm->p = copy_strings(1, &bprm->filename, bprm->page, bprm->p, 2);
bprm74fs/binfmt_script.cbprm->argc++;
bprm76fs/binfmt_script.cbprm->p = copy_strings(1, &i_arg, bprm->page, bprm->p, 2);
bprm77fs/binfmt_script.cbprm->argc++;
bprm79fs/binfmt_script.cbprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
bprm80fs/binfmt_script.cbprm->argc++;
bprm81fs/binfmt_script.cif (!bprm->p) 
bprm88fs/binfmt_script.cretval = open_namei(interp, 0, 0, &bprm->inode, NULL);
bprm91fs/binfmt_script.cbprm->dont_iput=0;
bprm92fs/binfmt_script.cretval=prepare_binprm(bprm);
bprm95fs/binfmt_script.creturn search_binary_handler(bprm,regs);
bprm98fs/binfmt_script.cstatic int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
bprm102fs/binfmt_script.cretval = do_load_script(bprm,regs);
bprm281fs/exec.cunsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm)
bprm290fs/exec.cif (bprm->loader)
bprm291fs/exec.cbprm->loader += stack_base;
bprm292fs/exec.cbprm->exec += stack_base;
bprm310fs/exec.cif (bprm->page[i]) {
bprm312fs/exec.cput_dirty_page(current,bprm->page[i],stack_base);
bprm402fs/exec.cvoid flush_old_exec(struct linux_binprm * bprm)
bprm410fs/exec.cname = bprm->filename;
bprm425fs/exec.cif (bprm->e_uid != current->euid || bprm->e_gid != current->egid || 
bprm426fs/exec.cpermission(bprm->inode,MAY_READ))
bprm448fs/exec.cint prepare_binprm(struct linux_binprm *bprm)
bprm451fs/exec.cif (!S_ISREG(bprm->inode->i_mode))  /* must be regular file */
bprm453fs/exec.cif (IS_NOEXEC(bprm->inode))         /* FS mustn't be mounted noexec */
bprm455fs/exec.cif (!bprm->inode->i_sb)
bprm457fs/exec.ci = bprm->inode->i_mode;
bprm458fs/exec.cif (IS_NOSUID(bprm->inode) && 
bprm459fs/exec.c(((i & S_ISUID) && bprm->inode->i_uid != current->euid) 
bprm460fs/exec.c|| ((i & S_ISGID) && !in_group_p(bprm->inode->i_gid))) && !suser())
bprm464fs/exec.cbprm->e_uid = current->euid;
bprm465fs/exec.cbprm->e_gid = current->egid;
bprm467fs/exec.cbprm->e_uid = (i & S_ISUID) ? bprm->inode->i_uid : current->euid;
bprm468fs/exec.cbprm->e_gid = (i & S_ISGID) ? bprm->inode->i_gid : current->egid;
bprm470fs/exec.cif ((retval = permission(bprm->inode, MAY_EXEC)) != 0)
bprm472fs/exec.cif (!(bprm->inode->i_mode & 0111) && fsuser())
bprm475fs/exec.cif (bprm->inode->i_writecount > 0)
bprm478fs/exec.cmemset(bprm->buf,0,sizeof(bprm->buf));
bprm479fs/exec.creturn read_exec(bprm->inode,0,bprm->buf,128,1);
bprm482fs/exec.cvoid remove_arg_zero(struct linux_binprm *bprm)
bprm484fs/exec.cif (bprm->argc) {
bprm487fs/exec.coffset = bprm->p % PAGE_SIZE;
bprm488fs/exec.cpage = (char*)bprm->page[bprm->p/PAGE_SIZE];
bprm489fs/exec.cwhile(bprm->p++,*(page+offset++))
bprm492fs/exec.cpage = (char*)bprm->page[bprm->p/PAGE_SIZE];
bprm494fs/exec.cbprm->argc--;
bprm501fs/exec.cint search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
bprm508fs/exec.cstruct exec * eh = (struct exec *) bprm->buf;
bprm510fs/exec.cif (!bprm->loader && eh->fh.f_magic == 0x183 &&
bprm514fs/exec.ciput(bprm->inode);
bprm515fs/exec.cbprm->dont_iput = 1;
bprm516fs/exec.cremove_arg_zero(bprm);
bprm517fs/exec.cbprm->p = copy_strings(1, dynloader, bprm->page, bprm->p, 2);
bprm518fs/exec.cbprm->argc++;
bprm519fs/exec.cbprm->loader = bprm->p;
bprm520fs/exec.cretval = open_namei(dynloader[0], 0, 0, &bprm->inode, NULL);
bprm523fs/exec.cbprm->dont_iput = 0;
bprm524fs/exec.cretval = prepare_binprm(bprm);
bprm537fs/exec.cretval = fn(bprm, regs);
bprm539fs/exec.cif(!bprm->dont_iput)
bprm540fs/exec.ciput(bprm->inode);
bprm541fs/exec.cbprm->dont_iput=1;
bprm547fs/exec.cif (bprm->dont_iput) /* We don't have the inode anymore*/
bprm556fs/exec.cif (printable(bprm->buf[0]) &&
bprm557fs/exec.cprintable(bprm->buf[1]) &&
bprm558fs/exec.cprintable(bprm->buf[2]) &&
bprm559fs/exec.cprintable(bprm->buf[3]))
bprm561fs/exec.csprintf(modname, "binfmt-%hd", *(short*)(&bprm->buf));
bprm575fs/exec.cstruct linux_binprm bprm;
bprm579fs/exec.cbprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
bprm581fs/exec.cbprm.page[i] = 0;
bprm582fs/exec.cretval = open_namei(filename, 0, 0, &bprm.inode, NULL);
bprm585fs/exec.cbprm.filename = filename;
bprm586fs/exec.cbprm.sh_bang = 0;
bprm587fs/exec.cbprm.loader = 0;
bprm588fs/exec.cbprm.exec = 0;
bprm589fs/exec.cbprm.dont_iput = 0;
bprm590fs/exec.cif ((bprm.argc = count(argv)) < 0)
bprm591fs/exec.creturn bprm.argc;
bprm592fs/exec.cif ((bprm.envc = count(envp)) < 0)
bprm593fs/exec.creturn bprm.envc;
bprm595fs/exec.cretval = prepare_binprm(&bprm);
bprm598fs/exec.cbprm.p = copy_strings(1, &bprm.filename, bprm.page, bprm.p, 2);
bprm599fs/exec.cbprm.exec = bprm.p;
bprm600fs/exec.cbprm.p = copy_strings(bprm.envc,envp,bprm.page,bprm.p,0);
bprm601fs/exec.cbprm.p = copy_strings(bprm.argc,argv,bprm.page,bprm.p,0);
bprm602fs/exec.cif (!bprm.p)
bprm607fs/exec.cretval = search_binary_handler(&bprm,regs);
bprm613fs/exec.cif(!bprm.dont_iput)
bprm614fs/exec.ciput(bprm.inode);
bprm616fs/exec.cfree_page(bprm.page[i]);
bprm55include/linux/binfmts.hextern void flush_old_exec(struct linux_binprm * bprm);
bprm56include/linux/binfmts.hextern unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm);