taglinefilesource code
bprm42arch/i386/ibcs/binfmt_coff.cstatic int load_object (struct linux_binprm *bprm,
bprm112arch/i386/ibcs/binfmt_coff.cload_object (struct linux_binprm * bprm, struct pt_regs *regs, int lib_ok)
bprm114arch/i386/ibcs/binfmt_coff.cCOFF_FILHDR  *coff_hdr = (COFF_FILHDR *) bprm->buf;  /* COFF Header */
bprm132arch/i386/ibcs/binfmt_coff.cprintk ("binfmt_coff entry: %s\n", bprm->filename);
bprm190arch/i386/ibcs/binfmt_coff.cif (!bprm->inode->i_op ||
bprm191arch/i386/ibcs/binfmt_coff.c!bprm->inode->i_op->default_file_ops->mmap) {
bprm218arch/i386/ibcs/binfmt_coff.cstatus = read_exec (bprm->inode,       /* INODE for file       */
bprm379arch/i386/ibcs/binfmt_coff.cfd = open_inode (bprm->inode, O_RDONLY);
bprm440arch/i386/ibcs/binfmt_coff.cflush_old_exec (bprm);
bprm449arch/i386/ibcs/binfmt_coff.cbprm->p += change_ldt (0, bprm->page);
bprm450arch/i386/ibcs/binfmt_coff.cbprm->p -= MAX_ARG_PAGES*PAGE_SIZE;
bprm451arch/i386/ibcs/binfmt_coff.cbprm->p  = (unsigned long) create_tables ((char *) bprm->p,
bprm452arch/i386/ibcs/binfmt_coff.cbprm->argc,
bprm453arch/i386/ibcs/binfmt_coff.cbprm->envc,
bprm464arch/i386/ibcs/binfmt_coff.ccurrent->euid            = bprm->e_uid;
bprm466arch/i386/ibcs/binfmt_coff.ccurrent->egid            = bprm->e_gid;
bprm467arch/i386/ibcs/binfmt_coff.ccurrent->executable      = bprm->inode; /* Store inode for file  */
bprm468arch/i386/ibcs/binfmt_coff.c++bprm->inode->i_count;             /* Count the open inode  */
bprm471arch/i386/ibcs/binfmt_coff.ccurrent->mm->start_stack = bprm->p;
bprm541arch/i386/ibcs/binfmt_coff.cstatus = preload_library (bprm, sect_ptr, fp);
bprm725arch/i386/ibcs/binfmt_coff.cload_coff_binary (struct linux_binprm *bprm, struct pt_regs *regs)
bprm727arch/i386/ibcs/binfmt_coff.creturn (load_object (bprm, regs, 1));
bprm739arch/i386/ibcs/binfmt_coff.cstruct linux_binprm *bprm;  /* Parameters for the load operation   */
bprm744arch/i386/ibcs/binfmt_coff.cbprm = (struct linux_binprm *) kmalloc (sizeof (struct linux_binprm),
bprm746arch/i386/ibcs/binfmt_coff.cif (0 == bprm) {
bprm757arch/i386/ibcs/binfmt_coff.cmemset (bprm, '\0', sizeof (struct linux_binprm));
bprm760arch/i386/ibcs/binfmt_coff.cbprm->inode    = file->f_inode;   /* The only item _really_ needed */
bprm761arch/i386/ibcs/binfmt_coff.cbprm->filename = "";              /* Make it a legal string        */
bprm766arch/i386/ibcs/binfmt_coff.cstatus = read_exec (bprm->inode,   /* INODE for file       */
bprm768arch/i386/ibcs/binfmt_coff.cbprm->buf,           /* Buffer for read      */
bprm769arch/i386/ibcs/binfmt_coff.csizeof (bprm->buf)); /* Size of the buffer   */
bprm774arch/i386/ibcs/binfmt_coff.cstatus = load_object (bprm, &regs, 0);
bprm778arch/i386/ibcs/binfmt_coff.ckfree (bprm);                 /* Release the buffer area */
bprm262arch/i386/ibcs/binfmt_elf.cstatic int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
bprm287arch/i386/ibcs/binfmt_elf.celf_ex = *((struct elfhdr *) bprm->buf);    /* exec-header */
bprm297arch/i386/ibcs/binfmt_elf.c(!bprm->inode->i_op || !bprm->inode->i_op->default_file_ops ||
bprm298arch/i386/ibcs/binfmt_elf.c!bprm->inode->i_op->default_file_ops->mmap)){
bprm309arch/i386/ibcs/binfmt_elf.cretval = read_exec(bprm->inode, elf_ex.e_phoff, (char *) elf_phdata,
bprm322arch/i386/ibcs/binfmt_elf.celf_exec_fileno = open_inode(bprm->inode, O_RDONLY);
bprm348arch/i386/ibcs/binfmt_elf.cretval = read_exec(bprm->inode,elf_ppnt->p_offset,elf_interpreter,
bprm356arch/i386/ibcs/binfmt_elf.cretval = read_exec(interpreter_inode,0,bprm->buf,128);
bprm359arch/i386/ibcs/binfmt_elf.cinterp_ex = *((struct exec *) bprm->buf);    /* exec-header */
bprm360arch/i386/ibcs/binfmt_elf.cinterp_elf_ex = *((struct elfhdr *) bprm->buf);    /* exec-header */
bprm403arch/i386/ibcs/binfmt_elf.cif (!bprm->sh_bang) {
bprm411arch/i386/ibcs/binfmt_elf.cbprm->p = copy_strings(1,&passed_p,bprm->page,bprm->p,2);
bprm412arch/i386/ibcs/binfmt_elf.cbprm->argc++;
bprm415arch/i386/ibcs/binfmt_elf.cif (!bprm->p) {
bprm425arch/i386/ibcs/binfmt_elf.cflush_old_exec(bprm);
bprm436arch/i386/ibcs/binfmt_elf.cbprm->p += change_ldt(0, bprm->page);
bprm437arch/i386/ibcs/binfmt_elf.ccurrent->mm->start_stack = bprm->p;
bprm518arch/i386/ibcs/binfmt_elf.ccurrent->executable = bprm->inode;
bprm519arch/i386/ibcs/binfmt_elf.cbprm->inode->i_count++;
bprm523arch/i386/ibcs/binfmt_elf.cbprm->p -= MAX_ARG_PAGES*PAGE_SIZE;
bprm524arch/i386/ibcs/binfmt_elf.cbprm->p = (unsigned long) 
bprm525arch/i386/ibcs/binfmt_elf.ccreate_elf_tables((char *)bprm->p,
bprm526arch/i386/ibcs/binfmt_elf.cbprm->argc,
bprm527arch/i386/ibcs/binfmt_elf.cbprm->envc,
bprm537arch/i386/ibcs/binfmt_elf.ccurrent->mm->start_stack = bprm->p;
bprm538arch/i386/ibcs/binfmt_elf.ccurrent->suid = current->euid = bprm->e_uid;
bprm539arch/i386/ibcs/binfmt_elf.ccurrent->sgid = current->egid = bprm->e_gid;
bprm556arch/i386/ibcs/binfmt_elf.cregs->esp = bprm->p;      /* stack pointer */
bprm49fs/binfmt_elf.cstatic int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs);
bprm298fs/binfmt_elf.cload_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
bprm327fs/binfmt_elf.celf_ex = *((struct elfhdr *) bprm->buf);    /* exec-header */
bprm339fs/binfmt_elf.c(!bprm->inode->i_op || !bprm->inode->i_op->default_file_ops ||
bprm340fs/binfmt_elf.c!bprm->inode->i_op->default_file_ops->mmap)){
bprm352fs/binfmt_elf.cretval = read_exec(bprm->inode, elf_ex.e_phoff, (char *) elf_phdata,
bprm366fs/binfmt_elf.celf_exec_fileno = open_inode(bprm->inode, O_RDONLY);
bprm393fs/binfmt_elf.cretval = read_exec(bprm->inode,elf_ppnt->p_offset,elf_interpreter,
bprm407fs/binfmt_elf.cretval = read_exec(interpreter_inode,0,bprm->buf,128);
bprm410fs/binfmt_elf.cinterp_ex = *((struct exec *) bprm->buf);    /* exec-header */
bprm411fs/binfmt_elf.cinterp_elf_ex = *((struct elfhdr *) bprm->buf);    /* exec-header */
bprm457fs/binfmt_elf.cif (!bprm->sh_bang) {
bprm465fs/binfmt_elf.cbprm->p = copy_strings(1,&passed_p,bprm->page,bprm->p,2);
bprm466fs/binfmt_elf.cbprm->argc++;
bprm469fs/binfmt_elf.cif (!bprm->p) {
bprm480fs/binfmt_elf.cflush_old_exec(bprm);
bprm491fs/binfmt_elf.cbprm->p += setup_arg_pages(0, bprm->page);
bprm492fs/binfmt_elf.ccurrent->mm->start_stack = bprm->p;
bprm578fs/binfmt_elf.ccurrent->executable = bprm->inode;
bprm579fs/binfmt_elf.cbprm->inode->i_count++;
bprm584fs/binfmt_elf.cbprm->p -= MAX_ARG_PAGES*PAGE_SIZE;
bprm585fs/binfmt_elf.cbprm->p = (unsigned long) 
bprm586fs/binfmt_elf.ccreate_elf_tables((char *)bprm->p,
bprm587fs/binfmt_elf.cbprm->argc,
bprm588fs/binfmt_elf.cbprm->envc,
bprm598fs/binfmt_elf.ccurrent->mm->start_stack = bprm->p;
bprm599fs/binfmt_elf.ccurrent->suid = current->euid = current->fsuid = bprm->e_uid;
bprm600fs/binfmt_elf.ccurrent->sgid = current->egid = current->fsgid = bprm->e_gid;
bprm625fs/binfmt_elf.cstart_thread(regs, elf_entry, bprm->p);
bprm506fs/exec.cvoid flush_old_exec(struct linux_binprm * bprm)
bprm513fs/exec.cname = bprm->filename;
bprm528fs/exec.cif (bprm->e_uid != current->euid || bprm->e_gid != current->egid || 
bprm529fs/exec.cpermission(bprm->inode,MAY_READ))
bprm553fs/exec.cstruct linux_binprm bprm;
bprm560fs/exec.cbprm.p = PAGE_SIZE*MAX_ARG_PAGES-4;
bprm562fs/exec.cbprm.page[i] = 0;
bprm563fs/exec.cretval = open_namei(filename, 0, 0, &bprm.inode, NULL);
bprm566fs/exec.cbprm.filename = filename;
bprm567fs/exec.cif ((bprm.argc = count(argv)) < 0)
bprm568fs/exec.creturn bprm.argc;
bprm569fs/exec.cif ((bprm.envc = count(envp)) < 0)
bprm570fs/exec.creturn bprm.envc;
bprm573fs/exec.cif (!S_ISREG(bprm.inode->i_mode)) {  /* must be regular file */
bprm577fs/exec.cif (IS_NOEXEC(bprm.inode)) {    /* FS mustn't be mounted noexec */
bprm581fs/exec.cif (!bprm.inode->i_sb) {
bprm585fs/exec.ci = bprm.inode->i_mode;
bprm586fs/exec.cif (IS_NOSUID(bprm.inode) && (((i & S_ISUID) && bprm.inode->i_uid != current->
bprm587fs/exec.ceuid) || ((i & S_ISGID) && !in_group_p(bprm.inode->i_gid))) && !suser()) {
bprm593fs/exec.cbprm.e_uid = current->euid;
bprm594fs/exec.cbprm.e_gid = current->egid;
bprm596fs/exec.cbprm.e_uid = (i & S_ISUID) ? bprm.inode->i_uid : current->euid;
bprm597fs/exec.cbprm.e_gid = (i & S_ISGID) ? bprm.inode->i_gid : current->egid;
bprm599fs/exec.cif ((retval = permission(bprm.inode, MAY_EXEC)) != 0)
bprm601fs/exec.cif (!(bprm.inode->i_mode & 0111) && fsuser()) {
bprm606fs/exec.cif (bprm.inode->i_wcount > 0) {
bprm610fs/exec.cmemset(bprm.buf,0,sizeof(bprm.buf));
bprm613fs/exec.cretval = read_exec(bprm.inode,0,bprm.buf,128);
bprm617fs/exec.cif ((bprm.buf[0] == '#') && (bprm.buf[1] == '!') && (!sh_bang)) {
bprm625fs/exec.ciput(bprm.inode);
bprm626fs/exec.cbprm.buf[127] = '\0';
bprm627fs/exec.cif ((cp = strchr(bprm.buf, '\n')) == NULL)
bprm628fs/exec.ccp = bprm.buf+127;
bprm630fs/exec.cwhile (cp > bprm.buf) {
bprm637fs/exec.cfor (cp = bprm.buf+2; (*cp == ' ') || (*cp == '\t'); cp++);
bprm657fs/exec.cbprm.p = copy_strings(bprm.envc, envp, bprm.page, bprm.p, 0);
bprm658fs/exec.cbprm.p = copy_strings(--bprm.argc, argv+1, bprm.page, bprm.p, 0);
bprm668fs/exec.cbprm.p = copy_strings(1, &bprm.filename, bprm.page, bprm.p, 2);
bprm669fs/exec.cbprm.argc++;
bprm671fs/exec.cbprm.p = copy_strings(1, &i_arg, bprm.page, bprm.p, 2);
bprm672fs/exec.cbprm.argc++;
bprm674fs/exec.cbprm.p = copy_strings(1, &i_name, bprm.page, bprm.p, 2);
bprm675fs/exec.cbprm.argc++;
bprm676fs/exec.cif (!bprm.p) {
bprm685fs/exec.cretval = open_namei(interp, 0, 0, &bprm.inode, NULL);
bprm691fs/exec.cbprm.p = copy_strings(bprm.envc,envp,bprm.page,bprm.p,0);
bprm692fs/exec.cbprm.p = copy_strings(bprm.argc,argv,bprm.page,bprm.p,0);
bprm693fs/exec.cif (!bprm.p) {
bprm699fs/exec.cbprm.sh_bang = sh_bang;
bprm704fs/exec.cretval = fn(&bprm, regs);
bprm706fs/exec.ciput(bprm.inode);
bprm714fs/exec.ciput(bprm.inode);
bprm717fs/exec.cfree_page(bprm.page[i]);
bprm737fs/exec.cstatic int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
bprm742fs/exec.cunsigned long p = bprm->p;
bprm745fs/exec.cex = *((struct exec *) bprm->buf);    /* exec-header */
bprm749fs/exec.cbprm->inode->i_size < ex.a_text+ex.a_data+ex.a_syms+N_TXTOFF(ex)) {
bprm761fs/exec.c(fd_offset < bprm->inode->i_sb->s_blocksize)) {
bprm767fs/exec.cflush_old_exec(bprm);
bprm776fs/exec.ccurrent->suid = current->euid = current->fsuid = bprm->e_uid;
bprm777fs/exec.ccurrent->sgid = current->egid = current->fsgid = bprm->e_gid;
bprm782fs/exec.cread_exec(bprm->inode, 32, (char *) 0, ex.a_text+ex.a_data);
bprm787fs/exec.cfd = open_inode(bprm->inode, O_RDONLY);
bprm797fs/exec.cread_exec(bprm->inode, fd_offset,
bprm837fs/exec.cp += setup_arg_pages(ex.a_text,bprm->page);
bprm840fs/exec.cbprm->argc, bprm->envc,
bprm47include/linux/binfmts.hextern void flush_old_exec(struct linux_binprm * bprm);