diff options
author | Alexey Shvetsov <alexxy@gentoo.org> | 2012-05-25 21:48:33 +0000 |
---|---|---|
committer | Alexey Shvetsov <alexxy@gentoo.org> | 2012-05-25 21:48:33 +0000 |
commit | 66603fca52c84fdc1eaa74c7c0c0908cf1a3aeb7 (patch) | |
tree | 40055c0bf213763ed6b2d732e8af254edbe905de /sys-fs/multipath-tools | |
parent | Enable threshold and v5upgrade plugins (diff) | |
download | historical-66603fca52c84fdc1eaa74c7c0c0908cf1a3aeb7.tar.gz historical-66603fca52c84fdc1eaa74c7c0c0908cf1a3aeb7.tar.bz2 historical-66603fca52c84fdc1eaa74c7c0c0908cf1a3aeb7.zip |
[sys-fs/multipath-tools] Fix bugs #413063 and #399569
Package-Manager: portage-2.2.0_alpha108/cvs/Linux x86_64
Diffstat (limited to 'sys-fs/multipath-tools')
-rw-r--r-- | sys-fs/multipath-tools/ChangeLog | 9 | ||||
-rw-r--r-- | sys-fs/multipath-tools/Manifest | 30 | ||||
-rw-r--r-- | sys-fs/multipath-tools/files/multipath-tools-0.4.9-log_enquery_overflow.patch | 69 | ||||
-rw-r--r-- | sys-fs/multipath-tools/multipath-tools-0.4.9-r4.ebuild | 75 |
4 files changed, 168 insertions, 15 deletions
diff --git a/sys-fs/multipath-tools/ChangeLog b/sys-fs/multipath-tools/ChangeLog index ff4ec8a69976..6dec3746d5de 100644 --- a/sys-fs/multipath-tools/ChangeLog +++ b/sys-fs/multipath-tools/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-fs/multipath-tools # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/multipath-tools/ChangeLog,v 1.43 2012/05/22 15:01:19 xarthisius Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/multipath-tools/ChangeLog,v 1.44 2012/05/25 21:48:33 alexxy Exp $ + +*multipath-tools-0.4.9-r4 (25 May 2012) + + 25 May 2012; Alexey Shvetsov <alexxy@gentoo.org> + +files/multipath-tools-0.4.9-log_enquery_overflow.patch, + +multipath-tools-0.4.9-r4.ebuild: + [sys-fs/multipath-tools] Fix bugs #413063 and #399569 22 May 2012; Kacper Kowalik <xarthisius@gentoo.org> files/multipath-tools-0.4.9-build.patch: diff --git a/sys-fs/multipath-tools/Manifest b/sys-fs/multipath-tools/Manifest index 69027699dc5c..7e4b7538c441 100644 --- a/sys-fs/multipath-tools/Manifest +++ b/sys-fs/multipath-tools/Manifest @@ -11,28 +11,30 @@ AUX multipath-tools-0.4.8-socket-cve-2009-0115.patch 848 RMD160 4e4298b87c60546b AUX multipath-tools-0.4.8-udev-scsi_id-changes.patch 4125 RMD160 e7f6feca014bf462c0580caabedc73152e423e3c SHA1 bd8b5f30b0cbda8a3d15b3a2383812d58a5d7ced SHA256 dca166caf506ea496f7cb883a98d1b5b1c77f5a91afa343e1ddc27d2a89ef0e3 AUX multipath-tools-0.4.9-buffer-overflows.patch 993 RMD160 095c502f5df6bc11d933a73c4b01e22ec039b5b5 SHA1 713c5238c0953ea52c2577357eb4928c5f574ff0 SHA256 1f9ca1d26fee69dc7d5c1b65a835d23e1b8dd8de6fd3678faf3e7b499611d15d AUX multipath-tools-0.4.9-build.patch 5564 RMD160 57363d433f3bc43761251585b0d5467ccb3df1b8 SHA1 9730695328dd131ac3e0da90454a8e5e94bf9fb7 SHA256 2a412dad4ce65fa554799fea3dad70fdd0bd26dad850e6890474ea4cd1016d83 +AUX multipath-tools-0.4.9-log_enquery_overflow.patch 2452 RMD160 c5a024a27dd404861fb8ad45d5ddbd08a2e7cda3 SHA1 cc850fb67c1d4b30d972d4752e1d435cdd20132a SHA256 43cedfbfdc1a5636e107bc3d388f0b03185b12761c3abb18424352f516d72b4b AUX multipath.rc 622 RMD160 8c0ac06f0d6cf18dfe499487120a7e963bc82444 SHA1 54eb3e4f1aaefe7e5b32a78d7f97cecdc6b1996e SHA256 9b68396afda8114610058d456318dc201a4d8799fb1d0504538e34966a7fd3d8 AUX rc-multipathd 517 RMD160 9963ca90fa08c6631b7768df7fb99414de53343d SHA1 a2c7c8c8836360ca208bfa82c406419c16045be2 SHA256 d96e3d7ca1edbbbc92f1336d4c340f1b516e71c49c85e990e3f4063c1b5db241 DIST multipath-tools-0.4.8.tar.bz2 160706 RMD160 18a6f2c8180516c67bc7c634133218213cfa7dfc SHA1 aadc7c7ed072c3df2e32c64a2ab1ba7fac850d7a SHA256 b76d93d244f51e328969203366939d4336c89bd572e275d6a0d50d0bc8b4cd23 DIST multipath-tools-0.4.9.tar.bz2 169180 RMD160 54b178ad23cefceb6b42131bd7079c226c568a0d SHA1 e2263033934f9073962e7e54b42824355291f19f SHA256 8d44c8815144b5589cc3e604cb3fc16c76a028aef08aa1bec334ff70bf9ac712 EBUILD multipath-tools-0.4.8-r1.ebuild 2779 RMD160 a55cc868ed8b8f5828fbb0933de6a3292fbd8db3 SHA1 6e4e825ff7789a36ec617edd45634bf5404d2418 SHA256 caa5b8d68141b82919d29cb05f1af70c48c7e6ccba5c5931c08ea19886925c0f EBUILD multipath-tools-0.4.9-r3.ebuild 2129 RMD160 c05f3c08c249b0e27a25b75dacb9e556e0c1ceaf SHA1 ab33f30ab4645e691ff4b9b6600d55459d28babc SHA256 5d54a15911cce8e39351d5de50ab9e23acaadf95c5faaf59b9e4b5e63fc7d6a5 -MISC ChangeLog 8280 RMD160 759d21cbf102ad15dc1edd5b01da113346ee5cea SHA1 3b293759614a030555437c7299c0f5310ab387ef SHA256 e9b5cb8eb79a6bbd236a5afb86bde27718ecf56cfb8d3ad69ec86c4809e0e9ca +EBUILD multipath-tools-0.4.9-r4.ebuild 2212 RMD160 12507648724efdf04fffcf1c1286195b47469456 SHA1 c8c9b1cfae31339c85b2bc9c5d42ddcfb4bb65c2 SHA256 19f8ca7cffddd1274ade445e5a3911b19feeffddb50ba5b779f1efd978c71583 +MISC ChangeLog 8520 RMD160 88bb7fb136d370df36c16796e133256b26487c9f SHA1 106d0cf38e9c02cd5bb0f259c5fe77b5b8330957 SHA256 29a08393b1a292c7f7637112a06c439ce7f0b14541dee6b429b7821b6ac1af81 MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) -iQIcBAEBCAAGBQJPu6paAAoJEF0huFKJUZL5ffgQAIgqy+VE6IncbKyRfxeT5OXH -k/UgqtFoaAWol+o/3jzddXybxXUcgEuNYdCflxBeSWIWndOfYoxm0e4PG2EIoDaG -zmo+uhSa5nnu4LdwTuju33LSjA6pJ041RH8ZFU8uDu575CJRSeadwvzEP5jwm1HA -5J2GXLJLa6PTtBmLHsR4xvYj7aJyaLDwfSfr+PvdMl0jlQnWJ1YgCq/CXNZ9yYeN -cMKzl/SoRP8igqxU38XqUuUtFredUgq4vlisvfVtah3CCgyCCw/I1tIvSoPRvTV3 -63eMvo5EbziQJksAZDmt29mFn92+eLk63OBF3HBESoOaSZZzjwsINiCqrHi1nWUU -PsiXzJRR4naxqWk6gYWD9ag+NIhD/9KX9SG6zmbOj9TWxL4DvFugGmkgzRHua1kY -9Jb40a63U9fqOD5R1g1gu5/XCUFwVFwee9k/mdt/dz1u6RD10uJC++ismkyzF3N8 -JjrLt1WKk+hNsWbTp4wOkw+UrzkyqQKlQHmpVCEij/xhPkmE2GKdmqDznaqrMBP8 -xL8IlHinQ76e8FPTji7Q5X/4AqYTqG4pFYigBab2mPtKITFBVg6WCE06eTaedFLj -oykspujYqjCrtmKQnazXNT8MFafpSpEa+0s6AtjyxXWHjjm7bW1IRyibyDNPiMBw -7YKu1PIbE+OLkpG092qI -=17UB +iQIcBAEBCAAGBQJPv/3+AAoJEOf+E+/4L5Lmk/4QAICY5n5Rsps3SyyhLVxpVOJR +4TSaYNFnr6zkWpy/LzHToEIJ5JZbqi6b2cRwGG77s6PDEbiuvdJxBVi/Vcv5++NC +IYpX71Zl4vYM4UGY6PYE7/hpFbtC2pNxqcAEkPQDIitovyaip13vJa0ccOnGvnBW +0XwuTqU+2QHY0dY5m5gFB7hjgPo2scOsT3xwPsG6eqe1WOKZRQryhkzdnZ2tVZvc +lTgW117POj32sxLKX2BWqd5Nn0mizWqUbgL5ZCgtYn3fblFm1TaWyK+aS0ECLLsG +LXPQHoK4ozuTshKR1G3Jy73Nkmv6Nocl99lxtOeP4OCStzHYkGBzBG1BVz7e8UhP +NsIN8skaZ4sTPqh17/lioiqRgr8pmY6jlwSnGclFxPiSbqAJLhcd+9RVQRI9+JCp +BSDatIgRzogW4fpk/ppIbrzavgsArg3QLlOMfMpbeIcwbNalBsBUVeBnpvJPt3Sr +sEsvJbsy38p+zqpVSyw3XU5YL94DOFiRKF3u/YTC6qr6/rFAXSnxdml4+P+WvFGm +FEqHKTNBuvalsY5SjUUQNwQU74KE9FLBEvx/6oHxZiU5EL3vYvCsEqHoLSjeW9LS +OOYG/NopnjswWu0TdJcB8n3u0+7bHGSikDTc/YMz8wZTjqhWLUMGZi+DGMff5vMB +KRKTZhAzGCG1uKS1AV+r +=CVEE -----END PGP SIGNATURE----- diff --git a/sys-fs/multipath-tools/files/multipath-tools-0.4.9-log_enquery_overflow.patch b/sys-fs/multipath-tools/files/multipath-tools-0.4.9-log_enquery_overflow.patch new file mode 100644 index 000000000000..67367c9f42e0 --- /dev/null +++ b/sys-fs/multipath-tools/files/multipath-tools-0.4.9-log_enquery_overflow.patch @@ -0,0 +1,69 @@ +From e1d69df0cdd1627676501df3a533b25ffadaeff0 Mon Sep 17 00:00:00 2001 +From: Arkadiusz Miskiewicz <arekm@maven.pl> +Date: Sat, 27 Nov 2010 19:21:21 +0100 +Subject: [PATCH] multipath-tools overflow + +On Saturday 27 of November 2010, you wrote: + +[...] + +> the whole logarea is memset to 0 by logarea_init(), and each dequeued +> message is also memset to 0 by log_dequeue(), so it seems normal that +> msg->str value is 0x0, but it's really its address that matters. + +Ok, got it. Pointers, memory areas in my debugging session - are looking +good then. + +> +> It's not clear to me : are you actually hitting a bug or is it your +> debug session that puzzles you ? + +I'm hitting a bug. multipathd dies for me at that strcpy(). Now I think +the bug is strcpy usage instead of memcpy because I'm building with +-O2 -D_FORTIFY_SOURCE=2 which turns on special glibc overflow +detection. + +That detection seem to be smart enough to know that &str area is not +a string memory and aborts the program. + +Found similar problem discussed here +http://sourceware.org/ml/binutils/2005-11/msg00308.html + +glibc aborts the program: +[pid 13432] writev(2, [{"*** ", 4}, {"buffer overflow detected", 24}, +{" ***: ", 6}, {"/home/users/arekm/rpm/BUILD/multipath-tools-0.4.9 +/multipathd/multipathd", 71}, {" terminated\n", 12}], 5) = 117 + +same for valgrind: +**13436** *** strcpy_chk: buffer overflow detected ***: program terminated +==13436== at 0x4024997: VALGRIND_PRINTF_BACKTRACE (valgrind.h:4477) +==13436== by 0x40265F8: __strcpy_chk (mc_replace_strmem.c:781) +==13436== by 0x40EDC06: log_enqueue (string3.h:107) +==13436== by 0x40ED68A: log_safe (log_pthread.c:24) +==13436== by 0x40E296A: dlog (debug.c:36) +==13436== by 0x804ECEC: pidfile_create (pidfile.c:37) +==13436== by 0x804E731: main (main.c:1424) + +The bug is not visible if I run multipathd in debug mode (-d). + +This patch fixes the problem for me by avoiding false positive on strcpy_chk. +--- + libmultipath/log.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libmultipath/log.c b/libmultipath/log.c +index e56e46b..57b7696 100644 +--- a/libmultipath/log.c ++++ b/libmultipath/log.c +@@ -142,7 +142,7 @@ int log_enqueue (int prio, const char * fmt, va_list ap) + la->empty = 0; + msg = (struct logmsg *)la->tail; + msg->prio = prio; +- strcpy((void *)&msg->str, buff); ++ memcpy((void *)&msg->str, buff, strlen(buff) + 1); + lastmsg->next = la->tail; + msg->next = la->head; + +-- +1.7.6.5 + diff --git a/sys-fs/multipath-tools/multipath-tools-0.4.9-r4.ebuild b/sys-fs/multipath-tools/multipath-tools-0.4.9-r4.ebuild new file mode 100644 index 000000000000..fa64e8943b2d --- /dev/null +++ b/sys-fs/multipath-tools/multipath-tools-0.4.9-r4.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/multipath-tools/multipath-tools-0.4.9-r4.ebuild,v 1.1 2012/05/25 21:48:33 alexxy Exp $ + +EAPI="4" + +inherit eutils toolchain-funcs + +DESCRIPTION="Device mapper target autoconfig" +HOMEPAGE="http://christophe.varoqui.free.fr/" +SRC_URI="http://christophe.varoqui.free.fr/${PN}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" +IUSE="" + +RDEPEND="|| ( + >=sys-fs/lvm2-2.02.45 + >=sys-fs/device-mapper-1.00.19-r1 + ) + >=sys-fs/udev-124 + dev-libs/libaio + sys-libs/readline + !<sys-apps/baselayout-2" +DEPEND="${RDEPEND}" + +S="${WORKDIR}" + +PATCHES=( + "${FILESDIR}/${PN}-0.4.9-build.patch" + "${FILESDIR}/${PN}-0.4.9-buffer-overflows.patch" + "${FILESDIR}/${PN}-0.4.8-kparted-ext-partitions.patch" + "${FILESDIR}/${PN}-0.4.9-log_enquery_overflow.patch" +) + +src_compile() { + # LIBDM_API_FLUSH involves grepping files in /usr/include, + # so force the test to go the way we want #411337. + emake LIBDM_API_FLUSH=1 CC="$(tc-getCC)" || die +} + +src_install() { + dodir /sbin /usr/share/man/man8 + emake DESTDIR="${D}" install || die + + insinto /etc + newins "${S}"/multipath.conf.annotated multipath.conf + # drop this one it doesnt work with recent udev bug #413063 + rm "${D}/etc/udev/rules.d/65-multipath.rules" + fperms 644 /etc/udev/rules.d/66-kpartx.rules + newinitd "${FILESDIR}"/rc-multipathd multipathd || die + newinitd "${FILESDIR}"/multipath.rc multipath || die + + dodoc multipath.conf.* AUTHOR ChangeLog FAQ README TODO + docinto kpartx + dodoc kpartx/ChangeLog kpartx/README +} + +pkg_preinst() { + # The dev.d script was previously wrong and is now removed (the udev rules + # file does the job instead), but it won't be removed from live systems due + # to cfgprotect. + # This should help out a little... + if [[ -e ${ROOT}/etc/dev.d/block/multipath.dev ]] ; then + mkdir -p "${D}"/etc/dev.d/block + echo "# Please delete this file. It is obsoleted by /etc/udev/rules.d/65-multipath.rules" \ + > "${D}"/etc/dev.d/block/multipath.dev + fi +} + +pkg_postinst() { + elog "If you need multipath on your system, you must" + elog "add 'multipath' into your boot runlevel!" +} |