diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-10-05 08:00:47 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-10-05 08:00:47 +0000 |
commit | 9e314c5dd9fcf2e7b830796870e241379079ec31 (patch) | |
tree | b4879a5d31240d504ca73648fa9bf28fae0d8a70 /sys-fs | |
parent | Avoid sandbox violations when xdg-mime is called during src_install, as repor... (diff) | |
download | gentoo-2-9e314c5dd9fcf2e7b830796870e241379079ec31.tar.gz gentoo-2-9e314c5dd9fcf2e7b830796870e241379079ec31.tar.bz2 gentoo-2-9e314c5dd9fcf2e7b830796870e241379079ec31.zip |
Add fix from upstream for segfault #287338 by Marcin Mirosław.
(Portage version: 2.2_rc42/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/mdadm/ChangeLog | 8 | ||||
-rw-r--r-- | sys-fs/mdadm/files/mdadm-3.0.2-fix-null-dereference-in-set_member_info.patch | 51 | ||||
-rw-r--r-- | sys-fs/mdadm/mdadm-3.0.2-r1.ebuild | 63 |
3 files changed, 121 insertions, 1 deletions
diff --git a/sys-fs/mdadm/ChangeLog b/sys-fs/mdadm/ChangeLog index 70bef600cd05..0b37ae1c2fb7 100644 --- a/sys-fs/mdadm/ChangeLog +++ b/sys-fs/mdadm/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-fs/mdadm # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/ChangeLog,v 1.115 2009/10/04 20:12:11 klausman Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/ChangeLog,v 1.116 2009/10/05 08:00:46 vapier Exp $ + +*mdadm-3.0.2-r1 (05 Oct 2009) + + 05 Oct 2009; Mike Frysinger <vapier@gentoo.org> +mdadm-3.0.2-r1.ebuild, + +files/mdadm-3.0.2-fix-null-dereference-in-set_member_info.patch: + Add fix from upstream for segfault #287338 by Marcin Mirosław. 04 Oct 2009; Tobias Klausmann <klausman@gentoo.org> mdadm-3.0.ebuild: Stable on alpha, bug #287013 diff --git a/sys-fs/mdadm/files/mdadm-3.0.2-fix-null-dereference-in-set_member_info.patch b/sys-fs/mdadm/files/mdadm-3.0.2-fix-null-dereference-in-set_member_info.patch new file mode 100644 index 000000000000..c740421487b0 --- /dev/null +++ b/sys-fs/mdadm/files/mdadm-3.0.2-fix-null-dereference-in-set_member_info.patch @@ -0,0 +1,51 @@ +http://bugs.gentoo.org/287338 + +From 2b9aa337af7291d3f141322da96c9f667c99d53c Mon Sep 17 00:00:00 2001 +From: NeilBrown <neilb@suse.de> +Date: Thu, 1 Oct 2009 12:51:04 +1000 +Subject: [PATCH] Fix null-dereference in set_member_info + +set_member_info would try to dereference ->metadata_version, without +checking that it isn't NULL. + +Signed-off-by: NeilBrown <neilb@suse.de> +--- + mapfile.c | 15 +++++++++------ + 1 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/mapfile.c b/mapfile.c +index a3038be..ed59db5 100644 +--- a/mapfile.c ++++ b/mapfile.c +@@ -303,19 +303,22 @@ struct map_ent *map_by_name(struct map_ent **map, char *name) + */ + static void set_member_info(struct supertype *st, struct mdstat_ent *ent) + { +- char version[strlen(ent->metadata_version)+1]; + + st->subarray[0] = '\0'; + +- if (strncmp(ent->metadata_version, "external:", 9) != 0) ++ if (ent->metadata_version == NULL || ++ strncmp(ent->metadata_version, "external:", 9) != 0) + return; + +- strcpy(version, ent->metadata_version); +- +- if (is_subarray(&version[9])) { +- char *subarray = strrchr(version, '/'); ++ if (is_subarray(&ent->metadata_version[9])) { ++ char version[strlen(ent->metadata_version)+1]; ++ char *subarray; + char *name = &version[10]; + ++ strcpy(version, ent->metadata_version); ++ subarray = strrchr(version, '/'); ++ name = &version[10]; ++ + if (!subarray) + return; + *subarray++ = '\0'; +-- +1.6.5.rc2 + diff --git a/sys-fs/mdadm/mdadm-3.0.2-r1.ebuild b/sys-fs/mdadm/mdadm-3.0.2-r1.ebuild new file mode 100644 index 000000000000..e5820ce92c34 --- /dev/null +++ b/sys-fs/mdadm/mdadm-3.0.2-r1.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/mdadm-3.0.2-r1.ebuild,v 1.1 2009/10/05 08:00:46 vapier Exp $ + +inherit eutils flag-o-matic + +DESCRIPTION="A useful tool for running RAID systems - it can be used as a replacement for the raidtools" +HOMEPAGE="http://neil.brown.name/blog/mdadm" +SRC_URI="mirror://kernel/linux/utils/raid/mdadm/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" +IUSE="static" + +DEPEND="" +RDEPEND=">=sys-apps/util-linux-2.16" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${PN}-3.0-dont-make-man.patch + epatch "${FILESDIR}"/${PN}-2.6-syslog-updates.patch + epatch "${FILESDIR}"/${PN}-2.6.4-mdassemble.patch #211426 + epatch "${FILESDIR}"/${P}-fix-null-dereference-in-set_member_info.patch #287338 + use static && append-ldflags -static +} + +src_compile() { + emake \ + CROSS_COMPILE=${CHOST}- \ + CWFLAGS="-Wall" \ + CXFLAGS="${CFLAGS}" \ + all mdassemble \ + || die "emake failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "make install failed" + into / + dosbin mdassemble || die + dodoc ChangeLog INSTALL TODO README* ANNOUNCE-${PV} + + exeinto /$(get_libdir)/rcscripts/addons + newexe "${FILESDIR}"/raid-start.sh-3.0 raid-start.sh || die "addon failed" + newexe "${FILESDIR}"/raid-stop.sh raid-stop.sh || die "addon failed" + + insinto /etc + newins mdadm.conf-example mdadm.conf + newinitd "${FILESDIR}"/mdadm.rc mdadm || die "installing mdadm.rc failed" + newconfd "${FILESDIR}"/mdadm.confd mdadm || die "installing mdadm.confd failed" + newinitd "${FILESDIR}"/mdraid.rc mdraid || die "installing mdraid.rc failed" + + insinto /etc/udev/rules.d/ + newins "${FILESDIR}"/udev-145-64-md-raid.rules 64-md-raid.rules || die +} + +pkg_postinst() { + elog "If using baselayout-2 and not relying on kernel auto-detect" + elog "of your RAID devices, you need to add 'mdraid' to your 'boot'" + elog "runlevel. Run the following command:" + elog "rc-update add mdraid boot" +} |