Commit graph

478 commits

Author SHA1 Message Date
Steve Beattie
79e6a4fec5 This patch fixes up a couple of bashisms in the rc.apparmor.functions
file that prevented it from working correctly on systems where /bin/sh
isn't bash, and is probably more readable to boot. It still will parse
things properly when confined binaries or thier corresponding profiles
contain spaces in their names.

Fix based on feedback and patches from Arkadiusz Miskiewicz
<arekm@maven.pl>/PLD and Kees Cook/Ubuntu.
2007-03-27 18:38:28 +00:00
Steve Beattie
c54f56b49f Fixup another messed up NAME section, this time for apparmor.7. 2007-03-27 03:50:21 +00:00
Steve Beattie
c2d4717c12 Blarg, pod2man needed a blank line between =pod and =head1 to get the
NAME section correct. This fixes a lintian warning as reported by Kees
Cook of Ubuntu.
2007-03-26 21:22:28 +00:00
Steve Beattie
a2b9ac62fc Minor initscript cleanups thanks to Kees Cook and Magnus Runesson's
Ubuntification.
2007-03-26 20:52:45 +00:00
Andreas Gruenbacher
188a1b56c4 Bunch of stuff in reply to JJ's latest updates 2007-03-26 19:37:35 +00:00
Steve Beattie
89158886fe Bleah, we weren't including the made specfile (with the embedded svn
repository version) into the 'dist' tarballs.
2007-03-26 19:30:14 +00:00
John Johansen
4603c8829d patch to convert complain mode to learning mode 2007-03-26 19:12:41 +00:00
Steve Beattie
86576e01c8 Fix from Magnus Runesson <m.runesson@gmail.com>/Ubuntu to
remove pod2man/podhtml tmpfiles during 'make clean'.
2007-03-26 19:09:59 +00:00
Steve Beattie
9c95d02ac8 Patch from Magnus Runesson <m.runesson@gmail.com> / Ubuntu. We exclude
the papers directory from the generated tarballs, so attempting to
install them in 'make install' won't work so well.
2007-03-26 17:07:51 +00:00
John Johansen
7d43226fbd A fix_apparmor_getprocattr.diff
fix getprocattr so that it returns the start of the profile name string
instead of the end of it.

A      rcu-locking-docs.txt
Change the locking docs to reflect the locking changes for rcu
aa_task_contexts

A      fix-rename-file-type.diff
Use the dentry->inode to determine if the medieated dentry is a directory.
The use of the inode that is pasted in is incorrect because it is
often the parent inode of the dentry being mediated.

A      misc-typos.diff
Fix a few miscellaneous typos

A      rcu-stale-forward-ptr.diff
A      rcu-caps-cache-comment.diff
Add a comment as to why resetting the caps cache instead of propogating it
is the right thing to do.

A      warn-info-messages.diff
Convert AA_WARN to us aa_audit_message, most of these messages while
not necessary for learning mode should be present in the logs with
the other apparmor messages.

A      rename-activate-unpack.diff
rename the interface routines to use unpack instead of activate, its
simpler and more standard.

