diff options
Diffstat (limited to 'include/linux/binfmts.h')
-rw-r--r-- | include/linux/binfmts.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index a0b209cd5761..91c8c07fe8b7 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -6,11 +6,13 @@ | |||
6 | struct pt_regs; | 6 | struct pt_regs; |
7 | 7 | ||
8 | /* | 8 | /* |
9 | * MAX_ARG_PAGES defines the number of pages allocated for arguments | 9 | * These are the maximum length and maximum number of strings passed to the |
10 | * and envelope for the new program. 32 should suffice, this gives | 10 | * execve() system call. MAX_ARG_STRLEN is essentially random but serves to |
11 | * a maximum env+arg of 128kB w/4KB pages! | 11 | * prevent the kernel from being unduly impacted by misaddressed pointers. |
12 | * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer. | ||
12 | */ | 13 | */ |
13 | #define MAX_ARG_PAGES 32 | 14 | #define MAX_ARG_STRLEN (PAGE_SIZE * 32) |
15 | #define MAX_ARG_STRINGS 0x7FFFFFFF | ||
14 | 16 | ||
15 | /* sizeof(linux_binprm->buf) */ | 17 | /* sizeof(linux_binprm->buf) */ |
16 | #define BINPRM_BUF_SIZE 128 | 18 | #define BINPRM_BUF_SIZE 128 |
@@ -24,7 +26,12 @@ struct pt_regs; | |||
24 | */ | 26 | */ |
25 | struct linux_binprm{ | 27 | struct linux_binprm{ |
26 | char buf[BINPRM_BUF_SIZE]; | 28 | char buf[BINPRM_BUF_SIZE]; |
29 | #ifdef CONFIG_MMU | ||
30 | struct vm_area_struct *vma; | ||
31 | #else | ||
32 | # define MAX_ARG_PAGES 32 | ||
27 | struct page *page[MAX_ARG_PAGES]; | 33 | struct page *page[MAX_ARG_PAGES]; |
34 | #endif | ||
28 | struct mm_struct *mm; | 35 | struct mm_struct *mm; |
29 | unsigned long p; /* current top of mem */ | 36 | unsigned long p; /* current top of mem */ |
30 | int sh_bang; | 37 | int sh_bang; |
@@ -69,7 +76,7 @@ extern int register_binfmt(struct linux_binfmt *); | |||
69 | extern int unregister_binfmt(struct linux_binfmt *); | 76 | extern int unregister_binfmt(struct linux_binfmt *); |
70 | 77 | ||
71 | extern int prepare_binprm(struct linux_binprm *); | 78 | extern int prepare_binprm(struct linux_binprm *); |
72 | extern void remove_arg_zero(struct linux_binprm *); | 79 | extern int __must_check remove_arg_zero(struct linux_binprm *); |
73 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); | 80 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); |
74 | extern int flush_old_exec(struct linux_binprm * bprm); | 81 | extern int flush_old_exec(struct linux_binprm * bprm); |
75 | 82 | ||
@@ -86,6 +93,7 @@ extern int suid_dumpable; | |||
86 | extern int setup_arg_pages(struct linux_binprm * bprm, | 93 | extern int setup_arg_pages(struct linux_binprm * bprm, |
87 | unsigned long stack_top, | 94 | unsigned long stack_top, |
88 | int executable_stack); | 95 | int executable_stack); |
96 | extern int bprm_mm_init(struct linux_binprm *bprm); | ||
89 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | 97 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); |
90 | extern void compute_creds(struct linux_binprm *binprm); | 98 | extern void compute_creds(struct linux_binprm *binprm); |
91 | extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); | 99 | extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); |