diff --git a/tools/do_integertransform.sh b/tools/do_integertransform.sh index de85474cbc325e43c5c51422beb35f89bf2c606a..c312e5e850f34a32b2fce614182f47e6c4bd1393 100755 --- a/tools/do_integertransform.sh +++ b/tools/do_integertransform.sh @@ -10,11 +10,12 @@ CLONE_ID=$1 IDENTIFIED_PROG=$2 CONCOLIC_DIR=$3 TIMEOUT=$4 -WARNINGS_ONLY=$5 # 0 or 1 -BENIGN_FP_DETECT=$6 # 0 or 1 -INSTRUMENT_IDIOMS=$7 # 0 or 1 -echo "intxform: cloneID=$CLONE_ID identifiedProg=$IDENTIFIED_PROG concolicDir=$CONCOLIC_DIR timeout=$TIMEOUT warningsOnly=$WARNINGS_ONLY benignFpDetect=$BENIGN_FP_DETECT instrumentIdioms=$INSTRUMENT_IDIOMS" +shift 4 +OPTIONS=$* + +#echo "intxform: cloneID=$CLONE_ID identifiedProg=$IDENTIFIED_PROG concolicDir=$CONCOLIC_DIR timeout=$TIMEOUT warningsOnly=$WARNINGS_ONLY benignFpDetect=$BENIGN_FP_DETECT instrumentIdioms=$INSTRUMENT_IDIOMS options=$OPTIONS" +echo "intxform: cloneID=$CLONE_ID identifiedProg=$IDENTIFIED_PROG concolicDir=$CONCOLIC_DIR timeout=$TIMEOUT options=$OPTIONS" # configuration variables LIBC_FILTER=$PEASOUP_HOME/tools/libc_functions.txt # libc and other system library functions @@ -30,7 +31,8 @@ touch $INTEGER_WARNINGS_FILE echo "intxform: transforming binary: cloneid=$CLONE_ID identifiedProg=$IDENTIFIED_PROG" -if [ "$BENIGN_FP_DETECT" = "1" ]; then +echo "$options" | grep "--benign-fp-detect" &> /dev/null +if [ $? -eq 0 ]; then echo "INTXFORM: Detection of benign false positives turned on for recognized program: $IDENTIFIED_PROG" if [ "$IDENTIFIED_PROG" != "" ]; then echo "intxform: identifiedProg=$IDENTIFIED_PROG" @@ -82,20 +84,10 @@ cd $TOP_DIR # Transform program but for each instruction present in the list above, use a "CONTINUE" policy to emit a warning (instead of the default CONTROLLED EXIT policy) echo "intxform: Final integer transform" -echo "intxform: warnings_only: $WARNINGS_ONLY" - -if [ "$WARNINGS_ONLY" != "0" ]; then - echo "intxform: warning only mode" - $PEASOUP_HOME/tools/update_env_var.sh STRATA_MAX_WARNINGS 0 - timeout $TIMEOUT $SECURITY_TRANSFORMS_HOME/tools/transforms/integertransformdriver.exe $CLONE_ID $LIBC_FILTER $INTEGER_WARNINGS_FILE --warning -else - echo "intxform: saturating arithmetic is enabled" - - if [ "$INSTRUMENT_IDIOMS" != "0" ]; then - echo "intxform: instrument idioms" - timeout $TIMEOUT $SECURITY_TRANSFORMS_HOME/tools/transforms/integertransformdriver.exe $CLONE_ID $LIBC_FILTER $INTEGER_WARNINGS_FILE --saturating-arithmetic --instrument-idioms - else - timeout $TIMEOUT $SECURITY_TRANSFORMS_HOME/tools/transforms/integertransformdriver.exe $CLONE_ID $LIBC_FILTER $INTEGER_WARNINGS_FILE --saturating-arithmetic - fi +echo "$options" | grep "--warning" &> /dev/null +if [ $? -eq 0 ]; then + echo "intxform: warning only mode" + $PEASOUP_HOME/tools/update_env_var.sh STRATA_MAX_WARNINGS 0 fi +timeout $TIMEOUT $SECURITY_TRANSFORMS_HOME/tools/transforms/integertransformdriver.exe $CLONE_ID $LIBC_FILTER $INTEGER_WARNINGS_FILE $OPTIONS diff --git a/tools/ps_analyze.sh b/tools/ps_analyze.sh index e4701bbf6804528c978a7debc3ba4837d6c158a1..d1d89692f9cb4e2a76dee14016329ceca6077129 100755 --- a/tools/ps_analyze.sh +++ b/tools/ps_analyze.sh @@ -51,11 +51,6 @@ PN_TIMEOUT_VALUE=21600 DO_CANARIES=on CONCOLIC_DIR=concolic.files_a.stratafied_0001 -intxform_warnings_only=0 # default: integer warnings only mode is off -intxform_detect_fp=0 # default: detect benign false positives is on - # but if determine_program is off, it's a no-op -intxform_instrument_idioms=0 # default: do not instrument instructions marked as IDIOM by STARS - # JOBID JOBID="$(basename $1).$$" @@ -192,10 +187,6 @@ check_options() # We need TEMP as the `eval set --' would nuke the return value of getopt. short_opts="s:t:w:" long_opts="--long step-option: - --long integer_warnings_only - --long integer_instrument_idioms - --long integer_detect_fp - --long no_integer_detect_fp --long step: --long timeout: --long id: @@ -206,7 +197,6 @@ check_options() --long backend: " - # solaris does not support long option names if [ `uname -s` = "SunOS" ]; then TEMP=`getopt $short_opts "$@"` @@ -256,26 +246,6 @@ check_options() manual_test_coverage_file=$2 shift 2 ;; - --integer_warnings_only) - echo "integer transform: warnings only enabled" - intxform_warnings_only=1 - shift - ;; - --no_integer_detect_fp) - echo "integer transform: benign false positive detection disabled" - intxform_detect_fp=0 - shift - ;; - --integer_detect_fp) - echo "integer transform: benign false positive detection enabled" - intxform_detect_fp=1 - shift - ;; - --integer_instrument_idioms) - echo "integer transform: instrument idioms" - intxform_instrument_idioms=1 - shift - ;; -t|--timeout) set_timer $2 & TIMER_PID=$! shift 2 @@ -856,9 +826,6 @@ fi # do the basic tranforms we're performing for peasoup perform_step fix_calls mandatory $SECURITY_TRANSFORMS_HOME/libIRDB/test/fix_calls.exe $cloneid #gdb --args $SECURITY_TRANSFORMS_HOME/libIRDB/test/fix_calls.exe $cloneid - - - # look for strings in the binary perform_step find_strings none $SECURITY_TRANSFORMS_HOME/libIRDB/test/find_strings.exe $cloneid @@ -959,8 +926,7 @@ if [ -z "$program" ]; then program="unknown" fi -perform_step integertransform meds_static,clone $PEASOUP_HOME/tools/do_integertransform.sh $cloneid $program $CONCOLIC_DIR $INTEGER_TRANSFORM_TIMEOUT_VALUE $intxform_warnings_only $intxform_detect_fp $intxform_instrument_idioms - +perform_step integertransform meds_static,clone $PEASOUP_HOME/tools/do_integertransform.sh $cloneid $program $CONCOLIC_DIR $INTEGER_TRANSFORM_TIMEOUT_VALUE $step_options_integertransform # # perform step to instrument pgm with return shadow stack