aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 11:18:34 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 11:18:34 -0400
commit5a96c5d0c58ead9a0ece03ffe1c116dea6dafe9c (patch)
tree17199c2c536f25a2b34e37045e9f7619a2dcbb3d /fs
parent13bbd8d90647132fc295d73b122567eb8987d298 (diff)
parent5f024a251f0b3b179bbc8fc62f3a650e49359db5 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/willy/parisc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/willy/parisc-2.6: (41 commits) [PARISC] Kill wall_jiffies use [PARISC] Honour "panic_on_oops" sysctl [PARISC] Fix fs/binfmt_som.c [PARISC] Export clear_user_page to modules [PARISC] Make DMA routines more stubby [PARISC] Define pci_get_legacy_ide_irq [PARISC] Fix CONFIG_DEBUG_SPINLOCK [PARISC] Fix HPUX compat compile with current GCC [PARISC] Fix iounmap compile warning [PARISC] Add support for Quicksilver AGPGART [PARISC] Move LBA and SBA register defines to the common ropes.h [PARISC] Create shared <asm/ropes.h> header [PARISC] Stash the lba_device in its struct device drvdata [PARISC] Generalize IS_ASTRO et al to take a parisc_device like [PARISC] Pretty print the name of the lba type on kernel boot [PARISC] Remove some obsolete comments and I checked that Reo is similar to Ike [PARISC] Add hardware found in the rp8400 [PARISC] Allow nested interrupts [PARISC] Further updates to timer_interrupt() [PARISC] remove halftick and copy clocktick to local var (gcc can optimize usage) ...
Diffstat (limited to 'fs')
-rw-r--r--fs/binfmt_som.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/binfmt_som.c b/fs/binfmt_som.c
index 32b5d625ce9c..5bcdaaf4eae0 100644
--- a/fs/binfmt_som.c
+++ b/fs/binfmt_som.c
@@ -29,6 +29,7 @@
29#include <linux/personality.h> 29#include <linux/personality.h>
30#include <linux/init.h> 30#include <linux/init.h>
31 31
32#include <asm/a.out.h>
32#include <asm/uaccess.h> 33#include <asm/uaccess.h>
33#include <asm/pgtable.h> 34#include <asm/pgtable.h>
34 35
@@ -194,6 +195,7 @@ load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs)
194 unsigned long som_entry; 195 unsigned long som_entry;
195 struct som_hdr *som_ex; 196 struct som_hdr *som_ex;
196 struct som_exec_auxhdr *hpuxhdr; 197 struct som_exec_auxhdr *hpuxhdr;
198 struct files_struct *files;
197 199
198 /* Get the exec-header */ 200 /* Get the exec-header */
199 som_ex = (struct som_hdr *) bprm->buf; 201 som_ex = (struct som_hdr *) bprm->buf;
@@ -208,15 +210,27 @@ load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs)
208 size = som_ex->aux_header_size; 210 size = som_ex->aux_header_size;
209 if (size > SOM_PAGESIZE) 211 if (size > SOM_PAGESIZE)
210 goto out; 212 goto out;
211 hpuxhdr = (struct som_exec_auxhdr *) kmalloc(size, GFP_KERNEL); 213 hpuxhdr = kmalloc(size, GFP_KERNEL);
212 if (!hpuxhdr) 214 if (!hpuxhdr)
213 goto out; 215 goto out;
214 216
215 retval = kernel_read(bprm->file, som_ex->aux_header_location, 217 retval = kernel_read(bprm->file, som_ex->aux_header_location,
216 (char *) hpuxhdr, size); 218 (char *) hpuxhdr, size);
219 if (retval != size) {
220 if (retval >= 0)
221 retval = -EIO;
222 goto out_free;
223 }
224
225 files = current->files; /* Refcounted so ok */
226 retval = unshare_files();
217 if (retval < 0) 227 if (retval < 0)
218 goto out_free; 228 goto out_free;
219#error "Fix security hole before enabling me" 229 if (files == current->files) {
230 put_files_struct(files);
231 files = NULL;
232 }
233
220 retval = get_unused_fd(); 234 retval = get_unused_fd();
221 if (retval < 0) 235 if (retval < 0)
222 goto out_free; 236 goto out_free;