From 834c897d056e130ecbb7c26a68cdcb969eafb179 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Jun 12 2012 19:48:40 +0000 Subject: Merge branch 'master' of ssh://git.fedorahosted.org/git/kernel-tests --- diff --git a/.gitignore b/.gitignore index 5761abc..9afd471 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.o +logs diff --git a/default/stack-randomness/runtest.sh b/default/stack-randomness/runtest.sh new file mode 100755 index 0000000..ac519a7 --- /dev/null +++ b/default/stack-randomness/runtest.sh @@ -0,0 +1,9 @@ +#!/bin/sh +COUNT=$(for i in `seq 1 1000` ; do grep stack /proc/self/maps; done | sort -u | uniq -c | wc -l) + +if [ $COUNT -lt 950 ]; then + echo "Stack randomness changes < 95% of the time ($COUNT)" + exit -1 +else + exit 0 +fi diff --git a/default/sysfs-perms/ignore-files.sh b/default/sysfs-perms/ignore-files.sh new file mode 100755 index 0000000..9f4305c --- /dev/null +++ b/default/sysfs-perms/ignore-files.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +grep -v event_control |\ +grep -v "/sys/fs/selinux/member" |\ +grep -v "/sys/fs/selinux/user" |\ +grep -v "/sys/fs/selinux/relabel" |\ +grep -v "/sys/fs/selinux/create" |\ +grep -v "/sys/fs/selinux/access" |\ +grep -v "/sys/fs/selinux/context" + diff --git a/default/sysfs-perms/runtest.sh b/default/sysfs-perms/runtest.sh new file mode 100755 index 0000000..730f5e0 --- /dev/null +++ b/default/sysfs-perms/runtest.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +COUNT=$(find /sys -type f -perm 666 | ignore-files.sh | wc -l) + +if [ "$COUNT" != "0" ]; then + echo Found world-writable files in sysfs. + find /sys -type f -perm 666 | ignore-files.sh + exit -1 +fi + +exit 0