diff options
author | Tim Yamin <plasmaroo@gentoo.org> | 2004-08-05 19:59:25 +0000 |
---|---|---|
committer | Tim Yamin <plasmaroo@gentoo.org> | 2004-08-05 19:59:25 +0000 |
commit | 9644555eb2f5b7e40cf292187b0b13898c398382 (patch) | |
tree | fcfade6d9e5896f9188b32197638fa73bb9862be /sys-kernel/gentoo-sources | |
parent | Stable on sparc (Manifest recommit) (diff) | |
download | gentoo-2-9644555eb2f5b7e40cf292187b0b13898c398382.tar.gz gentoo-2-9644555eb2f5b7e40cf292187b0b13898c398382.tar.bz2 gentoo-2-9644555eb2f5b7e40cf292187b0b13898c398382.zip |
Compile and ptrace fix for 2.4.19; bug #59500.
Diffstat (limited to 'sys-kernel/gentoo-sources')
-rw-r--r-- | sys-kernel/gentoo-sources/ChangeLog | 6 | ||||
-rw-r--r-- | sys-kernel/gentoo-sources/files/security.patch5 | 571 | ||||
-rw-r--r-- | sys-kernel/gentoo-sources/gentoo-sources-2.4.19-r20.ebuild | 3 |
3 files changed, 578 insertions, 2 deletions
diff --git a/sys-kernel/gentoo-sources/ChangeLog b/sys-kernel/gentoo-sources/ChangeLog index f9534a3881b2..e8dba2122867 100644 --- a/sys-kernel/gentoo-sources/ChangeLog +++ b/sys-kernel/gentoo-sources/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-kernel/gentoo-sources # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/ChangeLog,v 1.84 2004/08/04 22:06:42 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/ChangeLog,v 1.85 2004/08/05 19:59:25 plasmaroo Exp $ + + 05 Aug 2004; <plasmaroo@gentoo.org> gentoo-sources-2.4.19-r20.ebuild, + +files/security.patch5: + Compile and ptrace fix for 2.4.19; bug #59500. *gentoo-sources-2.4.25-r7 (04 Aug 2004) diff --git a/sys-kernel/gentoo-sources/files/security.patch5 b/sys-kernel/gentoo-sources/files/security.patch5 new file mode 100644 index 000000000000..b425186843c9 --- /dev/null +++ b/sys-kernel/gentoo-sources/files/security.patch5 @@ -0,0 +1,571 @@ +diff -Nru a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S +--- a/arch/alpha/kernel/entry.S 2004-08-05 12:52:10 -07:00 ++++ b/arch/alpha/kernel/entry.S 2004-08-05 12:52:10 -07:00 +@@ -231,12 +231,12 @@ + .end kernel_clone + + /* +- * kernel_thread(fn, arg, clone_flags) ++ * arch_kernel_thread(fn, arg, clone_flags) + */ + .align 3 + .globl kernel_thread + .ent kernel_thread +-kernel_thread: ++arch_kernel_thread: + ldgp $29,0($27) /* we can be called from a module */ + .frame $30, 4*8, $26 + subq $30,4*8,$30 +diff -Nru a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c +--- a/arch/arm/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/arm/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -366,7 +366,7 @@ + * a system call from a "real" process, but the process memory space will + * not be free'd until both the parent and the child have exited. + */ +-pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) ++pid_t arch_kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) + { + pid_t __ret; + +diff -Nru a/arch/cris/kernel/entry.S b/arch/cris/kernel/entry.S +--- a/arch/cris/kernel/entry.S 2004-08-05 12:52:10 -07:00 ++++ b/arch/cris/kernel/entry.S 2004-08-05 12:52:10 -07:00 +@@ -739,12 +739,12 @@ + * the grosser the code, at least with the gcc version in cris-dist-1.13. + */ + +-/* int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) */ ++/* int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) */ + /* r10 r11 r12 */ + + .text +- .global kernel_thread +-kernel_thread: ++ .global arch_kernel_thread ++arch_kernel_thread: + + /* Save ARG for later. */ + move.d $r11, $r13 +diff -Nru a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c +--- a/arch/i386/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/i386/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -485,7 +485,7 @@ + /* + * Create a kernel thread + */ +-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) + { + long retval, d0; + +@@ -508,6 +508,7 @@ + "r" (arg), "r" (fn), + "b" (flags | CLONE_VM) + : "memory"); ++ + return retval; + } + +diff -Nru a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c +--- a/arch/ia64/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/ia64/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -230,7 +230,7 @@ + * | | <-- sp (lowest addr) + * +---------------------+ + * +- * Note: if we get called through kernel_thread() then the memory ++ * Note: if we get called through arch_kernel_thread() then the memory + * above "(highest addr)" is valid kernel stack memory that needs to + * be copied as well. + * +@@ -485,7 +485,7 @@ + } + + pid_t +-kernel_thread (int (*fn)(void *), void *arg, unsigned long flags) ++arch_kernel_thread (int (*fn)(void *), void *arg, unsigned long flags) + { + struct task_struct *parent = current; + int result, tid; +diff -Nru a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c +--- a/arch/m68k/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/m68k/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -124,7 +124,7 @@ + /* + * Create a kernel thread + */ +-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) + { + int pid; + mm_segment_t fs; +diff -Nru a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c +--- a/arch/mips/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/mips/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -152,7 +152,7 @@ + /* + * Create a kernel thread + */ +-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) + { + long retval; + +diff -Nru a/arch/mips64/kernel/process.c b/arch/mips64/kernel/process.c +--- a/arch/mips64/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/mips64/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -151,7 +151,7 @@ + /* + * Create a kernel thread + */ +-int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) ++int arch_kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) + { + int retval; + +diff -Nru a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c +--- a/arch/parisc/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/parisc/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -169,7 +169,7 @@ + */ + + extern pid_t __kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); +-pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) ++pid_t arch_kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) + { + + /* +diff -Nru a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S +--- a/arch/ppc/kernel/misc.S 2004-08-05 12:52:10 -07:00 ++++ b/arch/ppc/kernel/misc.S 2004-08-05 12:52:10 -07:00 +@@ -899,9 +899,9 @@ + + /* + * Create a kernel thread +- * kernel_thread(fn, arg, flags) ++ * arch_kernel_thread(fn, arg, flags) + */ +-_GLOBAL(kernel_thread) ++_GLOBAL(arch_kernel_thread) + mr r6,r3 /* function */ + ori r3,r5,CLONE_VM /* flags */ + li r0,__NR_clone +diff -Nru a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S +--- a/arch/ppc64/kernel/misc.S 2004-08-05 12:52:10 -07:00 ++++ b/arch/ppc64/kernel/misc.S 2004-08-05 12:52:10 -07:00 +@@ -481,9 +481,9 @@ + + /* + * Create a kernel thread +- * kernel_thread(fn, arg, flags) ++ * arch_kernel_thread(fn, arg, flags) + */ +-_GLOBAL(kernel_thread) ++_GLOBAL(arch_kernel_thread) + mr r6,r3 /* function */ + ori r3,r5,CLONE_VM /* flags */ + li r0,__NR_clone +diff -Nru a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c +--- a/arch/s390/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/s390/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -105,7 +105,7 @@ + show_trace((unsigned long *) regs->gprs[15]); + } + +-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) + { + int clone_arg = flags | CLONE_VM; + int retval; +diff -Nru a/arch/s390x/kernel/process.c b/arch/s390x/kernel/process.c +--- a/arch/s390x/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/s390x/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -102,7 +102,7 @@ + show_trace((unsigned long *) regs->gprs[15]); + } + +-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) + { + int clone_arg = flags | CLONE_VM; + int retval; +diff -Nru a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c +--- a/arch/sh/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/sh/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -118,7 +118,7 @@ + * This is the mechanism for creating a new kernel thread. + * + */ +-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) + { /* Don't use this in BL=1(cli). Or else, CPU resets! */ + register unsigned long __sc0 __asm__ ("r0"); + register unsigned long __sc3 __asm__ ("r3") = __NR_clone; +diff -Nru a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c +--- a/arch/sparc/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/sparc/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -676,7 +676,7 @@ + * a system call from a "real" process, but the process memory space will + * not be free'd until both the parent and the child have exited. + */ +-pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++pid_t arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) + { + long retval; + +diff -Nru a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c +--- a/arch/sparc64/kernel/process.c 2004-08-05 12:52:10 -07:00 ++++ b/arch/sparc64/kernel/process.c 2004-08-05 12:52:10 -07:00 +@@ -673,7 +673,7 @@ + * a system call from a "real" process, but the process memory space will + * not be free'd until both the parent and the child have exited. + */ +-pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++pid_t arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) + { + long retval; + +diff -Nru a/fs/exec.c b/fs/exec.c +--- a/fs/exec.c 2004-08-05 12:52:10 -07:00 ++++ b/fs/exec.c 2004-08-05 12:52:10 -07:00 +@@ -576,8 +576,10 @@ + + current->sas_ss_sp = current->sas_ss_size = 0; + +- if (current->euid == current->uid && current->egid == current->gid) ++ if (current->euid == current->uid && current->egid == current->gid) { + current->mm->dumpable = 1; ++ current->task_dumpable = 1; ++ } + name = bprm->filename; + for (i=0; (ch = *(name++)) != '\0';) { + if (ch == '/') +@@ -1085,7 +1087,7 @@ + binfmt = current->binfmt; + if (!binfmt || !binfmt->core_dump) + goto fail; +- if (!current->mm->dumpable) ++ if (!is_dumpable(current)) + goto fail; + current->mm->dumpable = 0; + if (current->rlim[RLIMIT_CORE].rlim_cur < binfmt->min_coredump) +diff -Nru a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h +--- a/include/asm-alpha/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-alpha/processor.h 2004-08-05 12:52:10 -07:00 +@@ -119,7 +119,7 @@ + extern void release_thread(struct task_struct *); + + /* Create a kernel thread without removing it from tasklists. */ +-extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); ++extern long arch_kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); + + #define copy_segments(tsk, mm) do { } while (0) + #define release_segments(mm) do { } while (0) +diff -Nru a/include/asm-arm/processor.h b/include/asm-arm/processor.h +--- a/include/asm-arm/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-arm/processor.h 2004-08-05 12:52:10 -07:00 +@@ -117,7 +117,7 @@ + /* + * Create a new kernel thread + */ +-extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); ++extern int arch_kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); + + #endif + +diff -Nru a/include/asm-cris/processor.h b/include/asm-cris/processor.h +--- a/include/asm-cris/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-cris/processor.h 2004-08-05 12:52:10 -07:00 +@@ -81,7 +81,7 @@ + #define INIT_THREAD { \ + 0, 0, 0x20 } /* ccr = int enable, nothing else */ + +-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + /* give the thread a program location + * set user-mode (The 'U' flag (User mode flag) is CCR/DCCR bit 8) +diff -Nru a/include/asm-i386/processor.h b/include/asm-i386/processor.h +--- a/include/asm-i386/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-i386/processor.h 2004-08-05 12:52:10 -07:00 +@@ -433,7 +433,7 @@ + /* + * create a kernel thread without removing it from tasklists + */ +-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + /* Copy and release all segment info associated with a VM */ + extern void copy_segments(struct task_struct *p, struct mm_struct * mm); +diff -Nru a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h +--- a/include/asm-ia64/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-ia64/processor.h 2004-08-05 12:52:10 -07:00 +@@ -372,7 +372,7 @@ + * do_basic_setup() and the timing is such that free_initmem() has + * been called already. + */ +-extern int kernel_thread (int (*fn)(void *), void *arg, unsigned long flags); ++extern int arch_kernel_thread (int (*fn)(void *), void *arg, unsigned long flags); + + /* Copy and release all segment info associated with a VM */ + #define copy_segments(tsk, mm) do { } while (0) +diff -Nru a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h +--- a/include/asm-m68k/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-m68k/processor.h 2004-08-05 12:52:10 -07:00 +@@ -105,7 +105,7 @@ + { + } + +-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + #define copy_segments(tsk, mm) do { } while (0) + #define release_segments(mm) do { } while (0) +diff -Nru a/include/asm-mips/processor.h b/include/asm-mips/processor.h +--- a/include/asm-mips/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-mips/processor.h 2004-08-05 12:52:10 -07:00 +@@ -188,7 +188,7 @@ + /* Free all resources held by a thread. */ + #define release_thread(thread) do { } while(0) + +-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + /* Copy and release all segment info associated with a VM */ + #define copy_segments(p, mm) do { } while(0) +diff -Nru a/include/asm-mips64/processor.h b/include/asm-mips64/processor.h +--- a/include/asm-mips64/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-mips64/processor.h 2004-08-05 12:52:10 -07:00 +@@ -231,7 +231,7 @@ + /* Free all resources held by a thread. */ + #define release_thread(thread) do { } while(0) + +-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + /* Copy and release all segment info associated with a VM */ + #define copy_segments(p, mm) do { } while(0) +diff -Nru a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h +--- a/include/asm-parisc/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-parisc/processor.h 2004-08-05 12:52:10 -07:00 +@@ -292,7 +292,7 @@ + + /* Free all resources held by a thread. */ + extern void release_thread(struct task_struct *); +-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + extern void map_hpux_gateway_page(struct task_struct *tsk, struct mm_struct *mm); + +diff -Nru a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h +--- a/include/asm-ppc/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-ppc/processor.h 2004-08-05 12:52:10 -07:00 +@@ -622,7 +622,7 @@ + /* + * Create a new kernel thread. + */ +-extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); ++extern long arch_kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); + + /* + * Bus types +diff -Nru a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h +--- a/include/asm-ppc64/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-ppc64/processor.h 2004-08-05 12:52:10 -07:00 +@@ -602,7 +602,7 @@ + /* + * Create a new kernel thread. + */ +-extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); ++extern long arch_kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); + + /* + * Bus types +diff -Nru a/include/asm-s390/processor.h b/include/asm-s390/processor.h +--- a/include/asm-s390/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-s390/processor.h 2004-08-05 12:52:10 -07:00 +@@ -113,7 +113,7 @@ + + /* Free all resources held by a thread. */ + extern void release_thread(struct task_struct *); +-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + /* Copy and release all segment info associated with a VM */ + #define copy_segments(nr, mm) do { } while (0) +diff -Nru a/include/asm-s390x/processor.h b/include/asm-s390x/processor.h +--- a/include/asm-s390x/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-s390x/processor.h 2004-08-05 12:52:10 -07:00 +@@ -128,7 +128,7 @@ + + /* Free all resources held by a thread. */ + extern void release_thread(struct task_struct *); +-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + /* Copy and release all segment info associated with a VM */ + #define copy_segments(nr, mm) do { } while (0) +diff -Nru a/include/asm-sh/processor.h b/include/asm-sh/processor.h +--- a/include/asm-sh/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-sh/processor.h 2004-08-05 12:52:10 -07:00 +@@ -137,7 +137,7 @@ + /* + * create a kernel thread without removing it from tasklists + */ +-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern int arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + /* + * Bus types +diff -Nru a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h +--- a/include/asm-sparc/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-sparc/processor.h 2004-08-05 12:52:10 -07:00 +@@ -146,7 +146,7 @@ + + /* Free all resources held by a thread. */ + #define release_thread(tsk) do { } while(0) +-extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern pid_t arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + + #define copy_segments(tsk, mm) do { } while (0) +diff -Nru a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h +--- a/include/asm-sparc64/processor.h 2004-08-05 12:52:10 -07:00 ++++ b/include/asm-sparc64/processor.h 2004-08-05 12:52:10 -07:00 +@@ -270,7 +270,7 @@ + /* Free all resources held by a thread. */ + #define release_thread(tsk) do { } while(0) + +-extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ++extern pid_t arch_kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + #define copy_segments(tsk, mm) do { } while (0) + #define release_segments(mm) do { } while (0) +diff -Nru a/include/linux/sched.h b/include/linux/sched.h +--- a/include/linux/sched.h 2004-08-05 12:52:10 -07:00 ++++ b/include/linux/sched.h 2004-08-05 12:52:10 -07:00 +@@ -345,6 +345,7 @@ + /* ??? */ + unsigned long personality; + int did_exec:1; ++ unsigned task_dumpable:1; + pid_t pid; + pid_t pgrp; + pid_t tty_old_pgrp; +@@ -454,6 +455,8 @@ + #define PT_TRACESYSGOOD 0x00000008 + #define PT_PTRACE_CAP 0x00000010 /* ptracer can follow suid-exec */ + ++#define is_dumpable(tsk) ((tsk)->task_dumpable && (tsk)->mm->dumpable) ++ + /* + * Limit the stack by to some sane default: root can always + * increase this limit if needed.. 8MB seems reasonable. +@@ -808,6 +811,8 @@ + extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); + extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)); + extern void FASTCALL(remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); ++ ++extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + + #define __wait_event(wq, condition) \ + do { \ +diff -Nru a/kernel/fork.c b/kernel/fork.c +--- a/kernel/fork.c 2004-08-05 12:52:10 -07:00 ++++ b/kernel/fork.c 2004-08-05 12:52:10 -07:00 +@@ -27,6 +27,7 @@ + #include <asm/pgalloc.h> + #include <asm/uaccess.h> + #include <asm/mmu_context.h> ++#include <asm/processor.h> + + /* The idle threads do not count.. */ + int nr_threads; +@@ -563,6 +564,31 @@ + if (!(clone_flags & CLONE_PTRACE)) + p->ptrace = 0; + p->flags = new_flags; ++} ++ ++long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ++{ ++ struct task_struct *task = current; ++ unsigned old_task_dumpable; ++ long ret; ++ ++ /* lock out any potential ptracer */ ++ task_lock(task); ++ if (task->ptrace) { ++ task_unlock(task); ++ return -EPERM; ++ } ++ ++ old_task_dumpable = task->task_dumpable; ++ task->task_dumpable = 0; ++ task_unlock(task); ++ ++ ret = arch_kernel_thread(fn, arg, flags); ++ ++ /* never reached in child process, only in parent */ ++ current->task_dumpable = old_task_dumpable; ++ ++ return ret; + } + + /* +diff -Nru a/kernel/ptrace.c b/kernel/ptrace.c +--- a/kernel/ptrace.c 2004-08-05 12:52:10 -07:00 ++++ b/kernel/ptrace.c 2004-08-05 12:52:10 -07:00 +@@ -21,6 +21,10 @@ + */ + int ptrace_check_attach(struct task_struct *child, int kill) + { ++ mb(); ++ if (!is_dumpable(child)) ++ return -EPERM; ++ + if (!(child->ptrace & PT_PTRACED)) + return -ESRCH; + +@@ -70,7 +74,7 @@ + (current->gid != task->gid)) && !capable(CAP_SYS_PTRACE)) + goto bad; + rmb(); +- if (!task->mm->dumpable && !capable(CAP_SYS_PTRACE)) ++ if (!is_dumpable(task) && !capable(CAP_SYS_PTRACE)) + goto bad; + /* the same process cannot be attached many times */ + if (task->ptrace & PT_PTRACED) +@@ -136,6 +140,8 @@ + /* Worry about races with exit() */ + task_lock(tsk); + mm = tsk->mm; ++ if (!is_dumpable(tsk) || (&init_mm == mm)) ++ mm = NULL; + if (mm) + atomic_inc(&mm->mm_users); + task_unlock(tsk); +diff -Nru a/kernel/sys.c b/kernel/sys.c +--- a/kernel/sys.c 2004-08-05 12:52:10 -07:00 ++++ b/kernel/sys.c 2004-08-05 12:52:10 -07:00 +@@ -1238,7 +1238,7 @@ + error = put_user(current->pdeath_signal, (int *)arg2); + break; + case PR_GET_DUMPABLE: +- if (current->mm->dumpable) ++ if (is_dumpable(current)) + error = 1; + break; + case PR_SET_DUMPABLE: +@@ -1246,7 +1246,8 @@ + error = -EINVAL; + break; + } +- current->mm->dumpable = arg2; ++ if (is_dumpable(current)) ++ current->mm->dumpable = arg2; + break; + + case PR_SET_UNALIGN: + diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.4.19-r20.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.4.19-r20.ebuild index df453591cd0a..c23dc9804b00 100644 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.4.19-r20.ebuild +++ b/sys-kernel/gentoo-sources/gentoo-sources-2.4.19-r20.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.4.19-r20.ebuild,v 1.1 2004/08/04 22:06:42 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.4.19-r20.ebuild,v 1.2 2004/08/05 19:59:25 plasmaroo Exp $ IUSE="acpi4linux crypt xfs" @@ -67,6 +67,7 @@ src_unpack() { epatch ${FILESDIR}/security.patch2 epatch ${FILESDIR}/security.patch3 epatch ${FILESDIR}/security.patch4 + epatch ${FILESDIR}/security.patch5 epatch ${FILESDIR}/lcall-DoS.patch || die "lcall-DoS patch failed" epatch ${FILESDIR}/i810_drm.patch || die "i810_drm patch failed" |