From: Adam Buchbinder <abuchbinder@google.com>
To: linux-ext4@vger.kernel.org
Cc: Adam Buchbinder <abuchbinder@google.com>
Subject: [PATCH v2 2/2] tests: dumpe2fs against an image with bad os_type.
Date: Tue, 18 Jul 2017 14:48:23 -0700 [thread overview]
Message-ID: <20170718214823.22649-3-abuchbinder@google.com> (raw)
In-Reply-To: <20170718214823.22649-1-abuchbinder@google.com>
The os_type here is large enough to be negative when interpreted as a
signed integer.
This test case was generated by american fuzzy lop, starting from a
base filesystem image from files.fuzzing-project.org.
Signed-off-by: Adam Buchbinder <abuchbinder@google.com>
---
tests/d_bad_ostype/expect | 1 +
tests/d_bad_ostype/name | 1 +
tests/d_bad_ostype/script | 21 +++++++++++++++++++++
3 files changed, 23 insertions(+)
create mode 100644 tests/d_bad_ostype/expect
create mode 100644 tests/d_bad_ostype/name
create mode 100644 tests/d_bad_ostype/script
diff --git a/tests/d_bad_ostype/expect b/tests/d_bad_ostype/expect
new file mode 100644
index 00000000..b00318c4
--- /dev/null
+++ b/tests/d_bad_ostype/expect
@@ -0,0 +1 @@
+Filesystem OS type: (unknown os)
diff --git a/tests/d_bad_ostype/name b/tests/d_bad_ostype/name
new file mode 100644
index 00000000..3da887a8
--- /dev/null
+++ b/tests/d_bad_ostype/name
@@ -0,0 +1 @@
+handle bad (negative) os_type
diff --git a/tests/d_bad_ostype/script b/tests/d_bad_ostype/script
new file mode 100644
index 00000000..992a3030
--- /dev/null
+++ b/tests/d_bad_ostype/script
@@ -0,0 +1,21 @@
+dd if=/dev/zero of=$TMPFILE bs=1k count=64 > /dev/null 2>&1
+$MKE2FS -q -b 1024 $TMPFILE
+$DEBUGFS -w -R 'set_super_value creator_os 0xf0000000' $TMPFILE
+
+OUT=$test_name.log
+EXP=$test_dir/expect
+$DUMPE2FS $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed | grep 'Filesystem OS type:' > $OUT
+
+rm -f $TMPFILE
+cmp -s $OUT $EXP
+status=$?
+
+if [ "$status" = 0 ] ; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff $DIFF_OPTS $EXP $OUT > $test_name.failed
+ rm -f $test_name.tmp
+fi
+unset OUT EXP
--
2.14.0.rc0.284.gd933b75aa4-goog
next prev parent reply other threads:[~2017-07-18 21:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-18 19:29 [PATCH 0/2] Handle invalid os_type in e2p Adam Buchbinder
2017-07-18 19:29 ` [PATCH 1/2] tests: dumpe2fs against an image with bad os_type Adam Buchbinder
2017-07-18 20:06 ` Andreas Dilger
2017-07-18 19:29 ` [PATCH 2/2] e2p: Fix segfault in e2p_os2string Adam Buchbinder
2017-07-18 20:04 ` Andreas Dilger
2017-07-18 21:48 ` [PATCH v2 0/2] Handle invalid os_type in e2p Adam Buchbinder
2017-07-18 21:48 ` [PATCH v2 1/2] e2p: Fix segfault in e2p_os2string Adam Buchbinder
2017-07-18 22:32 ` Andreas Dilger
2017-07-22 21:57 ` Theodore Ts'o
2017-07-18 21:48 ` Adam Buchbinder [this message]
2017-07-18 22:32 ` [PATCH v2 2/2] tests: dumpe2fs against an image with bad os_type Andreas Dilger
2017-07-22 21:57 ` 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=20170718214823.22649-3-abuchbinder@google.com \
--to=abuchbinder@google.com \
--cc=linux-ext4@vger.kernel.org \
/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).