Update ASLR test script and stable file of ASLR and SUID 60/79060/1
authorYunjin Lee <yunjin-.lee@samsung.com>
Fri, 8 Jul 2016 04:57:22 +0000 (13:57 +0900)
committerYunjin Lee <yunjin-.lee@samsung.com>
Fri, 8 Jul 2016 04:57:22 +0000 (13:57 +0900)
Change-Id: Ifa0173dc42390a6ab7e2001defa803bfa31f04e0
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
test/aslr_test/scripts/exception.list
test/aslr_test/scripts/run_aslr_test.sh
test/setuid_test/scripts/exception.list.stable

index 94f5c641d8cf69059bff45bbcc1690e006706da3..aad84f6a36bc5fae44a4e34cb97f1a52b4e3d91f 100755 (executable)
@@ -17,4 +17,5 @@
 /usr/bin/sleep
 /usr/bin/touch
 /usr/sbin/sulogin
-
+/usr/bin/dummyasm-service
+/usr/bin/fido-service
index dc7e86f8c3fa73816211ad9ad8d253825a7461a6..a3af27c23d9c8b9dd625c5ab5b8422ffd20af7c7 100755 (executable)
@@ -29,56 +29,58 @@ function makeInput {
        $TOUCH $tmp_list
        $FIND /usr/lib/systemd/ -name *.service | $XARGS $GREP "ExecStart" | $GREP -v "#ExecStart" > $tmp_list
        $SED -i 's/  / /g' $tmp_list
-       $SED -i 's/ = /=/g' $tmp_list
+       $SED -i 's/ =/=/g' $tmp_list
+       $SED -i 's/= /=/g' $tmp_list
        $SED -i 's/\-\//\//g' $tmp_list
        $CAT $tmp_list | $CUT -d "=" -f 2 | $CUT -d " " -f 1 > $all_systemd_dbus_executable_list
        $RM $tmp_list
        $TOUCH $tmp_list
-    $FIND /usr/share/dbus-1/ -name *.service | $XARGS $GREP "ExecStart" | $GREP -v "#ExecStart" > $tmp_list
-    $SED -i 's/  / /g' $tmp_list
-    $SED -i 's/ = /=/g' $tmp_list
-    $SED -i 's/\-\//\//g' $tmp_list
-    $CAT $tmp_list | $CUT -d "=" -f 2 | $CUT -d " " -f 1 >> $all_systemd_dbus_executable_list
-    $RM $tmp_list
+       $FIND / -name *.service | $XARGS $GREP "Exec" | $GREP -v "#Exec" > $tmp_list
+       $SED -i 's/  / /g' $tmp_list
+       $SED -i 's/ =/=/g' $tmp_list
+       $SED -i 's/= /=/g' $tmp_list
+       $SED -i 's/\-\//\//g' $tmp_list
+       $CAT $tmp_list | $CUT -d "=" -f 2 | $CUT -d " " -f 1 >> $all_systemd_dbus_executable_list
+       $RM $tmp_list
 }
 
 function sortInput {
 
-    $SORT $all_systemd_dbus_executable_list > $tmp_list
-    $CAT $tmp_list | $UNIQ > $sorted_all_systemd_dbus_executable_list
-    $RM $tmp_list
-    $RM $all_systemd_dbus_executable_list
+       $SORT $all_systemd_dbus_executable_list > $tmp_list
+       $CAT $tmp_list | $UNIQ > $sorted_all_systemd_dbus_executable_list
+       $RM $tmp_list
+       $RM $all_systemd_dbus_executable_list
 }
 
 function testSystemDASLR {
-    echoI "Check whether the executable is ASLR applied or not"
-    while read line; do
-        echoI "$line"
-        file_ret=""
-        grep_ret=""
-        file_ret=`$utils_dir/file $line`
-        grep_ret=`echo $file_ret | $GREP -i "executable" | $GREP "ELF" | $GREP -v "script"`
+       echoI "Check whether the executable is ASLR applied or not"
+       while read line; do
+               echoI "$line"
+               file_ret=""
+               grep_ret=""
+               file_ret=`$utils_dir/file $line`
+               grep_ret=`echo $file_ret | $GREP -i "executable" | $GREP "ELF" | $GREP -v "script"`
 
-        total_cnt=$((total_cnt+1))
+               total_cnt=$((total_cnt+1))
 
-        if [ ! "$grep_ret" ]; then
-            echoS "$line, OK"
-        else
-            is_exception="false"
-            while read line2; do
-                if [ "$line" = "$line2" ]; then
-                    is_exception="true"
-                fi
-            done < $exception_file
-            if [ "$is_exception" = "true" ]; then
-                echoS "$line"", OK - Not a target of ASLR test"
-            else
-                echoE "$line, NOK"
-                echo "$line"",NOK" >> $log_file
-                fail_cnt=$((fail_cnt+1))
-            fi
-        fi
-    done < $sorted_all_systemd_dbus_executable_list
+               if [ ! "$grep_ret" ]; then
+                       echoS "$line, OK"
+               else
+                       is_exception="false"
+                       while read line2; do
+                               if [ "$line" = "$line2" ]; then
+                                       is_exception="true"
+                               fi
+                       done < $exception_file
+                       if [ "$is_exception" = "true" ]; then
+                               echoS "$line"", OK - Not a target of ASLR test"
+                       else
+                               echoE "$line, NOK"
+                               echo "$line"",NOK" >> $log_file
+                               fail_cnt=$((fail_cnt+1))
+                       fi
+               fi
+       done < $sorted_all_systemd_dbus_executable_list
        $RM $sorted_all_systemd_dbus_executable_list
 }
 #=========================================================
@@ -93,7 +95,7 @@ $TOUCH $log_file
 # Rename utils
 file_cmd=`$FIND $utils_dir -name file.*`
 if [ "$file_cmd" != "" ]; then
-    $MV $file_cmd $utils_dir/file
+       $MV $file_cmd $utils_dir/file
 fi
 if [ ! -e $utils_dir/file ]; then
        echo "There's no file command!!!"
@@ -120,10 +122,10 @@ echoI "Test Systemd ASLR"
 testSystemDASLR
 
 if [ $((fail_cnt)) -lt 1 ]; then
-    echo "YES" > $result_file
+       echo "YES" > $result_file
        $RM $log_file
 else
-    echo "NO" > $result_file
+       echo "NO" > $result_file
 fi
 echo "================================================================"
 echo "TOTAL: $((total_cnt)), NOT APPLIED: $((fail_cnt))"
@@ -131,16 +133,16 @@ echo "================================================================"
 echo ""
 
 if [ ! -d $log_dir ]; then
-    echo "make log dir"
-    $MKDIR $log_dir
+       echo "make log dir"
+       $MKDIR $log_dir
 else
-    echo "log dir exist"
+       echo "log dir exist"
 fi
 if [ ! -d $result_dir ]; then
-    echo "make result dir"
-    $MKDIR $result_dir
+       echo "make result dir"
+       $MKDIR $result_dir
 else
-    echo "result dir exist"
+       echo "result dir exist"
 fi
 if [ -a $aslr_script_dir/log.csv ]; then
        $MV $aslr_script_dir/log.csv $log_dir/aslr_test.log
index 7420f585ff2a9ce7981d5f054d7e3e3ad85ededc..b39fecaa7cc58da27ae2f069b399ff3be3ac9602 100755 (executable)
@@ -1,2 +1,4 @@
 /usr/bin/su
 /usr/lib/dbus/dbus-daemon-launch-helper
+/usr/bin/umount
+/usr/bin/mount