Summary: | media-sound/id3v2-0.1.12 crashes when tagging mp3 with VBR due to a bug in media-libs/id3lib-3.8.3 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Asaf Gery <asaf.gery> |
Component: | [OLD] Library | Assignee: | Gentoo Sound Team <sound> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | asaf.gery, walther.md |
Priority: | Normal | Keywords: | PATCH, PullRequest |
Version: | 10.1 | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
See Also: |
https://github.com/gentoo/gentoo/pull/9621 https://github.com/gentoo/gentoo/pull/28688 https://github.com/gentoo/gentoo/pull/28695 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
.abcde.conf with lame configured to create VBR mp3
id3lib-3.8.3-vbr-overflow.patch id3lib-3.8.3-r9.ebuild |
Description
Asaf Gery
2012-01-11 19:41:40 UTC
Created attachment 298671 [details, diff] id3lib-3.8.3-vbr-overflow.patch with VBR_HEADER_MAX_SIZE = 116, the buffer char vbrheaderdata[VBR_HEADER_MAX_SIZE+1] is too small, below it is used with the following variable: int vbr_header_size = VBR_HEADER_MIN_SIZE + ((vbr_flags & FRAMES_FLAG)? 4:0) + ((vbr_flags & BYTES_FLAG)? 4:0) + ((vbr_flags & TOC_FLAG)? 100:0) + ((vbr_flags & SCALE_FLAG)? 4:0); which is 120 in the maximum case. So the patch fixes it to 120 instead of 116 bytes. (Copied and pasted from https://bugs.launchpad.net/ubuntu/+source/id3lib3.8.3/+bug/444466) Created attachment 298673 [details]
id3lib-3.8.3-r9.ebuild
A new ebuild that applies the patch
I don't think emerge --info is needed in this case, but here it is: --- asaf@squirrel ~/Music/Chasidik $ emerge --info Portage 2.1.10.41 (default/linux/amd64/10.0/desktop, gcc-4.5.3, glibc-2.13-r4, 3.1.6-gentoo x86_64) ================================================================= System uname: Linux-3.1.6-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7500_@_2.20GHz-with-gentoo-2.0.3 Timestamp of tree: Sun, 08 Jan 2012 06:00:01 +0000 app-shells/bash: 4.1_p9 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.7.2-r3, 3.1.4-r3 dev-util/cmake: 2.8.6-r4 dev-util/pkgconfig: 0.26 sys-apps/baselayout: 2.0.3 sys-apps/openrc: 0.9.4 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13::<unknown repository>, 2.68 sys-devel/automake: 1.5-r1, 1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.21.1-r1 sys-devel/gcc: 4.5.3-r1 sys-devel/gcc-config: 1.4.1-r1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r1 sys-kernel/linux-headers: 2.6.39 (virtual/os-headers) sys-libs/glibc: 2.13-r4 Repositories: gentoo java-overlay ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA dlj-1.1 skype-eula PUEL AdobeFlash-10.1 Oracle-BCLA-JavaSE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=nocona -O2 -pipe --stack-protector" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo" CXXFLAGS="-march=nocona -O2 -pipe --stack-protector" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="http://mirror.hamakor.org.il/pub/mirrors/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://gentoo.tiscali.nl/ http://mirror.muntinternet.net/pub/gentoo/ http://mirror.ovh.net/gentoo-distfiles/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://mirror.jamit.de/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.first-world.info/ http://mirror.cambrium.nl/pub/os/linux/gentoo/" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en he ar tr ru de" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/java-overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 aac aalib acl acpi alsa amd64 bash-completion berkdb bidi bluetooth branding bzip2 cairo cdda cddb cdr cli consolekit cracklib crypt cups curl cxx dbus dri dts dvd dvdr emboss encode exif extensions extras fam fbcon fbcondecor firefox flac fortran gdbm gdu gif gpm gtk hddtemp iconv icu ieee1394 ipv6 java jpeg kde laptop lcms ldap libnotify lm_sensors mad mmx mng modules mp3 mp4 mpeg mplayer mudflap mule multilib mysql ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf png policykit ppds pppd qt3support qt4 readline sdl semantic-desktop session sndfile spell sse sse2 ssl startup-notification svg sysfs tcpd threads tiff truetype udev unicode usb vdpau vorbis x264 xcb xemacs xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en he ar tr ru de" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel nvidia virtualbox" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS --- Hi! Why this well-known bug (p.e. http://www.redhat.com/archives/fedora-extras-commits/2009-November/msg04035.html) is still UNCONFIRMED? Why in June 2015 have updated portage tree i got "stack smashing detected"??? Why it is not in the main portage tree??? Alex Same problem here. Affects also: id3info, kid3 (both stack smashing) Reproduce: lame -v /usr/share/sounds/alsa/Noise.wav vbr.mp3 id3info vbr.mp3 See also: Allegedly fixed in 3.8.3 according to https://bugs.launchpad.net/ubuntu/+source/id3lib3.8.3/+bug/444466 Output: *** stack smashing detected ***: id3info terminated ======= Backtrace: ========= /lib/libc.so.6(+0x69d79)[0xb74bad79] /lib/libc.so.6(__fortify_fail+0x37)[0xb754a637] /lib/libc.so.6(+0xf95fa)[0xb754a5fa] /usr/lib/libid3-3.8.so.3(_fini+0x0)[0xb773d524] /usr/lib/libid3-3.8.so.3(_ZN7Mp3Info5ParseER10ID3_Readerj+0xa60)[0xb7730e70] /usr/lib/libid3-3.8.so.3(_ZN11ID3_TagImpl11ParseReaderER10ID3_Reader+0x438)[0xb7736198] /usr/lib/libid3-3.8.so.3(_ZN11ID3_TagImpl9ParseFileEv+0x182)[0xb77367c2] /usr/lib/libid3-3.8.so.3(_ZN11ID3_TagImpl4LinkEPKct+0x47)[0xb7732217] /usr/lib/libid3-3.8.so.3(_ZN7ID3_Tag4LinkEPKct+0x25)[0xb7731455] id3info[0x8049573] /lib/libc.so.6(__libc_start_main+0xde)[0xb7468dde] id3info[0x80498d0] ======= Memory map: ======== 08048000-0804d000 r-xp 00000000 08:07 23527917 /usr/bin/id3info 0804d000-0804e000 r--p 00004000 08:07 23527917 /usr/bin/id3info 0804e000-0804f000 rw-p 00005000 08:07 23527917 /usr/bin/id3info 0804f000-08070000 rw-p 00000000 00:00 0 [heap] b73ec000-b73ee000 rw-p 00000000 00:00 0 b73ee000-b7437000 r-xp 00000000 08:07 2738377 /lib/libm-2.20.so b7437000-b7438000 r--p 00048000 08:07 2738377 /lib/libm-2.20.so b7438000-b7439000 rw-p 00049000 08:07 2738377 /lib/libm-2.20.so b7439000-b744e000 r-xp 00000000 08:07 198155 /lib/libz.so.1.2.8 b744e000-b744f000 r--p 00014000 08:07 198155 /lib/libz.so.1.2.8 b744f000-b7450000 rw-p 00015000 08:07 198155 /lib/libz.so.1.2.8 b7450000-b7451000 rw-p 00000000 00:00 0 b7451000-b75f8000 r-xp 00000000 08:07 2738802 /lib/libc-2.20.so b75f8000-b75fb000 r--p 001a6000 08:07 2738802 /lib/libc-2.20.so b75fb000-b75fd000 rw-p 001a9000 08:07 2738802 /lib/libc-2.20.so b75fd000-b75ff000 rw-p 00000000 00:00 0 b75ff000-b7619000 r-xp 00000000 08:07 22792788 /usr/lib/gcc/i686-pc-linux-gnu/4.9.3/libgcc_s.so.1 b7619000-b761a000 r--p 00019000 08:07 22792788 /usr/lib/gcc/i686-pc-linux-gnu/4.9.3/libgcc_s.so.1 b761a000-b761b000 rw-p 0001a000 08:07 22792788 /usr/lib/gcc/i686-pc-linux-gnu/4.9.3/libgcc_s.so.1 b761b000-b7704000 r-xp 00000000 08:07 22792803 /usr/lib/gcc/i686-pc-linux-gnu/4.9.3/libstdc++.so.6.0.20 b7704000-b7708000 r--p 000e9000 08:07 22792803 /usr/lib/gcc/i686-pc-linux-gnu/4.9.3/libstdc++.so.6.0.20 b7708000-b7709000 rw-p 000ed000 08:07 22792803 /usr/lib/gcc/i686-pc-linux-gnu/4.9.3/libstdc++.so.6.0.20 b7709000-b7710000 rw-p 00000000 00:00 0 b7710000-b774b000 r-xp 00000000 08:07 23527891 /usr/lib/libid3-3.8.so.3.0.0 b774b000-b774c000 ---p 0003b000 08:07 23527891 /usr/lib/libid3-3.8.so.3.0.0 b774c000-b774d000 r--p 0003b000 08:07 23527891 /usr/lib/libid3-3.8.so.3.0.0 b774d000-b774f000 rw-p 0003c000 08:07 23527891 /usr/lib/libid3-3.8.so.3.0.0 b7772000-b7774000 rw-p 00000000 00:00 0 b7774000-b7795000 r-xp 00000000 08:07 2738801 /lib/ld-2.20.so b7795000-b7796000 r--p 00021000 08:07 2738801 /lib/ld-2.20.so b7796000-b7797000 rw-p 00022000 08:07 2738801 /lib/ld-2.20.so bfba9000-bfbca000 rw-p 00000000 00:00 0 [stack] Aborted btw I am not on amd64 but x86 Hi, I can confirm this behaviour of tools using libid3 as their backend (/usr/lib/libid3-3.8.so.3.0.0) i.e. the problem occurs with id3v2 and id3info here. Bug and patch confirmed here on x86 *** Bug 638044 has been marked as a duplicate of this bug. *** See discussion in bug 638044 too. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc5b8d1da00ad6de0cc74ba0c20af3b8888206f7 commit fc5b8d1da00ad6de0cc74ba0c20af3b8888206f7 Author: Kevin Martin <kevinm@gatech.edu> AuthorDate: 2022-12-18 00:07:59 +0000 Commit: Miroslav Šulc <fordfrog@gentoo.org> CommitDate: 2022-12-18 08:12:24 +0000 media-libs/id3lib: Fix stack-smashing when reading VBR Closes: https://bugs.gentoo.org/398571 Signed-off-by: Kevin Martin <kevinmbecause@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/28695 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org> .../files/id3lib-3.8.3-vbr-stack-smashing.patch | 19 +++++++ media-libs/id3lib/id3lib-3.8.3-r9.ebuild | 64 ++++++++++++++++++++++ 2 files changed, 83 insertions(+) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b12443fc16adc8068eeacfdf5513761f1a1d201 commit 7b12443fc16adc8068eeacfdf5513761f1a1d201 Author: Miroslav Šulc <fordfrog@gentoo.org> AuthorDate: 2022-12-18 08:12:15 +0000 Commit: Miroslav Šulc <fordfrog@gentoo.org> CommitDate: 2022-12-18 08:12:24 +0000 media-libs/id3lib: switched to stable, dropped old Bug: https://bugs.gentoo.org/398571 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org> media-libs/id3lib/id3lib-3.8.3-r8.ebuild | 63 -------------------------------- media-libs/id3lib/id3lib-3.8.3-r9.ebuild | 2 +- 2 files changed, 1 insertion(+), 64 deletions(-) |