diff --git a/SOURCES/xfsprogs-4.10.0-xfs_metadump-ignore-0-entries.patch b/SOURCES/xfsprogs-4.10.0-xfs_metadump-ignore-0-entries.patch new file mode 100644 index 0000000..7387942 --- /dev/null +++ b/SOURCES/xfsprogs-4.10.0-xfs_metadump-ignore-0-entries.patch @@ -0,0 +1,35 @@ +commit 595629131dbe6c5fb16d03e87bc2cb71ad3dcc4b +Author: Eric Sandeen +Date: Wed Feb 15 21:48:31 2017 -0600 + + xfs_metadump: ignore attr leaf with 0 entries + + Another in the ongoing saga of attribute leaves with zero + entries; in this case, if we try to metadump an inode with + a zero-entries attribute leaf, the zeroing code will go off + the rails and segfault at: + + memset(&entries[nentries], 0, + first_name - (char *)&entries[nentries]); + + because first_name is null, and we try to memset a large + (negative) number. + + Signed-off-by: Eric Sandeen + Reviewed-by: Darrick J. Wong + Signed-off-by: Eric Sandeen + +diff --git a/db/metadump.c b/db/metadump.c +index 38519f1..66952f6 100644 +--- a/db/metadump.c ++++ b/db/metadump.c +@@ -1654,7 +1654,8 @@ process_attr_block( + xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &hdr, leaf); + + nentries = hdr.count; +- if (nentries * sizeof(xfs_attr_leaf_entry_t) + ++ if (nentries == 0 || ++ nentries * sizeof(xfs_attr_leaf_entry_t) + + xfs_attr3_leaf_hdr_size(leaf) > + XFS_ATTR3_RMT_BUF_SPACE(mp, bs)) { + if (show_warnings) diff --git a/SOURCES/xfsprogs-4.9-xfs_io-fix-m-option.patch b/SOURCES/xfsprogs-4.9-xfs_io-fix-m-option.patch new file mode 100644 index 0000000..10bb517 --- /dev/null +++ b/SOURCES/xfsprogs-4.9-xfs_io-fix-m-option.patch @@ -0,0 +1,49 @@ +commit 41c702ce4b2bbea59e49384a90e17c64e46bd3ae +Author: Andreas Gruenbacher +Date: Tue Nov 1 10:38:40 2016 +1100 + + xfs_io: Fix initial -m option + + Like "open -m mode", the initial -m option requires a mode argument. + + Document these options correctly as well. + + Signed-off-by: Andreas Gruenbacher + Reviewed-by: Dave Chinner + Signed-off-by: Dave Chinner + +Index: xfsprogs-4.5.0/io/init.c +=================================================================== +--- xfsprogs-4.5.0.orig/io/init.c ++++ xfsprogs-4.5.0/io/init.c +@@ -32,7 +32,7 @@ void + usage(void) + { + fprintf(stderr, +- _("Usage: %s [-adfmnrRstVx] [-p prog] [-c cmd]... file\n"), ++ _("Usage: %s [-adfnrRstVx] [-m mode] [-p prog] [-c cmd]... file\n"), + progname); + exit(1); + } +@@ -139,7 +139,7 @@ init( + pagesize = getpagesize(); + gettimeofday(&stopwatch, NULL); + +- while ((c = getopt(argc, argv, "ac:dFfmp:nrRstTVx")) != EOF) { ++ while ((c = getopt(argc, argv, "ac:dFfm:p:nrRstTVx")) != EOF) { + switch (c) { + case 'a': + flags |= IO_APPEND; +Index: xfsprogs-4.5.0/io/open.c +=================================================================== +--- xfsprogs-4.5.0.orig/io/open.c ++++ xfsprogs-4.5.0/io/open.c +@@ -759,7 +759,7 @@ open_init(void) + open_cmd.argmin = 0; + open_cmd.argmax = -1; + open_cmd.flags = CMD_NOMAP_OK | CMD_NOFILE_OK | CMD_FOREIGN_OK; +- open_cmd.args = _("[-acdrstxT] [path]"); ++ open_cmd.args = _("[-acdrstxT] [-m mode] [path]"); + open_cmd.oneline = _("open the file specified by path"); + open_cmd.help = open_help; + diff --git a/SPECS/xfsprogs.spec b/SPECS/xfsprogs.spec index 8875de5..01f5d56 100644 --- a/SPECS/xfsprogs.spec +++ b/SPECS/xfsprogs.spec @@ -1,7 +1,7 @@ Summary: Utilities for managing the XFS filesystem Name: xfsprogs Version: 4.5.0 -Release: 10%{?dist} +Release: 12%{?dist} # Licensing based on generic "GNU GENERAL PUBLIC LICENSE" # in source, with no mention of version. # doc/COPYING file specifies what is GPL and what is LGPL @@ -34,6 +34,8 @@ Patch10: xfsprogs-4.8.0-replace-ustat.patch Patch11: xfsprogs-revert-off64_t.patch Patch12: xfsprogs-4.9.0-junk-attr-leaf-count-zero.patch Patch13: xfsprogs-4.8.0-xfs_copy-UUID.patch +Patch14: xfsprogs-4.10.0-xfs_metadump-ignore-0-entries.patch +Patch15: xfsprogs-4.9-xfs_io-fix-m-option.patch %description A set of commands to use the XFS filesystem, including mkfs.xfs. @@ -78,6 +80,8 @@ also want to install xfsprogs. %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 +%patch15 -p1 %build export tagname=CC @@ -143,8 +147,14 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/*.so %changelog -* Mon May 15 2017 Eric Sandeen 4.5.0-10 -- xfs_copy: Fix meta UUID handling on multiple copies (#1377931, #1450875) +* Tue May 09 2017 Eric Sandeen 4.5.0-12 +- xfs_io: Fix initial -m option (#1447270) + +* Mon Mar 27 2017 Eric Sandeen 4.5.0-11 +- xfs_metadump: ignore attr leaf with 0 entries (#1402944) + +* Wed Mar 01 2017 Eric Sandeen 4.5.0-10 +- xfs_copy: Fix meta UUID handling on multiple copies (#1377931) * Fri Dec 16 2016 Eric Sandeen 4.5.0-9 - xfs_repair: junk leaf attribute if count == 0 (#1402944)