mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
Merge in stress test changes before ext4 eats them.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
TARGETS=change_hat child open
|
||||
PROFILES=change_hat.profile child.profile open.profile sh.profile
|
||||
LIB:=$(shell if [ `ls /lib/apparmor* 2>/dev/null` ] ; then echo "apparmor" ; else echo "immunix" ; fi)
|
||||
LIB:=apparmor
|
||||
LIBS=-l$(LIB)
|
||||
|
||||
all: targets profiles
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#include <stdio.h>
|
||||
#include <linux/unistd.h>
|
||||
|
||||
#include "sys/immunix.h"
|
||||
#include "sys/apparmor.h"
|
||||
|
||||
#define SD_ID_MAGIC 0xdeadbeef
|
||||
|
||||
|
@@ -1,8 +1,9 @@
|
||||
BASE/change_hat {
|
||||
/lib/lib*.so r,
|
||||
/lib/lib*.so.* r,
|
||||
/lib/i[356]86/lib*.so r,
|
||||
/lib/tls/lib*.*.so r,
|
||||
/lib/lib*.so rm,
|
||||
/usr/lib/lib*.so rm,
|
||||
/lib/lib*.so.* rm,
|
||||
/lib/i[356]86/lib*.so rm,
|
||||
/lib/tls/lib*.*.so rm,
|
||||
/lib/ld-*.so rix,
|
||||
/etc/ld.so.* r,
|
||||
BASE/change_hat r,
|
||||
|
@@ -1,9 +1,9 @@
|
||||
BASE/child {
|
||||
/lib/libc-*.so r,
|
||||
/lib/libc-*.so.* r,
|
||||
/lib/libc-*.so rm,
|
||||
/lib/libc-*.so.* rm,
|
||||
/lib/ld-*.so rix,
|
||||
/lib/ld-*.so.* rix,
|
||||
/lib/libAA* r,
|
||||
/{usr/,}lib/libAA* rm,
|
||||
/etc/ld.so.* r,
|
||||
BASE/child r,
|
||||
/bin/ls r,
|
||||
|
@@ -8,13 +8,13 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat change_hat.profile | $subdomain_parser -R 2>&1 > /dev/null
|
||||
cat change_hat.profile | $subdomain_parser
|
||||
$subdomain_parser -R change_hat.profile 2>&1 > /dev/null
|
||||
$subdomain_parser change_hat.profile
|
||||
|
||||
./change_hat > /dev/null 2>&1 &
|
||||
|
||||
while :
|
||||
do
|
||||
cat change_hat.profile | $subdomain_parser -r > /dev/null 2>&1 &
|
||||
$subdomain_parser -r change_hat.profile > /dev/null 2>&1 &
|
||||
done &
|
||||
|
||||
|
@@ -16,8 +16,8 @@ int main(int argc, char *argv[])
|
||||
if (argc > 1)
|
||||
o_file = argv[1];
|
||||
|
||||
// for (i=0, success=0, fail=0; i<MAX_LOOP; i++) {
|
||||
for (i=0, success=0, fail=0; !i; i++) {
|
||||
for (i=0, success=0, fail=0; i<MAX_LOOP; i++) {
|
||||
// for (i=0, success=0, fail=0; !i; i++) {
|
||||
fd = open(o_file, O_RDONLY);
|
||||
if (fd != -1) {
|
||||
success++;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
BASE/open {
|
||||
/lib/libc-*.so r,
|
||||
/lib/libc-*.so.* r,
|
||||
/lib/libc-*.so rm,
|
||||
/lib/libc-*.so.* rm,
|
||||
/lib/ld-*.so rix,
|
||||
/lib/ld-*.so.* rix,
|
||||
/lib/libAA* r,
|
||||
/{usr/,}lib/libAA* rm,
|
||||
/etc/ld.so.* r,
|
||||
BASE/open r,
|
||||
/bin/ls r,
|
||||
|
@@ -11,11 +11,12 @@ BASE/sh {
|
||||
/etc/termcap r,
|
||||
BASE/sh r,
|
||||
BASE/* rix,
|
||||
/lib/libc-*.so r,
|
||||
/lib/libc-*.so.* r,
|
||||
/lib/libc-*.so rm,
|
||||
/lib/libc-*.so.* rm,
|
||||
/lib/ld-*.so rix,
|
||||
/lib/ld-*.so.* rix,
|
||||
/lib/** r,
|
||||
/lib/** rm,
|
||||
/{usr/,}/lib/libAA* rm,
|
||||
/proc/meminfo r,
|
||||
/usr/lib/locale/** r,
|
||||
/usr/share/locale/** r,
|
||||
|
@@ -2,7 +2,9 @@
|
||||
|
||||
. ./uservars.inc
|
||||
|
||||
cat change_hat.profile child.profile open.profile | ${subdomain_parser}
|
||||
${subdomain_parser} change_hat.profile child.profile open.profile
|
||||
|
||||
rm -f /tmp/foobar && touch /tmp/foobar
|
||||
|
||||
./open & ./open /tmp/foobar &
|
||||
|
||||
@@ -12,8 +14,8 @@ cat change_hat.profile child.profile open.profile | ${subdomain_parser}
|
||||
|
||||
while :
|
||||
do
|
||||
cat change_hat.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
|
||||
cat child.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
|
||||
cat open.profile | ${subdomain_parser} -r > /dev/null 2>&1 &
|
||||
${subdomain_parser} -r change_hat.profile > /dev/null 2>&1 &
|
||||
${subdomain_parser} -r child.profile > /dev/null 2>&1 &
|
||||
${subdomain_parser} -r open.profile > /dev/null 2>&1 &
|
||||
done &
|
||||
|
||||
|
Reference in New Issue
Block a user