These functions contain complex logic and parse user input. It shall be
valuable to fuzz these functions to prevent regression.
Bug: 254832225
Test: Build and run the fuzzer
Change-Id: I21099c3fc1c226f95a0f8f996bb751030e0c59bc
ReadFstabFromFp() have two callers right now, ReadFstabFromFile() and
ReadFstabFromDt(). ReadFstabFromFile() opens a FILE* and pass it to
ReadFstabFromFp(), and ReadFstabFromDt() wraps a std::string::c_str()
buffer in a FILE* adaptor with fmemopen().
There's no need for such adaptor, just change ReadFstabFromFp() to
accept std::string and we're good.
Bug: 206740783
Bug: 204056804
Test: atest CtsFsMgrTestCases
Test: m libfstab_fuzzer
Change-Id: I3f56a83ec5baf7b0d97a618a2c2bb6e31b67b5d9
ReadFstabFromFp() have two callers right now, ReadFstabFromFile() and
ReadFstabFromDt(). ReadFstabFromFile() opens a FILE* and pass it to
ReadFstabFromFp(), and ReadFstabFromDt() wraps a std::string::c_str()
buffer in a FILE* adaptor with fmemopen().
There's no need for such adaptor, just change ReadFstabFromFp() to
accept std::string and we're good.
Bug: 204056804
Test: atest CtsFsMgrTestCases
Test: m libfstab_fuzzer
Change-Id: I71190c7356a354aa06d1be3fdc4ca76611b3896d
This is probably an overkill, but still, add a collection of
interesting keywords that may appear in a fstab file.
Also add myself to the "CC" list of this fuzz target.
BYPASS_INCLUSIVE_LANGUAGE_REASON="slave" or MS_SLAVE is a mount flag
Bug: 204056804
Test: adb shell /data/fuzz/x86_64/libfstab_fuzzer/libfstab_fuzzer \
-dict=/data/fuzz/x86_64/libfstab_fuzzer/fstab.dict
Change-Id: Ife55837212a711dcbeed4f00d97da0cb022c7156
Just a modest initial implementation. Uses the fuzz data as the fstab
file content directly.
Bug: 204056804
Test: lunch aosp_cf_x86_64_phone-userdebug
SANITIZE_TARGET=address m libfstab_fuzzer
adb sync data
adb shell /data/fuzz/x86_64/libfstab_fuzzer/libfstab_fuzzer
Change-Id: I7976a6ee124e9b5da59cfa7f4bae9699be3f1474