From fd6be22fb10296db47181730cfcb39eaf449876e Mon Sep 17 00:00:00 2001 From: Tim Yamin Date: Sat, 19 Jun 2004 10:45:30 +0000 Subject: Added a patch to add in missing sanity checks that were added upstream in 2.4.21. --- sys-kernel/compaq-sources/ChangeLog | 10 ++- sys-kernel/compaq-sources/Manifest | 7 +- .../compaq-sources-2.4.9.32.7-r5.ebuild | 81 --------------------- .../compaq-sources-2.4.9.32.7-r6.ebuild | 82 ++++++++++++++++++++++ .../compaq-sources-2.4.9.32.7.I2C_Limits.patch | 44 ++++++++++++ .../files/digest-compaq-sources-2.4.9.32.7-r5 | 1 - .../files/digest-compaq-sources-2.4.9.32.7-r6 | 1 + 7 files changed, 140 insertions(+), 86 deletions(-) delete mode 100644 sys-kernel/compaq-sources/compaq-sources-2.4.9.32.7-r5.ebuild create mode 100644 sys-kernel/compaq-sources/compaq-sources-2.4.9.32.7-r6.ebuild create mode 100644 sys-kernel/compaq-sources/files/compaq-sources-2.4.9.32.7.I2C_Limits.patch delete mode 100644 sys-kernel/compaq-sources/files/digest-compaq-sources-2.4.9.32.7-r5 create mode 100644 sys-kernel/compaq-sources/files/digest-compaq-sources-2.4.9.32.7-r6 (limited to 'sys-kernel') diff --git a/sys-kernel/compaq-sources/ChangeLog b/sys-kernel/compaq-sources/ChangeLog index e0f397d45f95..a47c92a2568f 100644 --- a/sys-kernel/compaq-sources/ChangeLog +++ b/sys-kernel/compaq-sources/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-kernel/compaq-sources # Copyright 2000-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/compaq-sources/ChangeLog,v 1.7 2004/05/29 10:54:40 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/compaq-sources/ChangeLog,v 1.8 2004/06/19 10:45:30 plasmaroo Exp $ + +*compaq-sources-2.4.9.32.7-r6 (19 Jun 2004) + + 19 Jun 2004; -compaq-sources-2.4.9.32.7-r5.ebuild, + +compaq-sources-2.4.9.32.7-r6.ebuild, + +files/compaq-sources-2.4.9.32.7.I2C_Limits.patch: + Added a patch to add in missing sanity checks that were added upstream in + 2.4.21. *compaq-sources-2.4.9.32.7-r5 (29 May 2004) diff --git a/sys-kernel/compaq-sources/Manifest b/sys-kernel/compaq-sources/Manifest index 67a88c10a28f..45fe3085e590 100644 --- a/sys-kernel/compaq-sources/Manifest +++ b/sys-kernel/compaq-sources/Manifest @@ -1,14 +1,15 @@ -MD5 ff415f4fdfcc503e45d8f320d1363ddd ChangeLog 2124 +MD5 675ce046b0369a0b79b388a8c166d9c2 ChangeLog 2424 MD5 fa89a9407fb524aa495fff27051ef881 metadata.xml 684 -MD5 85660fcccf52674d16eee10f6de3427d compaq-sources-2.4.9.32.7-r5.ebuild 3350 +MD5 605292956c83dbd9bec964f8ad4e87c6 compaq-sources-2.4.9.32.7-r6.ebuild 3454 MD5 147fec50180ad91b6260fc7201dcb90f files/compaq-sources-2.4.9.32.7.CAN-2004-0010.patch 6050 MD5 e637c6fa41097ea2c4693d0766f2e1c5 files/compaq-sources-2.4.9.32.7.do_brk.patch 242 MD5 2c8a6f5232ae153c016cd241881b0719 files/compaq-sources-2.4.9.32.7.rtc_fix.patch 2152 MD5 ac42024b6e6ee1e2165914db4b22a61c files/compaq-sources-2.4.9.32.7.CAN-2004-0178.patch 424 MD5 c460ea130cb4ae84a5063ba044e3ce72 files/compaq-sources-2.4.9.32.7.CAN-2004-0427.patch 460 MD5 21f3a4f186017d925067335e24db36a1 files/compaq-sources-2.4.9.32.7.CAN-2004-0109.patch 1877 +MD5 e30386f1121b1197396ed9082eae7dcb files/compaq-sources-2.4.9.32.7.I2C_Limits.patch 1037 +MD5 942bf419fd5ef9c56b2025b5af96abb8 files/digest-compaq-sources-2.4.9.32.7-r6 81 MD5 a59596c90f6b86ec863fd748ec65747b files/compaq-sources-2.4.9.32.7.CAN-2004-0177.patch 397 MD5 d4a740ae56c2049247083af387a22a85 files/compaq-sources-2.4.9.32.7.CAN-2004-0394.patch 350 -MD5 942bf419fd5ef9c56b2025b5af96abb8 files/digest-compaq-sources-2.4.9.32.7-r5 81 MD5 174438d215b70cad5ffb00ca8123c062 files/compaq-sources-2.4.9.32.7.munmap.patch 837 MD5 e77a93fdf26f06cf3ea5080b27211725 files/compaq-sources-2.4.9.32.7.CAN-2003-0985.patch 414 diff --git a/sys-kernel/compaq-sources/compaq-sources-2.4.9.32.7-r5.ebuild b/sys-kernel/compaq-sources/compaq-sources-2.4.9.32.7-r5.ebuild deleted file mode 100644 index 784f35c1d288..000000000000 --- a/sys-kernel/compaq-sources/compaq-sources-2.4.9.32.7-r5.ebuild +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright 1999-2004 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/compaq-sources/compaq-sources-2.4.9.32.7-r5.ebuild,v 1.1 2004/05/29 10:54:40 plasmaroo Exp $ - -ETYPE="sources" -inherit kernel eutils -OKV=2.4.9 -KV=${OKV}-32.7 -EXTRAVERSION="-compaq-${PR}" -S=${WORKDIR}/linux-${KV} -IUSE="" - -# This ebuild installs the sources for the Linux kernel shipped with the -# latest version of Red Hat Linux for Alpha, maintained by Compaq. -# -# -taviso -# - -DEPEND="${DEPEND} - app-arch/rpm2targz - >=sys-apps/sed-4" - -REDPEND="" -DESCRIPTION="Kernel from the Compaq Distribution of Red Hat Linux (ALPHA)." -SRC_URI="ftp://ftp2.compaq.com/pub/linux/RedHat/7.2-alpha/updates/rpms/alpha/kernel-source-${KV}.alpha.rpm" -HOMEPAGE="http://www.kernel.org/ http://www.redhat.com/ http://www.support.compaq.com/alpha-tools/redhat/" -KEYWORDS="-* ~alpha" -SLOT="${KV}" - -src_unpack() { - local kernel_rpm="kernel-source-${KV}.alpha.rpm" - cd ${WORKDIR} - - ebegin "Unpacking Distribution RPM..." - - # agriffis' fast+efficient rpm extraction method from - # the dev-lang/ccc ebuild. - # - i=${DISTDIR}/${kernel_rpm} - dd ibs=`rpmoffset < ${i}` skip=1 if=$i 2>/dev/null \ - | gzip -dc | cpio -idmu 2>/dev/null \ - && find usr -type d -print0 | xargs -0 chmod a+rx - eend ${?} - assert "Failed to extract ${kernel_rpm%.rpm}.tar.gz" - - mv usr/src/linux-${KV} ${WORKDIR} - cd ${S} - - # Just fix a couple of minor issues... - sed -i 's#include/linux/autoconf.h \(include/linux/version.h \\\)#\1#' Makefile - sed -i 's#\(extern\) \(unsigned long irq_err_count;\)#\1 volatile \2#' arch/alpha/kernel/irq_alpha.c - sed -i 's#/DISCARD/ : { \*(.text.exit)#/DISCARD/ : {#' arch/alpha/vmlinux.lds.in - - # Security patches - epatch ${FILESDIR}/${P}.CAN-2003-0985.patch || die "Failed to patch mremap() vulnerability!" - epatch ${FILESDIR}/${P}.CAN-2004-0010.patch || die "Failed to add the CAN-2004-0010 patch!" - epatch ${FILESDIR}/${P}.CAN-2004-0109.patch || die "Failed to add the CAN-2004-0109 patch!" - epatch ${FILESDIR}/${P}.CAN-2004-0177.patch || die "Failed to add the CAN-2004-0177 patch!" - epatch ${FILESDIR}/${P}.CAN-2004-0178.patch || die "Failed to add the CAN-2004-0178 patch!" - epatch ${FILESDIR}/${P}.CAN-2004-0394.patch || die "Failed to add the CAN-2004-0394 patch!" - epatch ${FILESDIR}/${P}.CAN-2004-0427.patch || die "Failed to add the CAN-2004-0427 patch!" - epatch ${FILESDIR}/${P}.do_brk.patch || die "Failed to patch do_brk() vulnerability!" - epatch ${FILESDIR}/${P}.rtc_fix.patch || die "Failed to patch RTC vulnerabilities!" - epatch ${FILESDIR}/${P}.munmap.patch || die "Failed to apply munmap patch!" - - # Hand it over to the eclass... - kernel_universal_unpack -} - -pkg_postinst () { - einfo "This ebuild has installed the sources for the Linux kernel shipped with the" - einfo "latest version of Red Hat Linux Alpha, maintained by Compaq." - einfo - einfo "Compaq lag behind releases from kernel.org, but their kernels are" - einfo "extensively tested, and used by many thousands. This kernel will include" - einfo "bugfixes and extended hardware support, and is probably the most widely" - einfo "used Linux kernel on the Alpha Platform today." - einfo - ewarn "DO NOT Report issues with this kernel to Red Hat or Compaq, use" - ewarn "the Gentoo Linux bugzilla at http://bugs.gentoo.org/" -} diff --git a/sys-kernel/compaq-sources/compaq-sources-2.4.9.32.7-r6.ebuild b/sys-kernel/compaq-sources/compaq-sources-2.4.9.32.7-r6.ebuild new file mode 100644 index 000000000000..d060bebecd5b --- /dev/null +++ b/sys-kernel/compaq-sources/compaq-sources-2.4.9.32.7-r6.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/compaq-sources/compaq-sources-2.4.9.32.7-r6.ebuild,v 1.1 2004/06/19 10:45:30 plasmaroo Exp $ + +ETYPE="sources" +inherit kernel eutils +OKV=2.4.9 +KV=${OKV}-32.7 +EXTRAVERSION="-compaq-${PR}" +S=${WORKDIR}/linux-${KV} +IUSE="" + +# This ebuild installs the sources for the Linux kernel shipped with the +# latest version of Red Hat Linux for Alpha, maintained by Compaq. +# +# -taviso +# + +DEPEND="${DEPEND} + app-arch/rpm2targz + >=sys-apps/sed-4" + +REDPEND="" +DESCRIPTION="Kernel from the Compaq Distribution of Red Hat Linux (ALPHA)." +SRC_URI="ftp://ftp2.compaq.com/pub/linux/RedHat/7.2-alpha/updates/rpms/alpha/kernel-source-${KV}.alpha.rpm" +HOMEPAGE="http://www.kernel.org/ http://www.redhat.com/ http://www.support.compaq.com/alpha-tools/redhat/" +KEYWORDS="-* ~alpha" +SLOT="${KV}" + +src_unpack() { + local kernel_rpm="kernel-source-${KV}.alpha.rpm" + cd ${WORKDIR} + + ebegin "Unpacking Distribution RPM..." + + # agriffis' fast+efficient rpm extraction method from + # the dev-lang/ccc ebuild. + # + i=${DISTDIR}/${kernel_rpm} + dd ibs=`rpmoffset < ${i}` skip=1 if=$i 2>/dev/null \ + | gzip -dc | cpio -idmu 2>/dev/null \ + && find usr -type d -print0 | xargs -0 chmod a+rx + eend ${?} + assert "Failed to extract ${kernel_rpm%.rpm}.tar.gz" + + mv usr/src/linux-${KV} ${WORKDIR} + cd ${S} + + # Just fix a couple of minor issues... + sed -i 's#include/linux/autoconf.h \(include/linux/version.h \\\)#\1#' Makefile + sed -i 's#\(extern\) \(unsigned long irq_err_count;\)#\1 volatile \2#' arch/alpha/kernel/irq_alpha.c + sed -i 's#/DISCARD/ : { \*(.text.exit)#/DISCARD/ : {#' arch/alpha/vmlinux.lds.in + + # Security patches + epatch ${FILESDIR}/${P}.CAN-2003-0985.patch || die "Failed to patch mremap() vulnerability!" + epatch ${FILESDIR}/${P}.CAN-2004-0010.patch || die "Failed to add the CAN-2004-0010 patch!" + epatch ${FILESDIR}/${P}.CAN-2004-0109.patch || die "Failed to add the CAN-2004-0109 patch!" + epatch ${FILESDIR}/${P}.CAN-2004-0177.patch || die "Failed to add the CAN-2004-0177 patch!" + epatch ${FILESDIR}/${P}.CAN-2004-0178.patch || die "Failed to add the CAN-2004-0178 patch!" + epatch ${FILESDIR}/${P}.CAN-2004-0394.patch || die "Failed to add the CAN-2004-0394 patch!" + epatch ${FILESDIR}/${P}.CAN-2004-0427.patch || die "Failed to add the CAN-2004-0427 patch!" + epatch ${FILESDIR}/${P}.do_brk.patch || die "Failed to patch do_brk() vulnerability!" + epatch ${FILESDIR}/${P}.I2C_Limits.patch || die "Failed to patch the I2C i2cdev_ioctl() kmalloc() bug!" + epatch ${FILESDIR}/${P}.rtc_fix.patch || die "Failed to patch RTC vulnerabilities!" + epatch ${FILESDIR}/${P}.munmap.patch || die "Failed to apply munmap patch!" + + # Hand it over to the eclass... + kernel_universal_unpack +} + +pkg_postinst () { + einfo "This ebuild has installed the sources for the Linux kernel shipped with the" + einfo "latest version of Red Hat Linux Alpha, maintained by Compaq." + einfo + einfo "Compaq lag behind releases from kernel.org, but their kernels are" + einfo "extensively tested, and used by many thousands. This kernel will include" + einfo "bugfixes and extended hardware support, and is probably the most widely" + einfo "used Linux kernel on the Alpha Platform today." + einfo + ewarn "DO NOT Report issues with this kernel to Red Hat or Compaq, use" + ewarn "the Gentoo Linux bugzilla at http://bugs.gentoo.org/" +} diff --git a/sys-kernel/compaq-sources/files/compaq-sources-2.4.9.32.7.I2C_Limits.patch b/sys-kernel/compaq-sources/files/compaq-sources-2.4.9.32.7.I2C_Limits.patch new file mode 100644 index 000000000000..af20a6fc0c2c --- /dev/null +++ b/sys-kernel/compaq-sources/files/compaq-sources-2.4.9.32.7.I2C_Limits.patch @@ -0,0 +1,44 @@ +--- linux-2.4.20/drivers/i2c/i2c-dev.c 2004-06-19 03:27:30 -07:00 ++++ linux-2.4.21/drivers/i2c/i2c-dev.c 2004-06-19 03:27:30 -07:00 +@@ -254,6 +254,11 @@ + sizeof(rdwr_arg))) + return -EFAULT; + ++ /* Put an arbritrary limit on the number of messages that can ++ * be sent at once */ ++ if (rdwr_arg.nmsgs > 42) ++ return -EINVAL; ++ + rdwr_pa = (struct i2c_msg *) + kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg), + GFP_KERNEL); +@@ -270,6 +275,11 @@ + res = -EFAULT; + break; + } ++ /* Limit the size of the message to a sane amount */ ++ if (rdwr_pa[i].len > 8192) { ++ res = -EINVAL; ++ break; ++ } + rdwr_pa[i].buf = kmalloc(rdwr_pa[i].len, GFP_KERNEL); + if(rdwr_pa[i].buf == NULL) + { +@@ -280,10 +290,16 @@ + rdwr_arg.msgs[i].buf, + rdwr_pa[i].len)) + { +- kfree(rdwr_pa[i].buf); + res = -EFAULT; + break; + } ++ } ++ if (res < 0) { ++ int j; ++ for (j = 0; j < i; ++j) ++ kfree(rdwr_pa[j].buf); ++ kfree(rdwr_pa); ++ return res; + } + if (!res) + { diff --git a/sys-kernel/compaq-sources/files/digest-compaq-sources-2.4.9.32.7-r5 b/sys-kernel/compaq-sources/files/digest-compaq-sources-2.4.9.32.7-r5 deleted file mode 100644 index 96283e409fc6..000000000000 --- a/sys-kernel/compaq-sources/files/digest-compaq-sources-2.4.9.32.7-r5 +++ /dev/null @@ -1 +0,0 @@ -MD5 8c97bc83e1cc51224afbd17c65d66dd7 kernel-source-2.4.9-32.7.alpha.rpm 25515952 diff --git a/sys-kernel/compaq-sources/files/digest-compaq-sources-2.4.9.32.7-r6 b/sys-kernel/compaq-sources/files/digest-compaq-sources-2.4.9.32.7-r6 new file mode 100644 index 000000000000..96283e409fc6 --- /dev/null +++ b/sys-kernel/compaq-sources/files/digest-compaq-sources-2.4.9.32.7-r6 @@ -0,0 +1 @@ +MD5 8c97bc83e1cc51224afbd17c65d66dd7 kernel-source-2.4.9-32.7.alpha.rpm 25515952 -- cgit v1.2.3-65-gdbad