From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Buchbinder Subject: [PATCH 1/2] tests: dumpe2fs against an image with bad os_type. Date: Tue, 18 Jul 2017 12:29:18 -0700 Message-ID: <20170718192919.32406-2-abuchbinder@google.com> References: <20170718192919.32406-1-abuchbinder@google.com> Cc: Adam Buchbinder To: linux-ext4@vger.kernel.org Return-path: Received: from mail-pf0-f180.google.com ([209.85.192.180]:36843 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751443AbdGRT3g (ORCPT ); Tue, 18 Jul 2017 15:29:36 -0400 Received: by mail-pf0-f180.google.com with SMTP id o88so9541154pfk.3 for ; Tue, 18 Jul 2017 12:29:36 -0700 (PDT) In-Reply-To: <20170718192919.32406-1-abuchbinder@google.com> Sender: linux-ext4-owner@vger.kernel.org List-ID: 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 --- tests/d_bad_ostype/expect | 1 + tests/d_bad_ostype/image.gz | Bin 0 -> 272 bytes tests/d_bad_ostype/name | 1 + tests/d_bad_ostype/script | 19 +++++++++++++++++++ 4 files changed, 21 insertions(+) create mode 100644 tests/d_bad_ostype/expect create mode 100644 tests/d_bad_ostype/image.gz 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/image.gz b/tests/d_bad_ostype/image.gz new file mode 100644 index 0000000000000000000000000000000000000000..06805e1093c1ce9d2dc172aa89fb57eaedfa5505 GIT binary patch literal 272 zcmV+r0q_1FiwFpQOm0~K18HqxXJr6mU>F6XU=)m0AOOS;K+Fup8bHhh#Ei%a6d)L+ z?&+16q1uYMkqiv~{|CQk1gnGa!Jq-Aj~m1RVhgBwAhY*~Zq>5lb9}siN7?zgx^kZA z?$FQ8E731WEiR$5|B%5FZu@YTFo#cl{h8X~OW!;Lxt9kjw+`qxTG+{mLtK~^mW_f@ zKq3I;O%@<#WdP-WCLo_>fL$~SM!_hc7x@3b9z-?#9|fae6pTDzKhO>s1*2dT3>1L1 z13>-wb@2W@{lHsC25<-DIneI+Pz;e_0goMk0ElL%r=v!}hye|aK*E591(fz-7$U<6 WPk-bB5lS6L2LJ#sc=EFV7ytl $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