Date: Monday, March 2, 2015 @ 16:19:09 Author: ronald Revision: 232411
archrelease: copy trunk to testing-i686, testing-x86_64 Added: e2fsprogs/repos/testing-i686/ e2fsprogs/repos/testing-i686/CVE-2015-1572.patch (from rev 232410, e2fsprogs/trunk/CVE-2015-1572.patch) e2fsprogs/repos/testing-i686/MIT-LICENSE (from rev 232410, e2fsprogs/trunk/MIT-LICENSE) e2fsprogs/repos/testing-i686/PKGBUILD (from rev 232410, e2fsprogs/trunk/PKGBUILD) e2fsprogs/repos/testing-i686/e2fsprogs.install (from rev 232410, e2fsprogs/trunk/e2fsprogs.install) e2fsprogs/repos/testing-i686/mke2fs.conf (from rev 232410, e2fsprogs/trunk/mke2fs.conf) e2fsprogs/repos/testing-x86_64/ e2fsprogs/repos/testing-x86_64/CVE-2015-1572.patch (from rev 232410, e2fsprogs/trunk/CVE-2015-1572.patch) e2fsprogs/repos/testing-x86_64/MIT-LICENSE (from rev 232410, e2fsprogs/trunk/MIT-LICENSE) e2fsprogs/repos/testing-x86_64/PKGBUILD (from rev 232410, e2fsprogs/trunk/PKGBUILD) e2fsprogs/repos/testing-x86_64/e2fsprogs.install (from rev 232410, e2fsprogs/trunk/e2fsprogs.install) e2fsprogs/repos/testing-x86_64/mke2fs.conf (from rev 232410, e2fsprogs/trunk/mke2fs.conf) ------------------------------------+ testing-i686/CVE-2015-1572.patch | 53 +++++++++++++++++++++++++++++ testing-i686/MIT-LICENSE | 25 ++++++++++++++ testing-i686/PKGBUILD | 62 +++++++++++++++++++++++++++++++++++ testing-i686/e2fsprogs.install | 20 +++++++++++ testing-i686/mke2fs.conf | 26 ++++++++++++++ testing-x86_64/CVE-2015-1572.patch | 53 +++++++++++++++++++++++++++++ testing-x86_64/MIT-LICENSE | 25 ++++++++++++++ testing-x86_64/PKGBUILD | 62 +++++++++++++++++++++++++++++++++++ testing-x86_64/e2fsprogs.install | 20 +++++++++++ testing-x86_64/mke2fs.conf | 26 ++++++++++++++ 10 files changed, 372 insertions(+) Copied: e2fsprogs/repos/testing-i686/CVE-2015-1572.patch (from rev 232410, e2fsprogs/trunk/CVE-2015-1572.patch) =================================================================== --- testing-i686/CVE-2015-1572.patch (rev 0) +++ testing-i686/CVE-2015-1572.patch 2015-03-02 15:19:09 UTC (rev 232411) @@ -0,0 +1,53 @@ +From 49d0fe2a14f2a23da2fe299643379b8c1d37df73 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o <ty...@mit.edu> +Date: Fri, 6 Feb 2015 12:46:39 -0500 +Subject: libext2fs: fix potential buffer overflow in closefs() + +The bug fix in f66e6ce4446: "libext2fs: avoid buffer overflow if +s_first_meta_bg is too big" had a typo in the fix for +ext2fs_closefs(). In practice most of the security exposure was from +the openfs path, since this meant if there was a carefully crafted +file system, buffer overrun would be triggered when the file system was +opened. + +However, if corrupted file system didn't trip over some corruption +check, and then the file system was modified via tune2fs or debugfs, +such that the superblock was marked dirty and then written out via the +closefs() path, it's possible that the buffer overrun could be +triggered when the file system is closed. + +Also clear up a signed vs unsigned warning while we're at it. + +Thanks to Nick Kralevich <n...@google.com> for asking me to look at +compiler warning in the code in question, which led me to notice the +bug in f66e6ce4446. + +Addresses: CVE-2015-1572 + +Signed-off-by: Theodore Ts'o <ty...@mit.edu> + +diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c +index 1f99113..ab5b2fb 100644 +--- a/lib/ext2fs/closefs.c ++++ b/lib/ext2fs/closefs.c +@@ -287,7 +287,7 @@ errcode_t ext2fs_flush2(ext2_filsys fs, int flags) + dgrp_t j; + #endif + char *group_ptr; +- int old_desc_blocks; ++ blk64_t old_desc_blocks; + struct ext2fs_numeric_progress_struct progress; + + EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); +@@ -346,7 +346,7 @@ errcode_t ext2fs_flush2(ext2_filsys fs, int flags) + group_ptr = (char *) group_shadow; + if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) { + old_desc_blocks = fs->super->s_first_meta_bg; +- if (old_desc_blocks > fs->super->s_first_meta_bg) ++ if (old_desc_blocks > fs->desc_blocks) + old_desc_blocks = fs->desc_blocks; + } else + old_desc_blocks = fs->desc_blocks; +-- +cgit v0.10.2 + Copied: e2fsprogs/repos/testing-i686/MIT-LICENSE (from rev 232410, e2fsprogs/trunk/MIT-LICENSE) =================================================================== --- testing-i686/MIT-LICENSE (rev 0) +++ testing-i686/MIT-LICENSE 2015-03-02 15:19:09 UTC (rev 232411) @@ -0,0 +1,25 @@ +Copyright (c) 2003-2007 Theodore Ts'o <ty...@mit.edu> +Copyright (c) 1997-2003 Yann Dirson <dir...@debian.org> +Copyright (c) 2001 Alcove <http://www.alcove.com/> +Copyright (c) 1997 Klee Dienes +Copyright (c) 1995-1996 Michael Nonweiler <mr...@cam.ac.uk> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject +to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. Copied: e2fsprogs/repos/testing-i686/PKGBUILD (from rev 232410, e2fsprogs/trunk/PKGBUILD) =================================================================== --- testing-i686/PKGBUILD (rev 0) +++ testing-i686/PKGBUILD 2015-03-02 15:19:09 UTC (rev 232411) @@ -0,0 +1,62 @@ +# $Id$ +# Maintainer: Ronald van Haren <ronald.archlinux.org> +# Contributor: judd <jvi...@zeroflux.org> + +pkgname=e2fsprogs +pkgver=1.42.12 +pkgrel=2 +pkgdesc="Ext2/3/4 filesystem utilities" +arch=('i686' 'x86_64') +license=('GPL' 'LGPL' 'MIT') +url="http://e2fsprogs.sourceforge.net" +groups=('base') +depends=('sh' 'libutil-linux') +makedepends=('bc' 'util-linux') +source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz" + 'CVE-2015-1572.patch' 'MIT-LICENSE') +backup=('etc/mke2fs.conf') +options=('staticlibs') +install=${pkgname}.install +sha1sums=('083c1bb0d1e85672e8038a2fadf70b24e7409db7' + '7d0a46b59ea298e517f983f8ff67d29a0307f1ba' + 'f4a0d5b0cdb980e3fedd6f5e7dde0b0ffb7bbdfb') + +prepare() { + cd "${srcdir}/${pkgname}-${pkgver}" + + # Remove unnecessary init.d directory + sed -i '/init\.d/s|^|#|' misc/Makefile.in + + # backport CVE 2015-1572 fix + patch -Np1 -i "${srcdir}/CVE-2015-1572.patch" +} + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + + ./configure --prefix=/usr --with-root-prefix="" --libdir=/usr/lib \ + --sbindir=/usr/bin --enable-elf-shlibs --disable-fsck --disable-uuidd \ + --disable-libuuid --disable-libblkid + + make +} + +package() { + unset MAKEFLAGS + + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install install-libs + + sed -i -e 's/^AWK=.*/AWK=awk/' "${pkgdir}/usr/bin/compile_et" + + # remove references to build directory + sed -i -e 's#^SS_DIR=.*#SS_DIR="/usr/share/ss"#' "${pkgdir}/usr/bin/mk_cmds" + sed -i -e 's#^ET_DIR=.*#ET_DIR="/usr/share/et"#' "${pkgdir}/usr/bin/compile_et" + + # remove static libraries with a shared counterpart + rm "${pkgdir}"/usr/lib/lib{com_err,e2p,ext2fs,ss}.a + + # install MIT license + install -Dm644 "${srcdir}/MIT-LICENSE" \ + "${pkgdir}/usr/share/licenses/${pkgname}/MIT-LICENSE" +} Copied: e2fsprogs/repos/testing-i686/e2fsprogs.install (from rev 232410, e2fsprogs/trunk/e2fsprogs.install) =================================================================== --- testing-i686/e2fsprogs.install (rev 0) +++ testing-i686/e2fsprogs.install 2015-03-02 15:19:09 UTC (rev 232411) @@ -0,0 +1,20 @@ +infodir=usr/share/info +filelist=(libext2fs.info.gz) + +post_install() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info $infodir/$file $infodir/dir 2> /dev/null + done +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info --delete $infodir/$file $infodir/dir 2> /dev/null + done +} Copied: e2fsprogs/repos/testing-i686/mke2fs.conf (from rev 232410, e2fsprogs/trunk/mke2fs.conf) =================================================================== --- testing-i686/mke2fs.conf (rev 0) +++ testing-i686/mke2fs.conf 2015-03-02 15:19:09 UTC (rev 232411) @@ -0,0 +1,26 @@ +[defaults] + base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr + blocksize = 4096 + inode_size = 128 + inode_ratio = 16384 + +[fs_types] + small = { + blocksize = 1024 + inode_size = 128 + inode_ratio = 4096 + } + floppy = { + blocksize = 1024 + inode_size = 128 + inode_ratio = 8192 + } + news = { + inode_ratio = 4096 + } + largefile = { + inode_ratio = 1048576 + } + largefile4 = { + inode_ratio = 4194304 + } Copied: e2fsprogs/repos/testing-x86_64/CVE-2015-1572.patch (from rev 232410, e2fsprogs/trunk/CVE-2015-1572.patch) =================================================================== --- testing-x86_64/CVE-2015-1572.patch (rev 0) +++ testing-x86_64/CVE-2015-1572.patch 2015-03-02 15:19:09 UTC (rev 232411) @@ -0,0 +1,53 @@ +From 49d0fe2a14f2a23da2fe299643379b8c1d37df73 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o <ty...@mit.edu> +Date: Fri, 6 Feb 2015 12:46:39 -0500 +Subject: libext2fs: fix potential buffer overflow in closefs() + +The bug fix in f66e6ce4446: "libext2fs: avoid buffer overflow if +s_first_meta_bg is too big" had a typo in the fix for +ext2fs_closefs(). In practice most of the security exposure was from +the openfs path, since this meant if there was a carefully crafted +file system, buffer overrun would be triggered when the file system was +opened. + +However, if corrupted file system didn't trip over some corruption +check, and then the file system was modified via tune2fs or debugfs, +such that the superblock was marked dirty and then written out via the +closefs() path, it's possible that the buffer overrun could be +triggered when the file system is closed. + +Also clear up a signed vs unsigned warning while we're at it. + +Thanks to Nick Kralevich <n...@google.com> for asking me to look at +compiler warning in the code in question, which led me to notice the +bug in f66e6ce4446. + +Addresses: CVE-2015-1572 + +Signed-off-by: Theodore Ts'o <ty...@mit.edu> + +diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c +index 1f99113..ab5b2fb 100644 +--- a/lib/ext2fs/closefs.c ++++ b/lib/ext2fs/closefs.c +@@ -287,7 +287,7 @@ errcode_t ext2fs_flush2(ext2_filsys fs, int flags) + dgrp_t j; + #endif + char *group_ptr; +- int old_desc_blocks; ++ blk64_t old_desc_blocks; + struct ext2fs_numeric_progress_struct progress; + + EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); +@@ -346,7 +346,7 @@ errcode_t ext2fs_flush2(ext2_filsys fs, int flags) + group_ptr = (char *) group_shadow; + if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) { + old_desc_blocks = fs->super->s_first_meta_bg; +- if (old_desc_blocks > fs->super->s_first_meta_bg) ++ if (old_desc_blocks > fs->desc_blocks) + old_desc_blocks = fs->desc_blocks; + } else + old_desc_blocks = fs->desc_blocks; +-- +cgit v0.10.2 + Copied: e2fsprogs/repos/testing-x86_64/MIT-LICENSE (from rev 232410, e2fsprogs/trunk/MIT-LICENSE) =================================================================== --- testing-x86_64/MIT-LICENSE (rev 0) +++ testing-x86_64/MIT-LICENSE 2015-03-02 15:19:09 UTC (rev 232411) @@ -0,0 +1,25 @@ +Copyright (c) 2003-2007 Theodore Ts'o <ty...@mit.edu> +Copyright (c) 1997-2003 Yann Dirson <dir...@debian.org> +Copyright (c) 2001 Alcove <http://www.alcove.com/> +Copyright (c) 1997 Klee Dienes +Copyright (c) 1995-1996 Michael Nonweiler <mr...@cam.ac.uk> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject +to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. Copied: e2fsprogs/repos/testing-x86_64/PKGBUILD (from rev 232410, e2fsprogs/trunk/PKGBUILD) =================================================================== --- testing-x86_64/PKGBUILD (rev 0) +++ testing-x86_64/PKGBUILD 2015-03-02 15:19:09 UTC (rev 232411) @@ -0,0 +1,62 @@ +# $Id$ +# Maintainer: Ronald van Haren <ronald.archlinux.org> +# Contributor: judd <jvi...@zeroflux.org> + +pkgname=e2fsprogs +pkgver=1.42.12 +pkgrel=2 +pkgdesc="Ext2/3/4 filesystem utilities" +arch=('i686' 'x86_64') +license=('GPL' 'LGPL' 'MIT') +url="http://e2fsprogs.sourceforge.net" +groups=('base') +depends=('sh' 'libutil-linux') +makedepends=('bc' 'util-linux') +source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz" + 'CVE-2015-1572.patch' 'MIT-LICENSE') +backup=('etc/mke2fs.conf') +options=('staticlibs') +install=${pkgname}.install +sha1sums=('083c1bb0d1e85672e8038a2fadf70b24e7409db7' + '7d0a46b59ea298e517f983f8ff67d29a0307f1ba' + 'f4a0d5b0cdb980e3fedd6f5e7dde0b0ffb7bbdfb') + +prepare() { + cd "${srcdir}/${pkgname}-${pkgver}" + + # Remove unnecessary init.d directory + sed -i '/init\.d/s|^|#|' misc/Makefile.in + + # backport CVE 2015-1572 fix + patch -Np1 -i "${srcdir}/CVE-2015-1572.patch" +} + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + + ./configure --prefix=/usr --with-root-prefix="" --libdir=/usr/lib \ + --sbindir=/usr/bin --enable-elf-shlibs --disable-fsck --disable-uuidd \ + --disable-libuuid --disable-libblkid + + make +} + +package() { + unset MAKEFLAGS + + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install install-libs + + sed -i -e 's/^AWK=.*/AWK=awk/' "${pkgdir}/usr/bin/compile_et" + + # remove references to build directory + sed -i -e 's#^SS_DIR=.*#SS_DIR="/usr/share/ss"#' "${pkgdir}/usr/bin/mk_cmds" + sed -i -e 's#^ET_DIR=.*#ET_DIR="/usr/share/et"#' "${pkgdir}/usr/bin/compile_et" + + # remove static libraries with a shared counterpart + rm "${pkgdir}"/usr/lib/lib{com_err,e2p,ext2fs,ss}.a + + # install MIT license + install -Dm644 "${srcdir}/MIT-LICENSE" \ + "${pkgdir}/usr/share/licenses/${pkgname}/MIT-LICENSE" +} Copied: e2fsprogs/repos/testing-x86_64/e2fsprogs.install (from rev 232410, e2fsprogs/trunk/e2fsprogs.install) =================================================================== --- testing-x86_64/e2fsprogs.install (rev 0) +++ testing-x86_64/e2fsprogs.install 2015-03-02 15:19:09 UTC (rev 232411) @@ -0,0 +1,20 @@ +infodir=usr/share/info +filelist=(libext2fs.info.gz) + +post_install() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info $infodir/$file $infodir/dir 2> /dev/null + done +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info --delete $infodir/$file $infodir/dir 2> /dev/null + done +} Copied: e2fsprogs/repos/testing-x86_64/mke2fs.conf (from rev 232410, e2fsprogs/trunk/mke2fs.conf) =================================================================== --- testing-x86_64/mke2fs.conf (rev 0) +++ testing-x86_64/mke2fs.conf 2015-03-02 15:19:09 UTC (rev 232411) @@ -0,0 +1,26 @@ +[defaults] + base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr + blocksize = 4096 + inode_size = 128 + inode_ratio = 16384 + +[fs_types] + small = { + blocksize = 1024 + inode_size = 128 + inode_ratio = 4096 + } + floppy = { + blocksize = 1024 + inode_size = 128 + inode_ratio = 8192 + } + news = { + inode_ratio = 4096 + } + largefile = { + inode_ratio = 1048576 + } + largefile4 = { + inode_ratio = 4194304 + }