From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: tytso@mit.edu, darrick.wong@oracle.com
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH 01/19] e2fuzz: fix fs handle cleanup when closing fails
Date: Fri, 01 Aug 2014 11:11:46 -0700 [thread overview]
Message-ID: <20140801181146.12496.33396.stgit@birch.djwong.org> (raw)
In-Reply-To: <20140801181139.12496.14390.stgit@birch.djwong.org>
From: Darrick J. Wong <darrick.wong@oracle.com>
Fix the handling of 'fs' when closing the FS fails so that we don't
dereference a NULL pointer. Adapt to use ext2fs_close_free while
we're at it.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Fixes-Coverity-Bug: 1229241
---
misc/e2fuzz.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/misc/e2fuzz.c b/misc/e2fuzz.c
index 644c9c5..8c989dd 100644
--- a/misc/e2fuzz.c
+++ b/misc/e2fuzz.c
@@ -279,23 +279,20 @@ int process_fs(const char *fsname)
close(fd);
/* Clean up */
- ret = ext2fs_close(fs);
+ ret = ext2fs_close_free(&fs);
if (ret) {
- fs = NULL;
fprintf(stderr, "%s: error while closing filesystem\n",
fsname);
- goto fail2;
+ return 1;
}
return 0;
fail3:
close(fd);
-fail2:
if (corrupt_map != fs->block_map)
ext2fs_free_block_bitmap(corrupt_map);
fail:
- if (fs)
- ext2fs_close(fs);
+ ext2fs_close_free(&fs);
return 1;
}
next prev parent reply other threads:[~2014-08-01 18:11 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 18:11 [PATCH 00/19] e2fsprogs patchbomb 7/14, part 2.1 Darrick J. Wong
2014-08-01 18:11 ` Darrick J. Wong [this message]
2014-08-03 2:22 ` [PATCH 01/19] e2fuzz: fix fs handle cleanup when closing fails Theodore Ts'o
2014-08-01 18:11 ` [PATCH 02/19] e2fsck: never free critical metadata blocks in the block found map Darrick J. Wong
2014-08-03 2:22 ` Theodore Ts'o
2014-08-01 18:11 ` [PATCH 03/19] e2fsck: use root dir for lost+found when really desperate Darrick J. Wong
2014-08-03 2:25 ` Theodore Ts'o
2014-08-05 0:58 ` Darrick J. Wong
2014-08-05 2:06 ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 04/19] dumpe2fs: complain when checksum verification fails Darrick J. Wong
2014-08-03 2:26 ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 05/19] libext2fs: check EA block headers when reading in the block Darrick J. Wong
2014-08-03 2:33 ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 06/19] e2fsck: try to salvage extent blocks with bad checksums Darrick J. Wong
2014-08-03 2:33 ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 07/19] e2fsck: try to salvage corrupt directory entry blocks Darrick J. Wong
2014-08-03 2:33 ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 08/19] e2fsck: offer to clear inode table blocks that are insane Darrick J. Wong
2014-08-03 2:46 ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 09/19] e2fsck: correctly preserve fs flags when modifying ignore-csum-error flag Darrick J. Wong
2014-08-03 2:48 ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 10/19] libext2fs: Don't cache inodes that fail checksum verification Darrick J. Wong
2014-08-03 2:50 ` Theodore Ts'o
2014-08-01 18:12 ` [PATCH 11/19] e2fsck: disable checksum verification in a few select places Darrick J. Wong
2014-08-03 2:51 ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 12/19] e2fsck: always ask to fix an inode that fails checksum verification Darrick J. Wong
2014-08-03 2:55 ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 13/19] tests: add regression tests for EA blocks with bad checksums Darrick J. Wong
2014-08-03 3:42 ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 14/19] tests: add tests for handling of corrupt extents Darrick J. Wong
2014-08-03 3:47 ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 15/19] tests: add tests for directory entry blocks with checksum errors Darrick J. Wong
2014-08-03 3:49 ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 16/19] tests: add regression tests for MMP blocks with bad checksums Darrick J. Wong
2014-08-03 3:49 ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 17/19] tests: add regression tests for superblocks " Darrick J. Wong
2014-08-03 3:50 ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 18/19] tests: add regression tests for group descriptors " Darrick J. Wong
2014-08-03 3:51 ` Theodore Ts'o
2014-08-01 18:13 ` [PATCH 19/19] tests: add regression tests for inodes " Darrick J. Wong
2014-08-03 3:52 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140801181146.12496.33396.stgit@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).