summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Yamin <plasmaroo@gentoo.org>2004-02-18 22:06:19 +0000
committerTim Yamin <plasmaroo@gentoo.org>2004-02-18 22:06:19 +0000
commit7092f547124d42412a5ce77396a457c90f4464af (patch)
treebd2fe1d783054f9cd58947a26180dbb6ab630d24 /sys-kernel/hppa-sources
parentInitial Import. (Manifest recommit) (diff)
downloadgentoo-2-7092f547124d42412a5ce77396a457c90f4464af.tar.gz
gentoo-2-7092f547124d42412a5ce77396a457c90f4464af.tar.bz2
gentoo-2-7092f547124d42412a5ce77396a457c90f4464af.zip
Added the patch for the mremap/munmap vulnerability. Bug #42024.
Diffstat (limited to 'sys-kernel/hppa-sources')
-rw-r--r--sys-kernel/hppa-sources/ChangeLog10
-rw-r--r--sys-kernel/hppa-sources/files/digest-hppa-sources-2.4.24_p0-r14
-rw-r--r--sys-kernel/hppa-sources/files/hppa-sources.munmap.patch27
-rw-r--r--sys-kernel/hppa-sources/hppa-sources-2.4.24_p0-r1.ebuild64
4 files changed, 103 insertions, 2 deletions
diff --git a/sys-kernel/hppa-sources/ChangeLog b/sys-kernel/hppa-sources/ChangeLog
index d55f93e6f0d4..c780b28b8a61 100644
--- a/sys-kernel/hppa-sources/ChangeLog
+++ b/sys-kernel/hppa-sources/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-kernel/hppa-sources
-# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/hppa-sources/ChangeLog,v 1.31 2004/01/16 01:25:50 gmsoft Exp $
+# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/hppa-sources/ChangeLog,v 1.32 2004/02/18 22:06:19 plasmaroo Exp $
+
+*hppa-sources-2.4.24_p0-r1 (18 Feb 2004)
+
+ 18 Feb 2004; <plasmaroo@gentoo.org> hppa-sources-2.4.24_p0-r1.ebuild,
+ files/hppa-sources.munmap.patch:
+ Added the patch for the mremap/munmap vulnerability. Bug #42024.
*hppa-sources-2.4.24_p0 (12 Jan 2004)
diff --git a/sys-kernel/hppa-sources/files/digest-hppa-sources-2.4.24_p0-r1 b/sys-kernel/hppa-sources/files/digest-hppa-sources-2.4.24_p0-r1
new file mode 100644
index 000000000000..5a8a354a453b
--- /dev/null
+++ b/sys-kernel/hppa-sources/files/digest-hppa-sources-2.4.24_p0-r1
@@ -0,0 +1,4 @@
+MD5 1e055c42921b2396a559d84df4c3d9aa linux-2.4.24.tar.bz2 29837818
+MD5 326be2ca68ac102caa62eac1bf61bb8e patch-2.4.24-pa0.gz 716114
+MD5 fd23b7f3af634c6e93151cb48cbde8d8 xfs-2.4.23_p4-hppa.patch.bz2 1188535
+MD5 010fe6b49e97365f12ce3f70376d5eb0 parisc-2.4.23-pa4-missing-ioctl-translations.diff 18091
diff --git a/sys-kernel/hppa-sources/files/hppa-sources.munmap.patch b/sys-kernel/hppa-sources/files/hppa-sources.munmap.patch
new file mode 100644
index 000000000000..e120b35b7adb
--- /dev/null
+++ b/sys-kernel/hppa-sources/files/hppa-sources.munmap.patch
@@ -0,0 +1,27 @@
+diff -ur linux-2.4.25-rc3/mm/mremap.c linux-2.4.25-rc4/mm/mremap.c
+--- linux-2.4.25-rc3/mm/mremap.c 2004-02-18 13:56:01.000000000 +0000
++++ linux-2.4.25-rc4/mm/mremap.c 2004-02-18 13:49:08.000000000 +0000
+@@ -258,16 +258,20 @@
+ if ((addr <= new_addr) && (addr+old_len) > new_addr)
+ goto out;
+
+- do_munmap(current->mm, new_addr, new_len);
++ ret = do_munmap(current->mm, new_addr, new_len);
++ if (ret && new_len)
++ goto out;
+ }
+
+ /*
+ * Always allow a shrinking remap: that just unmaps
+ * the unnecessary pages..
+ */
+- ret = addr;
+ if (old_len >= new_len) {
+- do_munmap(current->mm, addr+new_len, old_len - new_len);
++ ret = do_munmap(current->mm, addr+new_len, old_len - new_len);
++ if (ret && old_len != new_len)
++ goto out;
++ ret = addr;
+ if (!(flags & MREMAP_FIXED) || (new_addr == addr))
+ goto out;
+ }
diff --git a/sys-kernel/hppa-sources/hppa-sources-2.4.24_p0-r1.ebuild b/sys-kernel/hppa-sources/hppa-sources-2.4.24_p0-r1.ebuild
new file mode 100644
index 000000000000..85e737ef3a34
--- /dev/null
+++ b/sys-kernel/hppa-sources/hppa-sources-2.4.24_p0-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/hppa-sources/hppa-sources-2.4.24_p0-r1.ebuild,v 1.1 2004/02/18 22:06:19 plasmaroo Exp $
+#OKV=original kernel version, KV=patched kernel version. They can be the same.
+
+ETYPE="sources"
+inherit kernel
+OKV="${PV/_p*/}"
+PATCH_LEVEL="${PV/${OKV}_p/}"
+EXTRAVERSION="-pa${PATCH_LEVEL}"
+[ ! "${PR}" = "r0" ] && EXTRAVERSION="${EXTRAVERSION}-${PR}"
+KV="${OKV}${EXTRAVERSION}"
+
+S=${WORKDIR}/linux-${KV}
+IUSE="xfs"
+
+PATCH_SET="`seq 0 ${PATCH_LEVEL}`"
+PATCH_COUNT="$(( `echo ${PATCH_SET} | wc -w` - 1 ))"
+
+
+DESCRIPTION="Full sources for the Linux kernel with patch for hppa"
+SRC_URI="mirror://kernel/linux/kernel/v2.4/linux-${OKV}.tar.bz2 http://ftp.parisc-linux.org/cvs/linux-2.4/patch-${OKV}-pa`echo ${PATCH_SET} | awk '{ print $1 }'`.gz
+xfs? ( http://dev.gentoo.org/~gmsoft/patches/xfs-2.4.23_p4-hppa.patch.bz2 )
+http://dev.gentoo.org/~gmsoft/patches/parisc-2.4.23-pa4-missing-ioctl-translations.diff"
+HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/ http://parisc-linux.org"
+KEYWORDS="hppa -*"
+SLOT="${KV}"
+
+
+src_unpack() {
+ unpack linux-${OKV}.tar.bz2
+ mv ${WORKDIR}/linux-${OKV} ${WORKDIR}/linux-${KV}
+ cd ${S}
+
+ einfo Applying ${OKV}-pa`echo ${PATCH_SET} | awk '{ print $1 }'`
+ zcat ${DISTDIR}/patch-${OKV}-pa`echo ${PATCH_SET} | awk '{ print $1 }'`.gz | patch -sp 1
+
+ use xfs && epatch ${DISTDIR}/xfs-2.4.23_p4-hppa.patch.bz2
+
+ DEFCONFIG="${S}/arch/parisc/defconfig"
+
+ # Tweaks the default configuration
+
+ # Enable stuff
+ for i in CONFIG_SERIAL_NONSTANDARD CONFIG_PDC_CONSOLE CONFIG_DEVFS_FS \
+ CONFIG_USB CONFIG_USB_OHCI CONFIG_USB_HID CONFIG_USB_HIDINPUT \
+ CONFIG_CRC32 CONFIG_BLK_STATS CONFIG_TMPFS
+ do
+ sed -i -e "s/^.*${i}\ .*$//" "${DEFCONFIG}"
+ echo "${i}=y" >> "${DEFCONFIG}"
+ done
+
+ # Disable stuff
+ for i in CONFIG_HOTPLUG CONFIG_PARPORT CONFIG_BLK_DEV_RAM CONFIG_MD \
+ CONFIG_CRYPTO CONFIG_DEVPTS_FS
+ do
+ sed -i -e "s/^.*${i}=.*$/# ${i} is not set/" "${DEFCONFIG}"
+ done
+
+ epatch ${DISTDIR}/parisc-2.4.23-pa4-missing-ioctl-translations.diff || die "Failed to patch missing ioctls translations!"
+ epatch ${FILESDIR}/${PN}.munmap.patch || die "Failed to apply munmap patch!"
+
+ kernel_universal_unpack
+}