Lines Matching refs:bprm
123 static int create_flat_tables(struct linux_binprm *bprm, unsigned long arg_start)
132 sp -= bprm->envc + 1;
133 sp -= bprm->argc + 1;
141 if (put_user(bprm->argc, sp++))
146 envp = (unsigned long)(sp + 2 + bprm->argc + 1);
152 for (i = bprm->argc; i > 0; i--) {
165 for (i = bprm->envc; i > 0; i--) {
197 static int decompress_exec(struct linux_binprm *bprm, loff_t fpos, char *dst,
218 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos);
288 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos);
454 static int load_flat_file(struct linux_binprm *bprm,
469 hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */
497 pr_info("Loading file: %s\n", bprm->filename);
566 ret = begin_new_exec(bprm);
572 setup_new_exec(bprm);
593 textpos = vm_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC,
627 result = decompress_exec(bprm, fpos, (char *)datapos,
632 result = read_code(bprm->file, datapos, fpos,
678 result = decompress_exec(bprm, sizeof(struct flat_hdr),
696 result = decompress_exec(bprm, sizeof(struct flat_hdr),
708 result = read_code(bprm->file, textpos, 0, text_len);
711 result = decompress_exec(bprm, text_len, (char *) datapos,
718 result = decompress_exec(bprm, text_len,
731 result = read_code(bprm->file, textpos, 0, text_len);
733 result = read_code(bprm->file, datapos,
774 id ? "Lib" : "Load", bprm->filename,
917 * This is a fake bprm struct; only the members "buf", "file" and
920 struct linux_binprm bprm;
925 memset(&bprm, 0, sizeof(bprm));
931 bprm.filename = buf;
932 bprm.file = open_exec(bprm.filename);
933 res = PTR_ERR(bprm.file);
934 if (IS_ERR(bprm.file))
937 res = kernel_read(bprm.file, bprm.buf, BINPRM_BUF_SIZE, &pos);
940 res = load_flat_file(&bprm, libs, id, NULL);
942 allow_write_access(bprm.file);
943 fput(bprm.file);
956 static int load_flat_binary(struct linux_binprm *bprm)
975 stack_len += PAGE_SIZE * MAX_ARG_PAGES - bprm->p; /* the strings */
977 stack_len += (bprm->argc + 1) * sizeof(char *); /* the argv array */
978 stack_len += (bprm->envc + 1) * sizeof(char *); /* the envp array */
981 res = load_flat_file(bprm, &libinfo, 0, &stack_len);
1003 res = setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT);
1005 res = create_flat_tables(bprm, bprm->p);
1013 res = transfer_args_to_stack(bprm, ¤t->mm->start_stack);
1015 res = create_flat_tables(bprm, current->mm->start_stack);
1044 finalize_exec(bprm);