Commit graph

1727 commits

Author SHA1 Message Date
Jamie Strandboge
9e99dfc8b2 add ca-certificates to ssl_certs abstraction (LP: #605835) 2010-08-11 09:15:56 -05:00
Jamie Strandboge
42cd946ff2 update ubuntu-browsers.d/kde to use PUx for kde4-config 2010-08-10 17:57:42 -05:00
Jamie Strandboge
cbbf3ea75e update abstractions/ubuntu-browsers.d/java for icedtea 2010-08-10 16:45:23 -05:00
Jamie Strandboge
23a77d70e8 adjust profiles/Makefile for abstractions/ubuntu-browsers.d 2010-08-10 16:42:00 -05:00
Jamie Strandboge
e1e85f285c remove kde4-config from the kde abstraction 2010-08-10 15:38:58 -05:00
Jamie Strandboge
6988cd07a0 adjust profiles/apparmor.d/local/README to codify the intended usage of local/ 2010-08-10 14:28:10 -05:00
Jamie Strandboge
1bdb6069da fix whitespace abstractions/ubuntu-browsers.d/*
add 'owner' match to abstractions/ubuntu-browsers.d/java
2010-08-10 14:18:21 -05:00
Jamie Strandboge
0978a1ad8a update ubuntu-* abstractions to use PUx instead of Ux 2010-08-10 14:11:04 -05:00
John Johansen
350520a650 Add check to the regression tests that verifies the expected profiles
are loaded.
2010-08-10 09:24:41 -04:00
Jamie Strandboge
2a3aae6d57 'owner' match in commit 1406 too strict for /tmp/ and /var/tmp/ 2010-08-09 09:56:31 -05:00
Jamie Strandboge
d472cf13b1 add Ubuntu-specific profiles/apparmor.d/abstractions/ubuntu-browsers.d/*
for use with browser profiles
2010-08-06 16:01:57 -05:00
Jamie Strandboge
eace04e2e7 profiles/Makefile: use LOCAL_ADDITIONS using filter-out in clean target, which
is much cleaner.
2010-08-05 16:00:23 -05:00
Jamie Strandboge
f9187ac661 profiles/Makefile: use same logic in 'clean' target as we did in 'local' 2010-08-05 15:53:07 -05:00
Jamie Strandboge
9c3fb960e8 implement 'local/' mechanism to aid in packaging:
- create profiles/apparmor.d/local/README to explain it all
- adjust shipped profiles in profiles/apparmor.d to include the local changes
- adjust profiles/Makefile for local files
2010-08-05 15:30:43 -05:00
Jamie Strandboge
b550fa291c adjust profiles/Makefile for local files 2010-08-05 15:10:33 -05:00
Jamie Strandboge
6fb3f5c4a6 move profiles/local to profiles/apparmor.d/local 2010-08-05 14:15:56 -05:00
Jamie Strandboge
f25949cf84 start on 'local/' mechanism to aid in packaging:
- add profiles/local/README
- adjust profiles/apparmor.d/{bin,sbin,usr}* to include a file from local/
- adjust profiles/apparmor.d/{bin,sbin,usr}* for for copyright, some whitespace
  and svn conventions
2010-08-05 14:00:02 -05:00
Kees Cook
cc434a1c7f Fixes "deleted" test case to match the documentation for the expected
outcome. Adds additional positive test, fixes spelling.
2010-08-04 12:22:48 -07:00
John Johansen
5c8581a345 Update the regression test suite to test chmod, chown and chgrp on directories. 2010-08-04 10:25:44 -07:00
John Johansen
6259edac38 Update and expand comments on regex tree normalization 2010-08-04 10:23:22 -07:00
John Johansen
f0220611aa Epsnodes carry no information beyond the node type. Convert to using
a single static node, which will reduce allocations and peak memory
use slightly.
2010-08-04 09:53:46 -07:00
John Johansen
5c8051994b Make -q quiet can not update cache warnings 2010-08-04 09:52:54 -07:00
Jamie Strandboge
62f2e7f06e fix for LP: #611248 (gdk pixbug loaders)
tighten up the dbus abstractions
2010-08-03 12:06:29 -05:00
Jamie Strandboge
24e3b5296e tighten up the dbus abstractions 2010-08-03 12:04:37 -05:00
Jamie Strandboge
9533ac3405 fix for LP: #611248 2010-08-03 09:13:34 -05:00
John Johansen
b5c780d2a1 Remove pcre and update tests where necessary 2010-07-31 16:00:52 -07:00
Kees Cook
06ebb0b6d6 use wildcards correctly for utils subdirectory ignores 2010-07-26 11:02:42 -07:00
Kees Cook
5f76ba2ae3 Cleanups in libapparmor that should have been part of commit 1437. These
were part of the ACKed patch on the mailing list.
2010-07-26 10:58:07 -07:00
Kees Cook
32d899eb6d The coredump regression test existed in the tree, but was not hooked up to
the testsuite. It looks like coredump mediation may have been removed,
since it is rather a corner-case, so I have currently marked it as XFAIL.

In hooking it back up, the "prologue.inc" was reviewed, dead code dropped,
and the "image=" argument changed to correctly handle the imageperms
syntax used elsewhere. It was working in other tests out of coincidence.
2010-07-26 10:55:00 -07:00
Kees Cook
b30b4c1877 Fixes several warnings, typos, clarifies a subtest description and starts
to try to get rid of programmatic use of $Id$ in kernel regression tests.
2010-07-26 10:50:33 -07:00
Kees Cook
0d357a892b Actually fail "make tests" if any of the tests fail to run. 2010-07-26 10:46:03 -07:00
Kees Cook
e180ed4ccb There didn't seem to be a way to see individual test successes, so I added
a check for "VERBOSE=1" in the kernel regression testsuite.
2010-07-26 09:30:36 -07:00
Kees Cook
27ce962708 Rename "subdomain" to "apparmor" in kernel regression tests.
Includes spelling fixes, drops of old documentation, and removal of notes on
tests that no longer fail.
2010-07-26 09:26:26 -07:00
Kees Cook
084f975d5e Drop unused file descriptor. 2010-07-26 09:25:00 -07:00
Kees Cook
624aee531a Fix many compile-time warnings.
Start replacing RPM with lsb-release.
Drop old references to CVE.
Remove unused code.
2010-07-26 09:22:45 -07:00
Kees Cook
a92f9e67b3 Add "comm" string to the parser structure and testsuite runner. Update
testsuite output to include "comm" report.
2010-07-26 09:20:02 -07:00
Kees Cook
5649f5237b Add testcases for new LSM-audit log messages.
Update log parser grammar to handle new LSM-audit log messages.
2010-07-26 09:16:23 -07:00
Kees Cook
24a05b0bf5 add kernel regression test build-time by-products to ignore list 2010-07-25 19:00:51 -07:00
Kees Cook
359514432f add more build-time by-products to the ignore list 2010-07-25 18:59:58 -07:00
Kees Cook
cf706a37f0 add build-time by-products to the .bzrignore for libapparmor 2010-07-25 18:52:19 -07:00
John Johansen
4be07c3265 This adds a basic debug dump for the conversion of each rule in a profile to its expression
tree.  It is limited in that it doesn't currently handle the permissions of a rule.

conversion output presents an aare -> prce conversion followed by 1 or more expression
tree rules, governed by what the rule does.
eg.
  aare: /**   ->   /[^/\x00][^\x00]*
  rule: /[^/\x00][^\x00]*  ->  /[^\0000/]([^\0000])*

eg.
echo "/foo { /** rwlkmix, } " | ./apparmor_parser -QT -D rule-exprs -D expr-tree

aare: /foo   ->   /foo
aare: /**   ->   /[^/\x00][^\x00]*
rule: /[^/\x00][^\x00]*  ->  /[^\0000/]([^\0000])*

rule: /[^/\x00][^\x00]*\x00/[^/].*  ->  /[^\0000/]([^\0000])*\0000/[^/](.)*


DFA: Expression Tree
(/[^\0000/]([^\0000])*(((((((((((((<513>|<2>)|<4>)|<8>)|<16>)|<32>)|<64>)|<8404992>)|<32768>)|<65536>)|<131072>)|<262144>)|<524288>)|<1048576>)|/[^\0000/]([^\0000])*\0000/[^/](.)*((<16>|<32>)|<262144>))


This simple example shows many things
1. The profile name under goes pcre conversion.  But since no regular expressions where found
   it doesn't generate any expr rules
2. /** is converted into the pcre expression /[^\0000/]([^\0000])*
3. The pcre expression /[^\0000/]([^\0000])* is converted into two rules that are then
   converted into expression trees.

   The reason for this can not be seen by the output as this is actually triggered by
   permissions separation for the rule.  In this case the link permission is separated
   into what is shown as the second rule: statement.
4. DFA: Expression Tree dump shows how these rules are combined together

You will notice that the rule conversion statement is fairly redundant currently as it just
show pcre to expression tree pcre.  This will change when direct aare parsing occurs,
but currently serves to verify the pcre conversion step.


It is not the prettiest patch, as its touching some ugly code that is schedule to be cleaned
up/replaced. eg. convert_aaregex_to_pcre is going to replaced with native parse conversion
from an aare straight to the expression tree, and dfaflag passing will become part of the
rule set.
2010-07-23 13:29:35 +02:00
John Johansen
837f47c921 This is the user space fix for launchpad.net/busgs/599450
It changes the table resizing so that there is always sufficient
high entries in the table, preventing bounds violations from
occurring.

Previously the resize allocation was always based on the character
set range for a state, which could be more or less than actually
required, and packing would waste some space when over allocation
was done.

As a result this patch in general results in slightly smaller
transition tables even though it enforcing the minimum required
padding to avoid bounds violations.
2010-07-23 04:30:31 +02:00
John Johansen
bfb96638f6 This is a preparatory patch for the fix to launchpad.net/bugs/599450.
It combines the two separate table resize code segments into a single
functionally equivalent segment.  It does not fix the bug.
2010-07-23 04:29:54 +02:00
John Johansen
6453a41a28 Add extra transition table labeling to help with interpretation of the
dump output.
2010-07-23 04:29:29 +02:00
Steve Beattie
1d9ca54cec Minor touchups to the README. 2010-07-22 17:07:10 +02:00
Jamie Strandboge
1cc6ef54d0 added README file 2010-07-22 15:29:07 +02:00
John Johansen
af3476afb9 The templatization of deref_less_than is unnecessary and complicates the code
replace it with its none templatized version.
2010-07-10 17:53:04 -07:00
John Johansen
4f8e01ff36 expression tree node labeling is used during debugging dumps. Currently the node labels
are computed and stored in a map, that is not cleaned up.  This means that the labeling
is retained across different dfas.

Move the labeling into expr node as this takes less memory than using a map and will
also separates node labeling so its per dfa instead of global.  In addition this means
the labeling is cleanedup/freed when the expr tree is freed without any extra work.
2010-07-10 17:52:13 -07:00
John Johansen
d0dcab10f1 Make the transition table dump easier to understand by labeling each entry with its
index.
2010-07-10 17:49:32 -07:00
John Johansen
1004f039ec When creating the dfa the sets firstpos, lastpos, and followpos are computed for
each expression tree node and then used as input to create the dfa states.

Currently they are not being freed until the nodes are destroyed, but the information
is no longer needed once the dfa has been created.  Cleaning them up early reduces
peak memory usage.
2010-07-10 17:47:25 -07:00