diff options
Diffstat (limited to 'fs/binfmt_aout.c')
-rw-r--r-- | fs/binfmt_aout.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index 813a887cd2b3..e176d195e7e5 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs); | 32 | static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs); |
33 | static int load_aout_library(struct file*); | 33 | static int load_aout_library(struct file*); |
34 | static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file); | 34 | static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, unsigned long limit); |
35 | 35 | ||
36 | static struct linux_binfmt aout_format = { | 36 | static struct linux_binfmt aout_format = { |
37 | .module = THIS_MODULE, | 37 | .module = THIS_MODULE, |
@@ -88,7 +88,7 @@ if (file->f_op->llseek) { \ | |||
88 | * dumping of the process results in another error.. | 88 | * dumping of the process results in another error.. |
89 | */ | 89 | */ |
90 | 90 | ||
91 | static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file) | 91 | static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, unsigned long limit) |
92 | { | 92 | { |
93 | mm_segment_t fs; | 93 | mm_segment_t fs; |
94 | int has_dumped = 0; | 94 | int has_dumped = 0; |
@@ -123,23 +123,19 @@ static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file) | |||
123 | /* If the size of the dump file exceeds the rlimit, then see what would happen | 123 | /* If the size of the dump file exceeds the rlimit, then see what would happen |
124 | if we wrote the stack, but not the data area. */ | 124 | if we wrote the stack, but not the data area. */ |
125 | #ifdef __sparc__ | 125 | #ifdef __sparc__ |
126 | if ((dump.u_dsize+dump.u_ssize) > | 126 | if ((dump.u_dsize + dump.u_ssize) > limit) |
127 | current->signal->rlim[RLIMIT_CORE].rlim_cur) | ||
128 | dump.u_dsize = 0; | 127 | dump.u_dsize = 0; |
129 | #else | 128 | #else |
130 | if ((dump.u_dsize+dump.u_ssize+1) * PAGE_SIZE > | 129 | if ((dump.u_dsize + dump.u_ssize+1) * PAGE_SIZE > limit) |
131 | current->signal->rlim[RLIMIT_CORE].rlim_cur) | ||
132 | dump.u_dsize = 0; | 130 | dump.u_dsize = 0; |
133 | #endif | 131 | #endif |
134 | 132 | ||
135 | /* Make sure we have enough room to write the stack and data areas. */ | 133 | /* Make sure we have enough room to write the stack and data areas. */ |
136 | #ifdef __sparc__ | 134 | #ifdef __sparc__ |
137 | if ((dump.u_ssize) > | 135 | if (dump.u_ssize > limit) |
138 | current->signal->rlim[RLIMIT_CORE].rlim_cur) | ||
139 | dump.u_ssize = 0; | 136 | dump.u_ssize = 0; |
140 | #else | 137 | #else |
141 | if ((dump.u_ssize+1) * PAGE_SIZE > | 138 | if ((dump.u_ssize + 1) * PAGE_SIZE > limit) |
142 | current->signal->rlim[RLIMIT_CORE].rlim_cur) | ||
143 | dump.u_ssize = 0; | 139 | dump.u_ssize = 0; |
144 | #endif | 140 | #endif |
145 | 141 | ||