diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2013-08-05 10:24:20 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2013-08-05 10:24:20 +0000 |
commit | f7c7f9524d8ad82ec00313d9cebb4592d9f4e141 (patch) | |
tree | 33605fc5714056bd160ea630e65190c4c8154fcb /app-emulation/dosemu | |
parent | Fixed typos. (diff) | |
download | gentoo-2-f7c7f9524d8ad82ec00313d9cebb4592d9f4e141.tar.gz gentoo-2-f7c7f9524d8ad82ec00313d9cebb4592d9f4e141.tar.bz2 gentoo-2-f7c7f9524d8ad82ec00313d9cebb4592d9f4e141.zip |
Fixed stack struct overflow (bug #343577 by Diego Elio Pettenò).
(Portage version: 2.2.0_alpha191_p33/cvs/Linux x86_64, signed Manifest commit with key 611FF3AA)
Diffstat (limited to 'app-emulation/dosemu')
4 files changed, 138 insertions, 3 deletions
diff --git a/app-emulation/dosemu/ChangeLog b/app-emulation/dosemu/ChangeLog index be9bfb190590..219862e99e1c 100644 --- a/app-emulation/dosemu/ChangeLog +++ b/app-emulation/dosemu/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-emulation/dosemu # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/dosemu/ChangeLog,v 1.58 2013/08/05 09:55:20 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/dosemu/ChangeLog,v 1.59 2013/08/05 10:24:20 slyfox Exp $ + +*dosemu-1.4.1_pre20130107-r3 (05 Aug 2013) + + 05 Aug 2013; Sergei Trofimovich <slyfox@gentoo.org> + +dosemu-1.4.1_pre20130107-r3.ebuild, + +files/dosemu-1.4.1_pre20130107-fortify.patch, + dosemu-1.4.1_pre20130107-r2.ebuild: + Fixed stack struct overflow (bug #343577 by Diego Elio Pettenò). 05 Aug 2013; Sergei Trofimovich <slyfox@gentoo.org> dosemu-1.4.1_pre20130107-r2.ebuild: diff --git a/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r2.ebuild b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r2.ebuild index b068ede308f5..103e7a29716a 100644 --- a/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r2.ebuild +++ b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r2.ebuild @@ -1,10 +1,10 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r2.ebuild,v 1.2 2013/08/05 09:55:20 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r2.ebuild,v 1.3 2013/08/05 10:24:20 slyfox Exp $ EAPI=5 -inherit flag-o-matic pax-utils +inherit eutils flag-o-matic pax-utils P_FD="dosemu-freedos-1.0-bin" COMMIT="15cfb41ff20a052769d753c3262c57ecb050ad71" @@ -44,6 +44,8 @@ DEPEND="${RDEPEND} S="${WORKDIR}/${PN}-code-${COMMIT}" src_prepare() { + epatch "${FILESDIR}"/${P}-fortify.patch + # Has problems with -O3 on some systems replace-flags -O[3-9] -O2 diff --git a/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild new file mode 100644 index 000000000000..3d39079201a8 --- /dev/null +++ b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild,v 1.1 2013/08/05 10:24:20 slyfox Exp $ + +EAPI=5 + +inherit eutils flag-o-matic pax-utils + +P_FD="dosemu-freedos-1.0-bin" +COMMIT="15cfb41ff20a052769d753c3262c57ecb050ad71" + +DESCRIPTION="DOS Emulator" +HOMEPAGE="http://www.dosemu.org/" +SRC_URI="mirror://sourceforge/dosemu/${P_FD}.tgz + http://sourceforge.net/code-snapshots/git/d/do/dosemu/code.git/dosemu-code-${COMMIT}.zip -> ${P}.zip" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86" +IUSE="X svga gpm debug alsa sndfile fluidsynth" + +RDEPEND="X? ( x11-libs/libX11 + x11-libs/libXxf86vm + x11-libs/libXau + x11-libs/libXext + x11-libs/libXdmcp + x11-apps/xset + x11-apps/xlsfonts + x11-apps/bdftopcf + x11-apps/mkfontdir ) + svga? ( media-libs/svgalib ) + gpm? ( sys-libs/gpm ) + alsa? ( media-libs/alsa-lib ) + sndfile? ( media-libs/libsndfile ) + fluidsynth? ( media-sound/fluidsynth + media-sound/fluid-soundfont ) + media-libs/libsdl + >=sys-libs/slang-1.4" + +DEPEND="${RDEPEND} + X? ( x11-proto/xf86dgaproto ) + >=sys-devel/autoconf-2.57" + +S="${WORKDIR}/${PN}-code-${COMMIT}" + +src_prepare() { + epatch "${FILESDIR}"/${P}-fortify.patch + + # Has problems with -O3 on some systems + replace-flags -O[3-9] -O2 + + # This one is from media-sound/fluid-soundfont (bug #479534) + sed "s,/usr/share/soundfonts/default.sf2,${EPREFIX}/usr/share/sounds/sf2/FluidR3_GM.sf2,"\ + -i src/plugin/fluidsynth/mid_o_flus.c || die +} + +src_configure() { + econf $(use_with X x) \ + $(use_with svga svgalib) \ + $(use_enable debug) \ + $(use_with gpm) \ + $(use_with alsa) \ + $(use_with sndfile) \ + $(use_with fluidsynth) \ + --with-fdtarball="${DISTDIR}"/${P_FD}.tgz \ + --sysconfdir="${EPREFIX}"/etc/dosemu/ \ + --with-docdir="${EPREFIX}"/usr/share/doc/${PF} +} + +src_install() { + default + + # r - randmmap: dosemu tries to get address mapping + # exactly where asked, loops otherwise. + # m - allow RWX mapping: as it's an emulator / code loader + pax-mark -mr "${ED}/usr/bin/dosemu.bin" +} diff --git a/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch new file mode 100644 index 000000000000..5daa4e9fee41 --- /dev/null +++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch @@ -0,0 +1,48 @@ +From ff9bea065f4cc6068dcb8d6ea9423105305ca590 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <slyfox@gentoo.org> +Date: Mon, 5 Aug 2013 13:03:21 +0300 +Subject: [PATCH] src/tools/tools86.c: fix stack buffer overflow in + 'change_aout' + +Detected by gcc: + +gcc -std=gnu99 -c -MP -MMD -I../../src/include -I../../src/plugin/include -Wall -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -pipe -O2 -fomit-frame-pointer -o tools86.o tools86.c +In file included from /usr/include/stdio.h:937:0, + from tools86.c:98: + In function 'fread', + inlined from 'change_aout.constprop.1' at tools86.c:174:12, + inlined from 'main' at tools86.c:391:18: + /usr/include/bits/stdio2.h:293:2: warning: call to '__fread_chk_warn' declared with attribute warning: fread called with bigger size * nmemb than length of destination buffer [enabled by default] + return __fread_chk_warn (__ptr, __bos0 (__ptr), __size, __n, __stream); + ^ +Gentoo-bug: http://bugs.gentoo.org/343577 +Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> +--- + src/tools/tools86.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/tools/tools86.c b/src/tools/tools86.c +index 141610d..35a0b96 100644 +--- a/src/tools/tools86.c ++++ b/src/tools/tools86.c +@@ -137,7 +137,7 @@ struct bsd_header { /* a.out header */ + #endif + + #ifdef __linux__ +-static int header_ld86out_to_gnuasout(struct bsd_header *bsd, struct gnu_header *gnu) ++static int header_ld86out_to_gnuasout(const struct bsd_header *bsd, struct gnu_header *gnu) + { + if (bsd->a_magic[0] != 0x01 || bsd->a_magic[1] != 0x03 || + bsd->a_flags != 0x00 || bsd->a_cpu != 0x10) return -1; +@@ -171,7 +171,7 @@ static int change_aout(char *objfile, int update_symtable) + return errno; + } + #ifdef __linux__ +- if (fread(&bsd,sizeof(gnu),1,f) != 1 ) { ++ if (fread(&bsd,sizeof(bsd),1,f) != 1 ) { + fclose(f); + return -1; + } +-- +1.8.3.2 + |