lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200110085217.GA7307@yogzotot>
Date:   Fri, 10 Jan 2020 11:52:17 +0300
From:   Anatoly Pugachev <matorola@...il.com>
To:     linux-ext4@...r.kernel.org
Cc:     Theodore Ts'o <tytso@....edu>
Subject: [PATCH] libext2fs: Extends commit c9a8c53b, with the same fix for
 ext2fs_flush2() and ext2fs_image_super_write() on a Big Endian systems.


libext2fs: extends commit c9a8c53b, with the same fix for ext2fs_flush2() and
ext2fs_image_super_write() on a Big Endian systems.

As follow-up to previous discussion 'dumpe2fs / mke2fs sigserv on sparc64'

Used find for files which refer to:

e2fsprogs.git$ find . -name \*.c | xargs grep -cl 'gdp = ext2fs_group_desc'
./lib/ext2fs/closefs.c
./lib/ext2fs/openfs.c
./lib/ext2fs/imager.c

And applied the same check for a null pointer.

Tested on a debian linux with sparc64 LDOM and ppc64 LPAR.

Fixes sigserv with test suite in "i_bitmaps" test.

Signed-off-by: Anatoly Pugachev <matorola@...il.com>
Signed-off-by: Theodore Ts'o <tytso@....edu>
---
 lib/ext2fs/closefs.c | 3 ++-
 lib/ext2fs/imager.c  | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c
index 1d4d5b7f..58fdd5c6 100644
--- a/lib/ext2fs/closefs.c
+++ b/lib/ext2fs/closefs.c
@@ -339,7 +339,8 @@ errcode_t ext2fs_flush2(ext2_filsys fs, int flags)
 	ext2fs_swap_super(super_shadow);
 	for (j = 0; j < fs->group_desc_count; j++) {
 		gdp = ext2fs_group_desc(fs, group_shadow, j);
-		ext2fs_swap_group_desc2(fs, gdp);
+		if (gdp)
+			ext2fs_swap_group_desc2(fs, gdp);
 	}
 #else
 	super_shadow = fs->super;
diff --git a/lib/ext2fs/imager.c b/lib/ext2fs/imager.c
index 7fd06f74..b40fd826 100644
--- a/lib/ext2fs/imager.c
+++ b/lib/ext2fs/imager.c
@@ -245,7 +245,8 @@ errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd,
 	gdp = (struct ext2_group_desc *) cp;
 	for (j=0; j < groups_per_block*fs->desc_blocks; j++) {
 		gdp = ext2fs_group_desc(fs, fs->group_desc, j);
-		ext2fs_swap_group_desc2(fs, gdp);
+		if (gdp)
+			ext2fs_swap_group_desc2(fs, gdp);
 	}
 #endif
 
@@ -257,7 +258,8 @@ errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd,
 	gdp = (struct ext2_group_desc *) cp;
 	for (j=0; j < groups_per_block*fs->desc_blocks; j++) {
 		gdp = ext2fs_group_desc(fs, fs->group_desc, j);
-		ext2fs_swap_group_desc2(fs, gdp);
+		if (gdp)
+			ext2fs_swap_group_desc2(fs, gdp);
 	}
 #endif
 
-- 
2.25.0.rc1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