diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-06-19 22:45:37 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-06-19 22:45:37 +0000 |
commit | 6d403070f28cd44860fdb3a53be5da0275c65cf4 (patch) | |
tree | 0d0e7fe7b5fb7568d19e11d7d862b77a866ce081 /arch/sparc64/kernel | |
parent | ecf1bf5f6c2e668d03b0a9fb026db7aa41e292e1 (diff) |
Merge with 2.4.0-test1-ac21 + pile of MIPS cleanups to make merging
possible. Chainsawed RM200 kernel to compile again. Jazz machine
status unknown.
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r-- | arch/sparc64/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/binfmt_aout32.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/ioctl32.c | 12 | ||||
-rw-r--r-- | arch/sparc64/kernel/iommu_common.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/signal.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/signal32.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/sys_sparc.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/sys_sparc32.c | 7 | ||||
-rw-r--r-- | arch/sparc64/kernel/sys_sunos32.c | 4 |
9 files changed, 24 insertions, 17 deletions
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile index df823619c..d861c41c0 100644 --- a/arch/sparc64/kernel/Makefile +++ b/arch/sparc64/kernel/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.54 2000/05/12 23:51:24 davem Exp $ +# $Id: Makefile,v 1.55 2000/05/27 00:49:35 davem Exp $ # Makefile for the linux kernel. # # Note! Dependencies are done automagically by 'make dep', which also diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c index 9cc240293..446072933 100644 --- a/arch/sparc64/kernel/binfmt_aout32.c +++ b/arch/sparc64/kernel/binfmt_aout32.c @@ -277,20 +277,24 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs) goto beyond_if; } + down(¤t->mm->mmap_sem); error = do_mmap(bprm->file, N_TXTADDR(ex), ex.a_text, PROT_READ | PROT_EXEC, MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE, fd_offset); + up(¤t->mm->mmap_sem); if (error != N_TXTADDR(ex)) { send_sig(SIGKILL, current, 0); return error; } + down(¤t->mm->mmap_sem); error = do_mmap(bprm->file, N_DATADDR(ex), ex.a_data, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE, fd_offset + ex.a_text); + up(¤t->mm->mmap_sem); if (error != N_DATADDR(ex)) { send_sig(SIGKILL, current, 0); return error; diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index 9f5626b5b..c424722a5 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c @@ -1,4 +1,4 @@ -/* $Id: ioctl32.c,v 1.91 2000/05/23 05:25:44 davem Exp $ +/* $Id: ioctl32.c,v 1.92 2000/05/26 22:44:11 davem Exp $ * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com) @@ -2442,8 +2442,8 @@ out: } typedef struct drm32_unique { - size_t unique_len; /* Length of unique */ - u32 unique; /* Unique name for driver instantiation */ + int unique_len; /* Length of unique */ + u32 unique; /* Unique name for driver instantiation */ } drm32_unique_t; #define DRM32_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm32_unique_t) #define DRM32_IOCTL_SET_UNIQUE DRM_IOW( 0x10, drm32_unique_t) @@ -2487,13 +2487,15 @@ static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long a if (!ret) { if (cmd == DRM32_IOCTL_GET_UNIQUE && + uptr != NULL && copy_to_user(uptr, karg.unique, karg.unique_len)) ret = -EFAULT; if (put_user(karg.unique_len, &uarg->unique_len)) ret = -EFAULT; } - kfree(karg.unique); + if (karg.unique != NULL) + kfree(karg.unique); return ret; } @@ -2836,7 +2838,7 @@ typedef struct drm32_ctx_res { int count; u32 contexts; /* (drm_ctx_t *) */ } drm32_ctx_res_t; -#define DRM32_IOCTL_RES_CTX DRM_IOWR(0x26, drm_ctx_res_t) +#define DRM32_IOCTL_RES_CTX DRM_IOWR(0x26, drm32_ctx_res_t) static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg) { diff --git a/arch/sparc64/kernel/iommu_common.c b/arch/sparc64/kernel/iommu_common.c index 27aa136ff..acb3b4192 100644 --- a/arch/sparc64/kernel/iommu_common.c +++ b/arch/sparc64/kernel/iommu_common.c @@ -1,4 +1,4 @@ -/* $Id: iommu_common.c,v 1.3 2000/01/28 13:41:59 jj Exp $ +/* $Id: iommu_common.c,v 1.4 2000/06/04 21:50:23 anton Exp $ * iommu_common.c: UltraSparc SBUS/PCI common iommu code. * * Copyright (C) 1999 David S. Miller (davem@redhat.com) @@ -45,7 +45,7 @@ int verify_lengths(struct scatterlist *sg, int nents, int npages) } if (pgcount != npages) { - printk("verify_langths: Error, page count wrong, " + printk("verify_lengths: Error, page count wrong, " "npages[%d] pgcount[%d]\n", npages, pgcount); return -1; diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c index f893e7f3a..e833488f4 100644 --- a/arch/sparc64/kernel/signal.c +++ b/arch/sparc64/kernel/signal.c @@ -1,4 +1,4 @@ -/* $Id: signal.c,v 1.49 2000/04/08 02:11:46 davem Exp $ +/* $Id: signal.c,v 1.50 2000/05/27 00:49:35 davem Exp $ * arch/sparc64/kernel/signal.c * * Copyright (C) 1991, 1992 Linus Torvalds diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c index f908b0636..a73fd72e3 100644 --- a/arch/sparc64/kernel/signal32.c +++ b/arch/sparc64/kernel/signal32.c @@ -1,4 +1,4 @@ -/* $Id: signal32.c,v 1.62 2000/04/12 08:10:19 davem Exp $ +/* $Id: signal32.c,v 1.63 2000/05/27 00:49:35 davem Exp $ * arch/sparc64/kernel/signal32.c * * Copyright (C) 1991, 1992 Linus Torvalds diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c index c48a0a52d..f381e244f 100644 --- a/arch/sparc64/kernel/sys_sparc.c +++ b/arch/sparc64/kernel/sys_sparc.c @@ -227,7 +227,6 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, len = PAGE_ALIGN(len); retval = -EINVAL; - down(¤t->mm->mmap_sem); lock_kernel(); if (current->thread.flags & SPARC_FLAG_32BIT) { @@ -241,11 +240,12 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, goto out_putf; } + down(¤t->mm->mmap_sem); retval = do_mmap(file, addr, len, prot, flags, off); + up(¤t->mm->mmap_sem); out_putf: unlock_kernel(); - up(¤t->mm->mmap_sem); if (file) fput(file); out: diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c index db6d2b4d0..ae6fbdc77 100644 --- a/arch/sparc64/kernel/sys_sparc32.c +++ b/arch/sparc64/kernel/sys_sparc32.c @@ -1,4 +1,4 @@ -/* $Id: sys_sparc32.c,v 1.147 2000/05/22 07:29:40 davem Exp $ +/* $Id: sys_sparc32.c,v 1.148 2000/05/27 00:49:35 davem Exp $ * sys_sparc32.c: Conversion between 32bit and 64bit native syscalls. * * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -3028,9 +3028,7 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs) bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); memset(bprm.page, 0, MAX_ARG_PAGES * sizeof(bprm.page[0])); - lock_kernel(); file = open_exec(filename); - unlock_kernel(); retval = PTR_ERR(file); if (IS_ERR(file)) @@ -3042,10 +3040,12 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs) bprm.loader = 0; bprm.exec = 0; if ((bprm.argc = count32(argv)) < 0) { + allow_write_access(file); fput(file); return bprm.argc; } if ((bprm.envc = count32(envp)) < 0) { + allow_write_access(file); fput(file); return bprm.envc; } @@ -3074,6 +3074,7 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs) out: /* Something went wrong, return the inode and free the argument pages*/ + allow_write_access(bprm.file); if (bprm.file) fput(bprm.file); diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index 7aeb4781f..c9802377d 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c @@ -68,7 +68,6 @@ asmlinkage u32 sunos_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u32 of struct file *file = NULL; unsigned long retval, ret_type; - down(¤t->mm->mmap_sem); lock_kernel(); if(flags & MAP_NORESERVE) { static int cnt; @@ -102,10 +101,12 @@ asmlinkage u32 sunos_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u32 of flags &= ~_MAP_NEW; flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); + down(¤t->mm->mmap_sem); retval = do_mmap(file, (unsigned long) addr, (unsigned long) len, (unsigned long) prot, (unsigned long) flags, (unsigned long) off); + up(¤t->mm->mmap_sem); if(!ret_type) retval = ((retval < 0xf0000000) ? 0 : retval); out_putf: @@ -113,7 +114,6 @@ out_putf: fput(file); out: unlock_kernel(); - up(¤t->mm->mmap_sem); return (u32) retval; } |