tag | line | file | source code |
bprm | 51 | fs/binfmt_elf.c | static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs); |
bprm | 335 | fs/binfmt_elf.c | load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) |
bprm | 364 | fs/binfmt_elf.c | elf_ex = *((struct elfhdr *) bprm->buf); /* exec-header */ |
bprm | 376 | fs/binfmt_elf.c | (!bprm->inode->i_op || !bprm->inode->i_op->default_file_ops || |
bprm | 377 | fs/binfmt_elf.c | !bprm->inode->i_op->default_file_ops->mmap)){ |
bprm | 387 | fs/binfmt_elf.c | retval = read_exec(bprm->inode, elf_ex.e_phoff, (char *) elf_phdata, |
bprm | 400 | fs/binfmt_elf.c | elf_exec_fileno = open_inode(bprm->inode, O_RDONLY); |
bprm | 424 | fs/binfmt_elf.c | retval = read_exec(bprm->inode,elf_ppnt->p_offset,elf_interpreter, |
bprm | 443 | fs/binfmt_elf.c | retval = read_exec(interpreter_inode,0,bprm->buf,128, 1); |
bprm | 446 | fs/binfmt_elf.c | interp_ex = *((struct exec *) bprm->buf); /* exec-header */ |
bprm | 447 | fs/binfmt_elf.c | interp_elf_ex = *((struct elfhdr *) bprm->buf); /* exec-header */ |
bprm | 491 | fs/binfmt_elf.c | if (!bprm->sh_bang) { |
bprm | 499 | fs/binfmt_elf.c | bprm->p = copy_strings(1,&passed_p,bprm->page,bprm->p,2); |
bprm | 500 | fs/binfmt_elf.c | bprm->argc++; |
bprm | 503 | fs/binfmt_elf.c | if (!bprm->p) { |
bprm | 514 | fs/binfmt_elf.c | flush_old_exec(bprm); |
bprm | 525 | fs/binfmt_elf.c | bprm->p += setup_arg_pages(0, bprm->page); |
bprm | 526 | fs/binfmt_elf.c | current->mm->start_stack = bprm->p; |
bprm | 615 | fs/binfmt_elf.c | current->executable = bprm->inode; |
bprm | 616 | fs/binfmt_elf.c | bprm->inode->i_count++; |
bprm | 621 | fs/binfmt_elf.c | bprm->p -= MAX_ARG_PAGES*PAGE_SIZE; |
bprm | 622 | fs/binfmt_elf.c | bprm->p = (unsigned long) |
bprm | 623 | fs/binfmt_elf.c | create_elf_tables((char *)bprm->p, |
bprm | 624 | fs/binfmt_elf.c | bprm->argc, |
bprm | 625 | fs/binfmt_elf.c | bprm->envc, |
bprm | 636 | fs/binfmt_elf.c | current->mm->start_stack = bprm->p; |
bprm | 637 | fs/binfmt_elf.c | current->suid = current->euid = current->fsuid = bprm->e_uid; |
bprm | 638 | fs/binfmt_elf.c | current->sgid = current->egid = current->fsgid = bprm->e_gid; |
bprm | 666 | fs/binfmt_elf.c | start_thread(regs, elf_entry, bprm->p); |
bprm | 298 | fs/exec.c | unsigned long * create_tables(char * p, struct linux_binprm * bprm, int ibcs) |
bprm | 303 | fs/exec.c | int argc = bprm->argc; |
bprm | 304 | fs/exec.c | int envc = bprm->envc; |
bprm | 511 | fs/exec.c | void flush_old_exec(struct linux_binprm * bprm) |
bprm | 519 | fs/exec.c | name = bprm->filename; |
bprm | 534 | fs/exec.c | if (bprm->e_uid != current->euid || bprm->e_gid != current->egid || |
bprm | 535 | fs/exec.c | permission(bprm->inode,MAY_READ)) |
bprm | 559 | fs/exec.c | struct linux_binprm bprm; |
bprm | 565 | fs/exec.c | bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); |
bprm | 567 | fs/exec.c | bprm.page[i] = 0; |
bprm | 568 | fs/exec.c | retval = open_namei(filename, 0, 0, &bprm.inode, NULL); |
bprm | 571 | fs/exec.c | bprm.filename = filename; |
bprm | 572 | fs/exec.c | bprm.loader = 0; |
bprm | 573 | fs/exec.c | bprm.exec = 0; |
bprm | 574 | fs/exec.c | if ((bprm.argc = count(argv)) < 0) |
bprm | 575 | fs/exec.c | return bprm.argc; |
bprm | 576 | fs/exec.c | if ((bprm.envc = count(envp)) < 0) |
bprm | 577 | fs/exec.c | return bprm.envc; |
bprm | 580 | fs/exec.c | if (!S_ISREG(bprm.inode->i_mode)) { /* must be regular file */ |
bprm | 584 | fs/exec.c | if (IS_NOEXEC(bprm.inode)) { /* FS mustn't be mounted noexec */ |
bprm | 588 | fs/exec.c | if (!bprm.inode->i_sb) { |
bprm | 592 | fs/exec.c | i = bprm.inode->i_mode; |
bprm | 593 | fs/exec.c | if (IS_NOSUID(bprm.inode) && (((i & S_ISUID) && bprm.inode->i_uid != current-> |
bprm | 594 | fs/exec.c | euid) || ((i & S_ISGID) && !in_group_p(bprm.inode->i_gid))) && !suser()) { |
bprm | 600 | fs/exec.c | bprm.e_uid = current->euid; |
bprm | 601 | fs/exec.c | bprm.e_gid = current->egid; |
bprm | 603 | fs/exec.c | bprm.e_uid = (i & S_ISUID) ? bprm.inode->i_uid : current->euid; |
bprm | 604 | fs/exec.c | bprm.e_gid = (i & S_ISGID) ? bprm.inode->i_gid : current->egid; |
bprm | 606 | fs/exec.c | if ((retval = permission(bprm.inode, MAY_EXEC)) != 0) |
bprm | 608 | fs/exec.c | if (!(bprm.inode->i_mode & 0111) && fsuser()) { |
bprm | 613 | fs/exec.c | if (bprm.inode->i_wcount > 0) { |
bprm | 617 | fs/exec.c | memset(bprm.buf,0,sizeof(bprm.buf)); |
bprm | 618 | fs/exec.c | retval = read_exec(bprm.inode,0,bprm.buf,128,1); |
bprm | 621 | fs/exec.c | if ((bprm.buf[0] == '#') && (bprm.buf[1] == '!') && (!sh_bang)) { |
bprm | 629 | fs/exec.c | iput(bprm.inode); |
bprm | 630 | fs/exec.c | bprm.buf[127] = '\0'; |
bprm | 631 | fs/exec.c | if ((cp = strchr(bprm.buf, '\n')) == NULL) |
bprm | 632 | fs/exec.c | cp = bprm.buf+127; |
bprm | 634 | fs/exec.c | while (cp > bprm.buf) { |
bprm | 641 | fs/exec.c | for (cp = bprm.buf+2; (*cp == ' ') || (*cp == '\t'); cp++); |
bprm | 661 | fs/exec.c | bprm.p = copy_strings(bprm.envc, envp, bprm.page, bprm.p, 0); |
bprm | 662 | fs/exec.c | bprm.p = copy_strings(--bprm.argc, argv+1, bprm.page, bprm.p, 0); |
bprm | 672 | fs/exec.c | bprm.p = copy_strings(1, &bprm.filename, bprm.page, bprm.p, 2); |
bprm | 673 | fs/exec.c | bprm.argc++; |
bprm | 675 | fs/exec.c | bprm.p = copy_strings(1, &i_arg, bprm.page, bprm.p, 2); |
bprm | 676 | fs/exec.c | bprm.argc++; |
bprm | 678 | fs/exec.c | bprm.p = copy_strings(1, &i_name, bprm.page, bprm.p, 2); |
bprm | 679 | fs/exec.c | bprm.argc++; |
bprm | 680 | fs/exec.c | if (!bprm.p) { |
bprm | 689 | fs/exec.c | retval = open_namei(interp, 0, 0, &bprm.inode, NULL); |
bprm | 695 | fs/exec.c | bprm.p = copy_strings(1, &bprm.filename, bprm.page, bprm.p, 2); |
bprm | 696 | fs/exec.c | bprm.exec = bprm.p; |
bprm | 697 | fs/exec.c | bprm.p = copy_strings(bprm.envc,envp,bprm.page,bprm.p,0); |
bprm | 698 | fs/exec.c | bprm.p = copy_strings(bprm.argc,argv,bprm.page,bprm.p,0); |
bprm | 699 | fs/exec.c | if (!bprm.p) { |
bprm | 705 | fs/exec.c | bprm.sh_bang = sh_bang; |
bprm | 710 | fs/exec.c | retval = fn(&bprm, regs); |
bprm | 712 | fs/exec.c | iput(bprm.inode); |
bprm | 720 | fs/exec.c | iput(bprm.inode); |
bprm | 723 | fs/exec.c | free_page(bprm.page[i]); |
bprm | 743 | fs/exec.c | static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) |
bprm | 749 | fs/exec.c | unsigned long p = bprm->p; |
bprm | 752 | fs/exec.c | ex = *((struct exec *) bprm->buf); /* exec-header */ |
bprm | 756 | fs/exec.c | bprm->inode->i_size < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { |
bprm | 770 | fs/exec.c | (fd_offset < bprm->inode->i_sb->s_blocksize)) { |
bprm | 777 | fs/exec.c | flush_old_exec(bprm); |
bprm | 788 | fs/exec.c | current->suid = current->euid = current->fsuid = bprm->e_uid; |
bprm | 789 | fs/exec.c | current->sgid = current->egid = current->fsgid = bprm->e_gid; |
bprm | 794 | fs/exec.c | read_exec(bprm->inode, 32, (char *) 0, ex.a_text+ex.a_data, 0); |
bprm | 799 | fs/exec.c | fd = open_inode(bprm->inode, O_RDONLY); |
bprm | 809 | fs/exec.c | read_exec(bprm->inode, fd_offset, |
bprm | 849 | fs/exec.c | fd_offset = setup_arg_pages(ex.a_text,bprm->page) - MAX_ARG_PAGES*PAGE_SIZE; |
bprm | 851 | fs/exec.c | if (bprm->loader) |
bprm | 852 | fs/exec.c | bprm->loader += fd_offset; |
bprm | 853 | fs/exec.c | bprm->exec += fd_offset; |
bprm | 855 | fs/exec.c | p = (unsigned long)create_tables((char *)p, bprm, |
bprm | 49 | include/linux/binfmts.h | extern void flush_old_exec(struct linux_binprm * bprm); |
bprm | 51 | include/linux/binfmts.h | extern unsigned long * create_tables(char * p,struct linux_binprm * bprm,int ibcs); |