Browse Source

initial package creation

Signed-off-by: Toshaan Bharvani <toshaan@powerel.org>
master
Toshaan Bharvani 1 year ago
commit
083bc250d4
  1. 39
      SOURCES/0001-Remove-local-PATH.patch
  2. 133
      SOURCES/0002-man-Add-note-about-RHEL9-supported-features-and-moun.patch
  3. 38
      SOURCES/0003-mke2fs.conf-Introduce-rhel6-rhel7-and-rhel8-fs_type.patch
  4. 57
      SOURCES/e2fsprogs-libext2fs-add-sanity-check-to-extent-manipulation.patch
  5. 7161
      SOURCES/tytso-key.asc
  6. 1109
      SPECS/e2fsprogs.spec

39
SOURCES/0001-Remove-local-PATH.patch

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
From e788b8ae43e176221c6d5c4a20e6ca7b4198ac45 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Fri, 2 Jul 2021 11:56:02 +0200
Subject: [PATCH 1/4] Remove local PATH

---
scrub/e2scrub.in | 2 +-
scrub/e2scrub_all.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scrub/e2scrub.in b/scrub/e2scrub.in
index 30ab7cbd..bfca1ce4 100644
--- a/scrub/e2scrub.in
+++ b/scrub/e2scrub.in
@@ -23,7 +23,7 @@
# check filesystems in VGs that have at least 256MB (or so) of
# free space.
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
if (( $EUID != 0 )); then
echo "e2scrub must be run as root"
diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in
index 4288b969..606ac254 100644
--- a/scrub/e2scrub_all.in
+++ b/scrub/e2scrub_all.in
@@ -18,7 +18,7 @@
# along with this program; if not, write the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
if (( $EUID != 0 )); then
echo "e2scrub_all must be run as root"
--
2.31.1

133
SOURCES/0002-man-Add-note-about-RHEL9-supported-features-and-moun.patch

@ -0,0 +1,133 @@ @@ -0,0 +1,133 @@
From 149067bb91ba7b3be60a1cdd326ae253176816c6 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Wed, 18 Dec 2019 11:03:37 +0100
Subject: [PATCH 3/4] man: Add note about RHEL9 supported features and mount
options

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
misc/ext4.5.in | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
misc/mke2fs.8.in | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+)

diff --git a/misc/ext4.5.in b/misc/ext4.5.in
index 1db61a5f..634a6f51 100644
--- a/misc/ext4.5.in
+++ b/misc/ext4.5.in
@@ -19,6 +19,54 @@ previously intended for use with the ext2 and ext3 file systems can be
mounted using the ext4 file system driver, and indeed in many modern
Linux distributions, the ext4 file system driver has been configured
to handle mount requests for ext2 and ext3 file systems.
+.SH RED HAT ENTERPRISE LINUX 9
+The Ext4 file system is fully supported by Red Hat when using default
+mke2fs and mount options. In addition, the following non-default mke2fs
+features and mount options are also fully supported.
+.SH "Non-default features:"
+project
+.br
+quota
+.br
+mmp
+.br
+.SH "Non-default mount options:"
+bsddf|minixdf
+.br
+grpid|bsdgroups and nogrpid|sysvgroups
+.br
+resgid=n and resuid=n
+.br
+errors={continue|remount-ro|panic}
+.br
+commit=nrsec
+.br
+max_batch_time=usec
+.br
+min_batch_time=usec
+.br
+grpquota|noquota|quota|usrquota
+.br
+prjquota
+.br
+dax
+.br
+lazytime|nolazytime
+.br
+discard|nodiscard
+.br
+init_itable|noinit_itable
+.br
+jqfmt={vfsold|vfsv0|vfsv1}
+.br
+usrjquota=aquota.user|grpjquota=aquota.group
+.PP
+For more information on features and mount options, see the
+.BR ext4
+man page. Ext4 features and mount options not listed above may not be
+fully supported by Red Hat. If your workload requires a feature or mount
+option that is not fully in this Red Hat release, contact Red Hat support
+to evaluate it for inclusion in our supported list.
.SH FILE SYSTEM FEATURES
A file system formatted for ext2, ext3, or ext4 can have some
collection of the following file system feature flags enabled. Some of
diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in
index e6bfc6d6..b4d44af5 100644
--- a/misc/mke2fs.8.in
+++ b/misc/mke2fs.8.in
@@ -204,6 +204,54 @@ overridden by the options listed below, are controlled by the
configuration file. See the
.BR mke2fs.conf (5)
manual page for more details.
+.SH RED HAT ENTERPRISE LINUX 9
+The Ext4 file system is fully supported by Red Hat when using default
+mke2fs and mount options. In addition, the following non-default mke2fs
+features and mount options are also fully supported.
+.SH "Non-default features:"
+project
+.br
+quota
+.br
+mmp
+.br
+.SH "Non-default mount options:"
+bsddf|minixdf
+.br
+grpid|bsdgroups and nogrpid|sysvgroups
+.br
+resgid=n and resuid=n
+.br
+errors={continue|remount-ro|panic}
+.br
+commit=nrsec
+.br
+max_batch_time=usec
+.br
+min_batch_time=usec
+.br
+grpquota|noquota|quota|usrquota
+.br
+prjquota
+.br
+dax
+.br
+lazytime|nolazytime
+.br
+discard|nodiscard
+.br
+init_itable|noinit_itable
+.br
+jqfmt={vfsold|vfsv0|vfsv1}
+.br
+usrjquota=aquota.user|grpjquota=aquota.group
+.PP
+For more information on features and mount options, see the
+.BR ext4
+man page. Ext4 features and mount options not listed above may not be
+fully supported by Red Hat. If your workload requires a feature or mount
+option that is not fully in this Red Hat release, contact Red Hat support
+to evaluate it for inclusion in our supported list.
.SH OPTIONS
.TP
.BI \-b " block-size"
--
2.31.1

