From ed72e37c4aa50674c4d411f2575cf1d5e734d596 Mon Sep 17 00:00:00 2001 From: Yi-Yo Chiang Date: Tue, 26 Oct 2021 22:53:45 +0800 Subject: [PATCH] libfstab_fuzzer: Add dictionary to guide the fuzzer 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 --- fs_mgr/fuzz/Android.bp | 7 +++++ fs_mgr/fuzz/fstab.dict | 70 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 fs_mgr/fuzz/fstab.dict diff --git a/fs_mgr/fuzz/Android.bp b/fs_mgr/fuzz/Android.bp index f86d277d2..f0afd280b 100644 --- a/fs_mgr/fuzz/Android.bp +++ b/fs_mgr/fuzz/Android.bp @@ -25,4 +25,11 @@ cc_fuzz { shared_libs: [ "libbase", ], + + dictionary: "fstab.dict", + fuzz_config: { + cc: [ + "yochiang@google.com", + ], + }, } diff --git a/fs_mgr/fuzz/fstab.dict b/fs_mgr/fuzz/fstab.dict new file mode 100644 index 000000000..84dddf740 --- /dev/null +++ b/fs_mgr/fuzz/fstab.dict @@ -0,0 +1,70 @@ +"#" +"=" +"," +"f2fs" + +# mount flags +"noatime" +"noexec" +"nosuid" +"nodev" +"nodiratime" +"ro" +"rw" +"sync" +"remount" +"bind" +"rec" +"unbindable" +"private" +"slave" +"shared" +"defaults" + +# fs_mgr flags +"wait" +"check" +"nonremovable" +"recoveryonly" +"noemulatedsd" +"notrim" +"verify" +"formattable" +"slotselect" +"latemount" +"nofail" +"verifyatboot" +"quota" +"avb" +"logical" +"checkpoint=block" +"checkpoint=fs" +"first_stage_mount" +"slotselect_other" +"fsverity" +"metadata_csum" +"fscompress" +"overlayfs_remove_missing_lowerdir" + +# fs_mgr flags that expect an argument +"reserve_root=" +"lowerdir=" +"encryptable=" +"voldmanaged=" +"length=" +"swapprio=" +"zramsize=" +"forceencrypt=" +"fileencryption=" +"forcefdeorfbe=" +"max_comp_streams=" +"reservedsize=" +"readahead_size_kb=" +"eraseblk=" +"logicalblk=" +"avb_keys=" +"avb=" +"keydirectory=" +"metadata_encryption=" +"sysfs_path=" +"zram_backingdev_size="