Skip to content

Commit

Permalink
Add a temporary patch to compare-transform-pass.
Browse files Browse the repository at this point in the history
cf. AFLplusplus/AFLplusplus#1848

This patch fixes a problem that causes laf-intel DA to fail against libxml2_cve-2017-5969.
However, the DA has not yet worked for mruby_hackerone-reports-185041.
  • Loading branch information
vhertz committed Sep 1, 2023
1 parent 5d39b18 commit 223b609
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions data_augmentation/methods/laf-intel/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ git checkout 4.07c
# apply the Aurora patch (TODO)
#
patch -p1 < "${DA_ROOT}/aflppcem.patch"
patch -p1 < "${DA_ROOT}/compare-transform-pass.patch"

#
# build AFL++
Expand Down
34 changes: 34 additions & 0 deletions data_augmentation/methods/laf-intel/compare-transform-pass.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/instrumentation/compare-transform-pass.so.cc b/instrumentation/compare-transform-pass.so.cc
index 5dd705cf..6e20135e 100644
--- a/instrumentation/compare-transform-pass.so.cc
+++ b/instrumentation/compare-transform-pass.so.cc
@@ -226,10 +226,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
StringRef FuncName = Callee->getName();
isStrcmp &=
(!FuncName.compare("strcmp") || !FuncName.compare("xmlStrcmp") ||
- !FuncName.compare("xmlStrEqual") ||
- !FuncName.compare("g_strcmp0") ||
- !FuncName.compare("curl_strequal") ||
- !FuncName.compare("strcsequal"));
+ !FuncName.compare("g_strcmp0"));
isMemcmp &=
(!FuncName.compare("memcmp") || !FuncName.compare("bcmp") ||
!FuncName.compare("CRYPTO_memcmp") ||
@@ -237,8 +234,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
!FuncName.compare("memcmp_const_time") ||
!FuncName.compare("memcmpct"));
isStrncmp &= (!FuncName.compare("strncmp") ||
- !FuncName.compare("xmlStrncmp") ||
- !FuncName.compare("curl_strnequal"));
+ !FuncName.compare("xmlStrncmp"));
isStrcasecmp &= (!FuncName.compare("strcasecmp") ||
!FuncName.compare("stricmp") ||
!FuncName.compare("ap_cstr_casecmp") ||
@@ -472,7 +468,6 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,

if (isMemcmp || !Callee->getName().compare("strncmp") ||
!Callee->getName().compare("xmlStrncmp") ||
- !Callee->getName().compare("curl_strnequal") ||
!Callee->getName().compare("strncasecmp") ||
!Callee->getName().compare("strnicmp") ||
!Callee->getName().compare("ap_cstr_casecmpn") ||

0 comments on commit 223b609

Please sign in to comment.