38
SOURCES/0003-mke2fs.conf-Introduce-rhel6-rhel7-and-rhel8-fs_type.patch

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
From bab98a0c110b6351634547821c337c2c26167061 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Tue, 17 Dec 2019 11:24:31 +0100
Subject: [PATCH] mke2fs.conf: Introduce rhel6, rhel7 and rhel8 fs_type

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
misc/mke2fs.conf.in | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in
index 05680992..b3345862 100644
--- a/misc/mke2fs.conf.in
+++ b/misc/mke2fs.conf.in
@@ -13,6 +13,20 @@
ext4 = {
features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize
}
+ rhel6_ext4 = {
+ features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
+ inode_size = 256
+ enable_periodic_fsck = 1
+ default_mntopts = ""
+ }
+ rhel7_ext4 = {
+ features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,64bit
+ inode_size = 256
+ }
+ rhel8_ext4 = {
+ features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize
+ inode_size = 256
+ }
small = {
blocksize = 1024
inode_ratio = 4096
--
2.31.1

57
SOURCES/e2fsprogs-libext2fs-add-sanity-check-to-extent-manipulation.patch

@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
From ff6679208f45975a090b1260367f1fc5a17b3db7 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Thu, 21 Apr 2022 19:31:48 +0200
Subject: [PATCH] libext2fs: add sanity check to extent manipulation
Content-Type: text/plain

It is possible to have a corrupted extent tree in such a way that a leaf
node contains zero extents in it. Currently if that happens and we try
to traverse the tree we can end up accessing wrong data, or possibly
even uninitialized memory. Make sure we don't do that.

Additionally make sure that we have a sane number of bytes passed to
memmove() in ext2fs_extent_delete().

Note that e2fsck is currently unable to spot and fix such corruption in
pass1.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Nils Bars <nils_bars@t-online.de>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2068113
Addresses: CVE-2022-1304
Addresses-Debian-Bug: #1010263
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit ab51d587bb9b229b1fade1afd02e1574c1ba5c76)
---
lib/ext2fs/extent.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c
index b324c7b0..1a206a16 100644
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -495,6 +495,10 @@ retry:
ext2fs_le16_to_cpu(eh->eh_entries);
newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);
+ /* Make sure there is at least one extent present */
+ if (newpath->left <= 0)
+ return EXT2_ET_EXTENT_NO_DOWN;
+
if (path->left > 0) {
ix++;
newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);
@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags)
cp = path->curr;
+ /* Sanity check before memmove() */
+ if (path->left < 0)
+ return EXT2_ET_EXTENT_LEAF_BAD;
+
if (path->left) {
memmove(cp, cp + sizeof(struct ext3_extent_idx),
path->left * sizeof(struct ext3_extent_idx));
--
2.35.3

7161
SOURCES/tytso-key.asc

File diff suppressed because it is too large Load Diff

1109
SPECS/e2fsprogs.spec

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save