j
2007-03-26 10:18:14 +00:00
John Johansen
f5a8698fdf add back in MAY_APPEND filtering that was accidentally removed in r475 with dir rename fix 2007-03-25 07:08:36 +00:00
Jesse Michael
0d2e46088b need these fixes for the regression tests to run on ubuntu 2007-03-24 00:59:27 +00:00
Steve Beattie
ec03fafc16 Whoops, referred to a a couple of aa_eventd functions in
rc.apparmor.functions.
2007-03-24 00:13:04 +00:00
Steve Beattie
f85eb7fdc2 Fix build failure. 2007-03-23 23:52:36 +00:00
Steve Beattie
1afc2eee2b Add build dependency on g++ compiler
Pass on extra warning flags to pcre lib.
No need for recursive delete on the libstdc++ line.
2007-03-23 20:48:29 +00:00
Steve Beattie
a63b132ea2 Add a testcase for a writeonly link (wl -> w) 2007-03-23 19:10:45 +00:00
Steve Beattie
f5109ad203 This patch makes the utils tools consistent with the initscript as to
which sets of files they ignore (rpm backups, dotfiles, and emacs
backups). It moves the tests into a common function so that
modifications only need to occur in one location.
2007-03-23 18:52:22 +00:00
John Johansen
ee3f92d459 add test for the renaming of a directory over and existing directory. Remove the patch that does the same from for-mainline since it is no longer necessary 2007-03-23 17:33:25 +00:00
John Johansen
e981282bd4 add tests for mediate of the creation of the symlink link file. Remove the patch from for-mainline since it is no longer necessary 2007-03-23 17:31:32 +00:00
Steve Beattie
c7c33eee45 Kill no longer needed filesystem type #defines; checking MS_NOUSER
obviates the need for them (and they're no longer refeenced).
2007-03-23 17:23:15 +00:00
John Johansen
be282c5eba fix a subtle race in freeing a profile.
AppArmor's use of RCU is non-standard in that the profile is RCU protected
and ref count protected at the same time.  A race can occur between
removing a task removing profile reference from the subdomain and another
task getting a reference to the profile from the subdomain.

Task A					Task B
					tmp = read subdomain->profile
subdomain->profile = NULL
aa_put_profile(subdomain->profile) <- ref_count goes to 0
					aa_get_profile(tmp)
profile is put on rcu_callback list
					aa_put_profile(profile)
					profile is put on rcu_callback list
					again using same rcu_head

The problem lies in the subtle distinction of the profile reference count
held by a subdomain, vs. all other profile reference counts.

The reference count held by the subdomain is an RCU protected reference
count so the profile it references can only be freed after an rcu cycle.
The reference being only read side RCU protected can be read at any
point is the rcu cycle before the subdomain->profile reference is updated.
The updating of the profile reference count is not atomic to this
resulting in the race.

Using seperate put functions for the rcu protected subdomain->profile
reference vs other profile references, where the rcu put adds the profile
to the rcu callback list and the regular put frees the profile directly
won't work either since rcu reference count has the same race.
This just results in the profile being freed twice instead of putting the
profile on the rcu callback list twice.
2007-03-23 17:01:29 +00:00
John Johansen
4d9fde38db Allow capability to stack under AppArmor. This is a fake stacking
however in that the capability hooks never get called.  This shouldn't
be a big problem since AppArmor already composes capability through
use of common cap.

This just prevents the user from having to deal with/understand the
error message that occurs when the capability module fails to stack
with AppArmor.
2007-03-23 16:41:43 +00:00
John Johansen
399561b10d Allow the dazukoo module to stack under AppArmor 2007-03-23 16:38:18 +00:00
John Johansen
93bce9f127 Use the MS_NOUSER flag to detect mediated filesystems. This is better
than the VALID_FS_CHECK because it is simpler and can account for
all filesystem types that shouldn't be mediated.  Where the old
VALID_FS_CHECK would fail for filesystem not in its list.
2007-03-23 16:37:40 +00:00
John Johansen
0df473374a Fix dir rename bug. There was a bug where if directory A already existed
a rename of directory B to directory A would always succeed even if the
profile didn't allow write access on directory A.
2007-03-23 16:34:51 +00:00
John Johansen
3e9c934528 Add mediation of symlink file creation. This doesn't mediate that the
path that the link points to is valid.  Rather it checks whether the
profile allows the creation of the link file.
2007-03-23 16:32:07 +00:00
John Johansen
7c3e6cf525 A small optimization used to calculate the size of the pathname 2007-03-23 16:29:29 +00:00
John Johansen
0060caec1a Fix a race between path lookup and removal of " (deleted)" that could
result in incorrect removal of " (deleted)" from the pathname.

The race is as follows:
the path contains " (deleted)", which is unlikely but valid
during path lookup the path is valid
after path lookup before the deleted test the dentry is unhashed
the deleted test now succeeds but the pathname never had " (deleted)"
appended by d_path.  The paths " (deleted)" string is removed
and an incorrect path is returned
2007-03-23 16:28:10 +00:00
Andreas Gruenbacher
38fe3a0bf6 Add further locking improvement proposal. 2007-03-22 22:34:19 +00:00
Matt Barringer
19efd07a71 Fixed formatting. 2007-03-22 20:42:36 +00:00
Andreas Gruenbacher
6814e22b73 Add changes missing in rcu-task-context-2.diff 2007-03-22 13:05:13 +00:00
Andreas Gruenbacher
98f6ce46d1 A cleanup in aa_change_hat() 2007-03-22 10:10:59 +00:00
Andreas Gruenbacher
504721f4f4 Add rcu-task-context-2.diff and no-inline-aa_change_task_context.diff. 2007-03-22 09:38:56 +00:00
Andreas Gruenbacher
c377d49bf9 Add comment 2007-03-22 08:20:24 +00:00
Matt Barringer
371f984e09 Initial checkin of the netdomain test suite. It requires
dejagnu (which, in turn, requires tcl).
2007-03-21 22:27:37 +00:00
John Johansen
f6244becd4 use rcu for aa_task_context 2007-03-21 22:21:13 +00:00
Jesse Michael
fd5aa90427 remove last vestiges of Immunix::Ycp from yast2-apparmor 2007-03-21 16:53:41 +00:00
Jesse Michael
360ffc756e re-enable warnings for the utils perl modules and fix a couple initial
problems exposed by that.  there are likely to be more fixes coming.
2007-03-21 16:49:39 +00:00
Jesse Michael
e5ac6de656 fix typo in fork tracking code that could result in applications that
are currently running while logprof/genprof is used being left in the 
null-complain profile instead of being moved to the profile the user
has just specified.  

the profiles are updated correctly though, so if the application is 
stopped and restarted, it will be confined by the appropriate profile.
2007-03-21 15:54:57 +00:00
Steve Beattie
5ec36e6c2b I cretanily maek lost fo tyops, smoetimes. 2007-03-21 02:01:49 +00:00
Seth Arnold
263843da4b typo fix; usernmae --> username 2007-03-20 22:04:21 +00:00
Jesse Michael
d8ae032328 used perltidy to clean up the formatting for the perl scripts in the
utils package and manually fixed some places where perltidy's
reformatting made it harder to read.  the options used were--

-i=4    # 4-space indentation
-l=0    # unlimited line length (for now)
-pt=2   # slightly tightened parens
-ce     # cuddled elses
-nolq   # don't outdent long quotes
-nsfs   # don't add spaces in front of semi-colons in for ( ) statements
-isbc   # only indent block comments that have whitespace in front of them
-otr    # don't place a break between a comma and an opening brace

the code will be refactored to make it possible to switch to using 
80-column line-breaks without resorting to really nasty formatting 
constructs.
2007-03-20 21:58:38 +00:00
Andreas Gruenbacher
f29097e401 Improved version of the last format string fix 2007-03-20 17:41:36 +00:00
Andreas Gruenbacher
fb62f5c553 Replace force_dir_on_negative_dentry.diff with rename-file-type.diff 2007-03-20 17:39:51 +00:00
Andreas Gruenbacher
d1e9b24234 Drop obsolete audit-unterminated-string.diff, and add apparmor_getprocattr.diff. 2007-03-20 16:10:56 +00:00
Andreas Gruenbacher
96f896c193 Fix warning 2007-03-20 15:56:50 +00:00
John Johansen
78ba031fc7 Add basic script used to convert module/apparmor into kernel patch snapshot 2007-03-19 11:13:05 +00:00
John Johansen
6f03656049 Add brief readme used to explain layout of kernel-patches snapshots 2007-03-19 11:11:05 +00:00
John Johansen
31b181fcf8 update namespace semaphore patch for changes in 2.6.20 2007-03-19 11:10:01 +00:00
John Johansen
9aae261afd remove temporary development branches of the parser 2007-03-19 07:19:04 +00:00