Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Mar 2020 09:42:54 +0000 (UTC)
From:      Matthias Andree <mandree@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r528964 - in head/sysutils/e2fsprogs: . files
Message-ID:  <202003230942.02N9gsZr029673@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mandree
Date: Mon Mar 23 09:42:54 2020
New Revision: 528964
URL: https://svnweb.freebsd.org/changeset/ports/528964

Log:
  sysutils/e2fsprogs: Update to 1.45.6
  
  Add three patches (one was extended) by Ted Y. Ts'o to fix various
  issues (loff_t and type related).
  
  Drop our own obsolete patches.
  
  While here, drop obsolete parts of some of our patches
  (malloc.h -> stdlib.h).
  
  Since the online release notes are not available yet,
  this is from doc/RelNotes/v1.45.6.txt, omitting Linux-/Hurd-specifics.
  
  UI and Features
  ---------------
  Debugfs will ignore lines in its command files which start with a
  comment character ("#").
  
  Fixes
  -----
  Fixed a number of potential out of bounds memory accesses caused by
  fuzzed / malicious file systems.  (Addresses Google Bug: #147849134)
  
  Fix a spurious complaint from e2fsck when a directory which previously
  had more than 32000 subdirectories has the number of subdirectories
  drops below 32000.
  
  Mke2fs -d now correctly sets permission with files where the owner
  permissions are not rwx.
  
  Improve e2fsck's ability to deal with file systems with very large
  number of directories, such that various data structures take more than
  2GiB of memory.  Use better structure packing to improve the memory
  efficiency of these data structures.
  
  Fix debugfs so it correctly prints inode numbers > 2**31.
  
  Filefrag now supports very large files (with > 4 billion blocks), as
  well as block sizes up to 1 GiB.
  
  Updated and clarified various man pages.  (Addresses Debian Bugs:
  #953493, #953494, #951808)
  
  Performance, Internal Implementation, Development Support etc.
  --------------------------------------------------------------
  Reserved the error code EXT2_ET_NO_GDESC (which will be used in
  e2fsprogs v1.46+)
  
  Added a thread-safe variant of e2p_feature2string(),
  e2p_feature_to_string() to the libe2p library.
  
  Fixed portability problems caused by gcc 10.
  
  Synchronized changes from Android's AOSP e2fsprogs tree.
  
  Update the Malay translation from the translation project.
  
  Obtained from:	tytso@mit.edu (files/patch-0-tytso*)
  MFH:		2020Q1

Added:
  head/sysutils/e2fsprogs/files/patch-0-tytso-1-Use-ext2_loff_t-instead-of-loff_t.patch   (contents, props changed)
  head/sysutils/e2fsprogs/files/patch-0-tytso-2-e2fsck-fix-various-gcc-Wall-nits.patch   (contents, props changed)
  head/sysutils/e2fsprogs/files/patch-0-tytso-3-tests-use-grep-E-for-better-portability-in-r_inline_.patch   (contents, props changed)
  head/sysutils/e2fsprogs/files/patch-misc_e2fuzz.c   (contents, props changed)
Deleted:
  head/sysutils/e2fsprogs/files/patch-lib_ext2fs_swapfs.c
  head/sysutils/e2fsprogs/files/patch-tests_r__inline__xattr_script
Modified:
  head/sysutils/e2fsprogs/Makefile
  head/sysutils/e2fsprogs/distinfo
  head/sysutils/e2fsprogs/files/patch-e2fsck__unix.c
  head/sysutils/e2fsprogs/files/patch-lib__uuid__gen_uuid.c

Modified: head/sysutils/e2fsprogs/Makefile
==============================================================================
--- head/sysutils/e2fsprogs/Makefile	Mon Mar 23 09:32:13 2020	(r528963)
+++ head/sysutils/e2fsprogs/Makefile	Mon Mar 23 09:42:54 2020	(r528964)
@@ -2,8 +2,8 @@
 # $FreeBSD$
 
 PORTNAME=	e2fsprogs
-PORTVERSION=	1.45.5
-PORTREVISION?=	4
+PORTVERSION=	1.45.6
+PORTREVISION?=	0
 CATEGORIES?=	sysutils
 MASTER_SITES=	KERNEL_ORG/linux/kernel/people/tytso/${PORTNAME}/v${PORTVERSION}
 

Modified: head/sysutils/e2fsprogs/distinfo
==============================================================================
--- head/sysutils/e2fsprogs/distinfo	Mon Mar 23 09:32:13 2020	(r528963)
+++ head/sysutils/e2fsprogs/distinfo	Mon Mar 23 09:42:54 2020	(r528964)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1578494654
-SHA256 (e2fsprogs-1.45.5.tar.xz) = f9faccc0d90f73556e797dc7cc5979b582bd50d3f8609c0f2ad48c736d44aede
-SIZE (e2fsprogs-1.45.5.tar.xz) = 5569796
+TIMESTAMP = 1584954798
+SHA256 (e2fsprogs-1.45.6.tar.xz) = ffa7ae6954395abdc50d0f8605d8be84736465afc53b8938ef473fcf7ff44256
+SIZE (e2fsprogs-1.45.6.tar.xz) = 5572144

Added: head/sysutils/e2fsprogs/files/patch-0-tytso-1-Use-ext2_loff_t-instead-of-loff_t.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/e2fsprogs/files/patch-0-tytso-1-Use-ext2_loff_t-instead-of-loff_t.patch	Mon Mar 23 09:42:54 2020	(r528964)
@@ -0,0 +1,72 @@
+The patch was provided by Ted Y. Ts'o, with the final loff_t ->
+ext2_loff_t manually added by mandree@FreeBSD.org
+--------------
+
+From 3fab0b6872b74ae0efab1ebdc6318924fda5f3a5 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sun, 22 Mar 2020 23:30:14 -0400
+Subject: [PATCH 1/3] Use ext2_loff_t instead of loff_t
+
+The loff_t type is a glibc'ism and is not fully portable.  Use
+ext2_loff_t instead.
+
+Fixes: 382ed4a1c2b6 ("e2fsck: use proper types for variables")
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Reported-by: Matthias Andree <matthias.andree@gmx.de>
+---
+ lib/ext2fs/imager.c | 2 +-
+ misc/e2fuzz.c       | 9 +++++----
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/lib/ext2fs/imager.c b/lib/ext2fs/imager.c
+index b3ede9a8..1aebe625 100644
+--- ./lib/ext2fs/imager.c
++++ b/lib/ext2fs/imager.c
+@@ -67,7 +67,7 @@ errcode_t ext2fs_image_inode_write(ext2_filsys fs, int fd, int flags)
+ 	blk64_t		blk;
+ 	ssize_t		actual;
+ 	errcode_t	retval;
+-	loff_t		r;
++	ext2_loff_t	r;
+ 
+ 	buf = malloc(fs->blocksize * BUF_BLOCKS);
+ 	if (!buf)
+diff --git a/misc/e2fuzz.c b/misc/e2fuzz.c
+index 7c0f776f..f22c9f32 100644
+--- ./misc/e2fuzz.c
++++ b/misc/e2fuzz.c
+@@ -33,9 +33,10 @@ static unsigned long long user_corrupt_bytes = 0;
+ static double user_corrupt_pct = 0.0;
+ 
+ #if !defined HAVE_PWRITE64 && !defined HAVE_PWRITE
+-static ssize_t my_pwrite(int fd, const void *buf, size_t count, off_t offset)
++static ssize_t my_pwrite(int fd, const void *buf, size_t count,
++			 ext2_loff_t offset)
+ {
+-	if (lseek(fd, offset, SEEK_SET) < 0)
++	if (ext2fs_llseek(fd, offset, SEEK_SET) < 0)
+ 		return 0;
+ 
+ 	return write(fd, buf, count);
+@@ -82,7 +83,7 @@ static int find_block_helper(ext2_filsys fs EXT2FS_ATTR((unused)),
+ }
+ 
+ static errcode_t find_metadata_blocks(ext2_filsys fs, ext2fs_block_bitmap bmap,
+-				      off_t *corrupt_bytes)
++				      ext2_loff_t *corrupt_bytes)
+ {
+ 	dgrp_t i;
+ 	blk64_t b, c;
+@@ -181,7 +182,7 @@ static int process_fs(const char *fsname)
+ 	int flags, fd;
+ 	ext2_filsys fs = NULL;
+ 	ext2fs_block_bitmap corrupt_map;
+-	loff_t hsize, count, off, offset, corrupt_bytes;
++	ext2_loff_t hsize, count, off, offset, corrupt_bytes;
+ 	unsigned char c;
+-	loff_t i;
++	ext2_loff_t i;
+ 
+-- 
+2.24.1
+

Added: head/sysutils/e2fsprogs/files/patch-0-tytso-2-e2fsck-fix-various-gcc-Wall-nits.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/e2fsprogs/files/patch-0-tytso-2-e2fsck-fix-various-gcc-Wall-nits.patch	Mon Mar 23 09:42:54 2020	(r528964)
@@ -0,0 +1,72 @@
+From ef858c7194ff6f3dc0de162fe7bd82a8cb5e8fba Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sun, 22 Mar 2020 23:47:12 -0400
+Subject: [PATCH 2/3] e2fsck: fix various gcc -Wall nits
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+---
+ e2fsck/rehash.c | 4 ++--
+ e2fsck/unix.c   | 2 +-
+ e2fsck/util.c   | 4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c
+index 1616d07a..30e510a6 100644
+--- ./e2fsck/rehash.c
++++ b/e2fsck/rehash.c
+@@ -109,7 +109,7 @@ static int fill_dir_block(ext2_filsys fs,
+ 			  void *priv_data)
+ {
+ 	struct fill_dir_struct	*fd = (struct fill_dir_struct *) priv_data;
+-	struct hash_entry 	*new_array, *ent;
++	struct hash_entry 	*ent;
+ 	struct ext2_dir_entry 	*dirent;
+ 	char			*dir;
+ 	unsigned int		offset, dir_offset, rec_len, name_len;
+@@ -460,7 +460,7 @@ static errcode_t copy_dir_entries(e2fsck_t ctx,
+ 	struct hash_entry 	*ent;
+ 	struct ext2_dir_entry	*dirent;
+ 	unsigned int		rec_len, prev_rec_len, left, slack, offset;
+-	int			i;
++	blk_t			i;
+ 	ext2_dirhash_t		prev_hash;
+ 	int			csum_size = 0;
+ 	struct			ext2_dir_entry_tail *t;
+diff --git a/e2fsck/unix.c b/e2fsck/unix.c
+index e71d7833..1b7ccea9 100644
+--- ./e2fsck/unix.c
++++ b/e2fsck/unix.c
+@@ -1439,7 +1439,7 @@ int main (int argc, char *argv[])
+ 		fputs("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
+ 		      ctx->problem_logf);
+ 		fprintf(ctx->problem_logf, "<problem_log time=\"%lu\">\n",
+-			ctx->now);
++			(unsigned long) ctx->now);
+ 		fprintf(ctx->problem_logf, "<invocation prog=\"%s\"",
+ 			argv[0]);
+ 		for (i = 1; i < argc; i++)
+diff --git a/e2fsck/util.c b/e2fsck/util.c
+index d98b8e47..8cebd95a 100644
+--- ./e2fsck/util.c
++++ b/e2fsck/util.c
+@@ -126,7 +126,7 @@ void *e2fsck_allocate_memory(e2fsck_t ctx, unsigned long size,
+ 	printf("Allocating %u bytes for %s...\n", size, description);
+ #endif
+ 	if (ext2fs_get_memzero(size, &ret)) {
+-		sprintf(buf, "Can't allocate %u bytes for %s\n",
++		sprintf(buf, "Can't allocate %lu bytes for %s\n",
+ 			size, description);
+ 		fatal_error(ctx, buf);
+ 	}
+@@ -436,7 +436,7 @@ void print_resource_track(e2fsck_t ctx, const char *desc,
+ #define kbytes(x)	(((unsigned long long)(x) + 1023) / 1024)
+ #ifdef HAVE_MALLINFO
+ 	/* don't use mallinfo() if over 2GB used, since it returns "int" */
+-	if ((char *)sbrk(0) - (char *)track->brk_start < 2ULL << 30) {
++	if ((char *)sbrk(0) - (char *)track->brk_start < 2LL << 30) {
+ 		struct mallinfo	malloc_info = mallinfo();
+ 
+ 		log_out(ctx, _("Memory used: %lluk/%lluk (%lluk/%lluk), "),
+-- 
+2.24.1
+

Added: head/sysutils/e2fsprogs/files/patch-0-tytso-3-tests-use-grep-E-for-better-portability-in-r_inline_.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/e2fsprogs/files/patch-0-tytso-3-tests-use-grep-E-for-better-portability-in-r_inline_.patch	Mon Mar 23 09:42:54 2020	(r528964)
@@ -0,0 +1,64 @@
+From e3b002dcc43364972275fe32438af299dd6629a0 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sun, 22 Mar 2020 23:56:14 -0400
+Subject: [PATCH 3/3] tests: use grep -E for better portability in
+ r_inline_xattr
+
+Since r_inline_xattr is using an extended regexp, we need grep -E on
+some implementations of grep.
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+---
+ tests/r_inline_xattr/expect | 4 ++--
+ tests/r_inline_xattr/script | 8 ++++----
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/tests/r_inline_xattr/expect b/tests/r_inline_xattr/expect
+index 885de59d..773db102 100644
+--- ./tests/r_inline_xattr/expect
++++ b/tests/r_inline_xattr/expect
+@@ -1,5 +1,5 @@
+ resize2fs test
+-debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|user.name (''
++debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \(''
+ Inode: 1550   Type: regular    Mode:  0644   Flags: 0x0
+   user.name (11) = "propervalue"
+ Exit status is 0
+@@ -8,7 +8,7 @@ Resizing the filesystem on test.img to 5120 (1k) blocks.
+ The filesystem on test.img is now 5120 (1k) blocks long.
+ 
+ Exit status is 0
+-debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|user.name (''
++debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \(''
+ Inode: 12   Type: regular    Mode:  0644   Flags: 0x0
+   user.name (11) = "propervalue"
+ Exit status is 0
+diff --git a/tests/r_inline_xattr/script b/tests/r_inline_xattr/script
+index 4e7dd94c..2f754e60 100644
+--- ./tests/r_inline_xattr/script
++++ b/tests/r_inline_xattr/script
+@@ -13,8 +13,8 @@ gunzip < $IMAGE > $TMPFILE
+ echo "resize2fs test" > $OUT.new
+ 
+ # Look at existing inline extended attribute
+-echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|user.name (''" >> $OUT.new
+-$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|user.name (" >> $OUT.new
++echo "debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \\(''" >> $OUT.new
++$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep -E "^Inode|in inode body|user.name \(" >> $OUT.new
+ status=$?
+ echo Exit status is $status >> $OUT.new
+ 
+@@ -25,8 +25,8 @@ status=$?
+ echo Exit status is $status >> $OUT.new
+ 
+ # Look at inline extended attribute in resized fs
+-echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|user.name (''" >> $OUT.new
+-$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|user.name (" >> $OUT.new
++echo "debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \\(''" >> $OUT.new
++$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep -E "^Inode|in inode body|user.name \(" >> $OUT.new
+ status=$?
+ echo Exit status is $status >> $OUT.new
+ 
+-- 
+2.24.1
+

Modified: head/sysutils/e2fsprogs/files/patch-e2fsck__unix.c
==============================================================================
--- head/sysutils/e2fsprogs/files/patch-e2fsck__unix.c	Mon Mar 23 09:32:13 2020	(r528963)
+++ head/sysutils/e2fsprogs/files/patch-e2fsck__unix.c	Mon Mar 23 09:42:54 2020	(r528964)
@@ -1,4 +1,4 @@
---- e2fsck/unix.c.orig	2019-07-15 01:03:14 UTC
+--- e2fsck/unix.c.orig	2020-03-21 04:24:04 UTC
 +++ e2fsck/unix.c
 @@ -9,8 +9,6 @@
   * %End-Header%
@@ -9,15 +9,6 @@
  #include "config.h"
  #include <stdio.h>
  #ifdef HAVE_STDLIB_H
-@@ -37,7 +35,7 @@ extern int optind;
- #include <sys/ioctl.h>
- #endif
- #ifdef HAVE_MALLOC_H
--#include <malloc.h>
-+#include <stdlib.h>
- #endif
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
 @@ -602,6 +600,24 @@ static int e2fsck_update_progress(e2fsck_t ctx, int pa
  	return 0;
  }

Modified: head/sysutils/e2fsprogs/files/patch-lib__uuid__gen_uuid.c
==============================================================================
--- head/sysutils/e2fsprogs/files/patch-lib__uuid__gen_uuid.c	Mon Mar 23 09:32:13 2020	(r528963)
+++ head/sysutils/e2fsprogs/files/patch-lib__uuid__gen_uuid.c	Mon Mar 23 09:42:54 2020	(r528964)
@@ -1,4 +1,4 @@
---- lib/uuid/gen_uuid.c.orig	2018-03-25 02:42:47 UTC
+--- lib/uuid/gen_uuid.c.orig	2020-03-21 04:24:04 UTC
 +++ lib/uuid/gen_uuid.c
 @@ -94,6 +94,7 @@
  #ifdef HAVE_SYS_RESOURCE_H
@@ -8,7 +8,7 @@
  
  #include "uuidP.h"
  #include "uuidd.h"
-@@ -300,6 +301,28 @@ static int get_node_id(unsigned char *no
+@@ -300,6 +301,28 @@ static int get_node_id(unsigned char *node_id)
  		}
  	}
  	close(sd);
@@ -37,3 +37,21 @@
  #endif
  	return 0;
  }
+@@ -484,7 +507,7 @@ static void close_all_fds(void)
+ }
+ #endif /* defined(USE_UUIDD) && defined(HAVE_SYS_UN_H) */
+ 
+-#if __GNUC_PREREQ (4, 6)
++#if __GNUC_PREREQ__ (4, 6)
+ #pragma GCC diagnostic push
+ #if !defined(USE_UUIDD) || !defined(HAVE_SYS_UN_H)
+ #pragma GCC diagnostic ignored "-Wunused-parameter"
+@@ -572,7 +595,7 @@ fail:
+ #endif
+ 	return -1;
+ }
+-#if __GNUC_PREREQ (4, 6)
++#if __GNUC_PREREQ__ (4, 6)
+ #pragma GCC diagnostic pop
+ #endif
+ 

Added: head/sysutils/e2fsprogs/files/patch-misc_e2fuzz.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/e2fsprogs/files/patch-misc_e2fuzz.c	Mon Mar 23 09:42:54 2020	(r528964)
@@ -0,0 +1,13 @@
+--- misc/e2fuzz.c.orig	2020-03-23 08:29:36 UTC
++++ misc/e2fuzz.c
+@@ -278,8 +278,8 @@ static int process_fs(const char *fsname)
+ 			c |= 0x80;
+ 		if (verbose)
+ 			printf("Corrupting byte %lld in block %lld to 0x%x\n",
+-			       off % fs->blocksize,
+-			       off / fs->blocksize, c);
++			       (long long)off % fs->blocksize,
++			       (long long)off / fs->blocksize, c);
+ 		if (dryrun)
+ 			continue;
+ #ifdef HAVE_PWRITE64



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003230942.02N9gsZr029673>