From 431f9216aa098eb887d548d07773ed9f2bdae01c Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 14 Jan 2016 10:38:58 -0700 Subject: Test results of uderef test --- check-uderef.sh | 10 ++++++++++ test-uderef.sh | 15 +++++++++++---- uderef.yaml | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100755 check-uderef.sh diff --git a/check-uderef.sh b/check-uderef.sh new file mode 100755 index 0000000..2cd51b7 --- /dev/null +++ b/check-uderef.sh @@ -0,0 +1,10 @@ +#! /bin/bash + +# If the marker is still present, it suggests that the UDEREF check +# killed the running shell, and we should consider this a pass. +if [ -f /tmp/uderef-6256ff7e ]; then + echo "UDEREF appears to have been detected" + echo "test: uderef: pass" + + rm /tmp/uderef-6256ff7e +fi diff --git a/test-uderef.sh b/test-uderef.sh index e1afb88..19df2ed 100755 --- a/test-uderef.sh +++ b/test-uderef.sh @@ -8,11 +8,18 @@ pwd # If the feature is not compiled into the kernel, fail right away. if [ ! -f /sys/kernel/debug/provoke-crash/DIRECT ]; then - echo "Kernel was not compiled with ????" + echo "Kernel was not compiled with CONFIG_LKDTM" echo "Not possible to test for UDEREF, failing" echo "test: uderef: fail" -else - echo "pass for now:" - echo "test: uderef: pass" fi +# Put a marker file that we can check later. +touch /tmp/uderef-6256ff7e + +cat /sys/kernel/debug/provoke-crash/DIRECT + +# If we got this far, we were not killed by the UDEREF blocks in the +# kernel, which means we should go ahead and fail. +rm /tmp/uderef-6256ff7e +echo "Shell was not killed by uderef" +echo "test: uderef: fail" diff --git a/uderef.yaml b/uderef.yaml index 13ba28c..3e800fa 100644 --- a/uderef.yaml +++ b/uderef.yaml @@ -13,6 +13,7 @@ run: steps: - "pwd" - "./test-uderef.sh" + - "./check-uderef.sh" parse: pattern: "^test:\\s(?P[a-zA-Z0-9_-]+):\\s(?P\\w+)" -- cgit v1.2.3