From 47bf75af4c6f6c45f23ad0a5160a99b170d3e09a Mon Sep 17 00:00:00 2001 From: Guy Martin Date: Mon, 9 Aug 2004 23:24:56 +0000 Subject: Fixed race condition in /proc//cmdline (#59905). --- sys-kernel/hppa-sources/ChangeLog | 6 +++++- .../hppa-sources/files/security-proc-cmdline.patch | 24 ++++++++++++++++++++++ .../hppa-sources/hppa-sources-2.4.26_p7-r1.ebuild | 3 ++- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 sys-kernel/hppa-sources/files/security-proc-cmdline.patch (limited to 'sys-kernel/hppa-sources') diff --git a/sys-kernel/hppa-sources/ChangeLog b/sys-kernel/hppa-sources/ChangeLog index d1d0de14f856..f3d29ec5f1b3 100644 --- a/sys-kernel/hppa-sources/ChangeLog +++ b/sys-kernel/hppa-sources/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-kernel/hppa-sources # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/hppa-sources/ChangeLog,v 1.42 2004/08/09 22:50:22 gmsoft Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/hppa-sources/ChangeLog,v 1.43 2004/08/09 23:24:56 gmsoft Exp $ + + 09 Aug 2004; Guy Martin + +files/security-proc-cmdline.patch, hppa-sources-2.4.26_p7-r1.ebuild: + Fixed race condition in /proc//cmdline (#59905). *hppa-sources-2.4.26_p7-r1 (09 Aug 2004) diff --git a/sys-kernel/hppa-sources/files/security-proc-cmdline.patch b/sys-kernel/hppa-sources/files/security-proc-cmdline.patch new file mode 100644 index 000000000000..bb80884c394e --- /dev/null +++ b/sys-kernel/hppa-sources/files/security-proc-cmdline.patch @@ -0,0 +1,24 @@ + +From: Roger Luethi + +If you win the race with a starting process, you can read its environment. + +Signed-off-by: Andrew Morton +--- + + 25-akpm/fs/proc/base.c | 2 ++ + 1 files changed, 2 insertions(+) + +diff -puN fs/proc/base.c~proc_pid_cmdline-race-fix fs/proc/base.c +--- 25/fs/proc/base.c~proc_pid_cmdline-race-fix 2004-08-05 11:28:21.915442360 -0700 ++++ 25-akpm/fs/proc/base.c 2004-08-05 11:28:21.919441752 -0700 +@@ -340,6 +340,8 @@ static int proc_pid_cmdline(struct task_ + struct mm_struct *mm = get_task_mm(task); + if (!mm) + goto out; ++ if (!mm->arg_end) ++ goto out; /* Shh! No looking before we're done */ + + len = mm->arg_end - mm->arg_start; + +_ diff --git a/sys-kernel/hppa-sources/hppa-sources-2.4.26_p7-r1.ebuild b/sys-kernel/hppa-sources/hppa-sources-2.4.26_p7-r1.ebuild index f43ad0af245b..7ebdbadffe51 100644 --- a/sys-kernel/hppa-sources/hppa-sources-2.4.26_p7-r1.ebuild +++ b/sys-kernel/hppa-sources/hppa-sources-2.4.26_p7-r1.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/hppa-sources/hppa-sources-2.4.26_p7-r1.ebuild,v 1.1 2004/08/09 22:50:22 gmsoft Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/hppa-sources/hppa-sources-2.4.26_p7-r1.ebuild,v 1.2 2004/08/09 23:24:56 gmsoft Exp $ #OKV=original kernel version, KV=patched kernel version. They can be the same. ETYPE="sources" @@ -58,6 +58,7 @@ src_unpack() { epatch ${FILESDIR}/CAN-2004-0535-2.4-e1000.patch || die "Failed to patch CAN-2004-0535 security fix!" epatch ${FILESDIR}/CAN-2004-0497.patch || die "Failed to patch CAN-2004-0497 security fix!" epatch ${DISTDIR}/linux-2.4.26-CAN-2004-0415.patch || die "Failed to patch CAN-2004-0415 security fix!" + epatch ${FILESDIR}/security-proc-cmdline.patch || die "Failed to patch security-proc-cmdline.patch security fix!" kernel_universal_unpack } -- cgit v1.2.3-65-gdbad