Commit graph

1503 commits

Author SHA1 Message Date
John Johansen
a8ffa2fbab Rename tags to conform with git tag requirements
Rename tags
  apparmor_2.5.2~rc1  to  apparmor_2.5.2-rc1
  apparmor_2.6.0~rc1  to  apparmor_2.6.0-rc1

this is necessary for export to the git mirror

Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-06-06 10:39:54 -07:00
Steve Beattie
b576c1f0d9 Update version to indicate 2.5.2 release 2011-03-07 14:21:16 -08:00
Steve Beattie
11bfb9a737 Hook up the parser/tst 'make clean' target to the parser's makefile;
modify the parser/tst 'make clean' target to not blow away the readme
file.
2011-03-07 12:14:51 -08:00
Steve Beattie
d8b5dba829 Merge from trunk revs 1671 and 1672: Update project info in
libapparmor's setup.py.in and adjust the python setup to actually match
what swig expects so it will work.

Signed-Off-By: Steve Beattie <sbeattie@ubuntu.com>
2011-03-07 08:11:59 -08:00
Steve Beattie
04b428bc32 Merge from trunk revs 1660 and 1661: Update swig to export all current
interface fns, and update change_hatv and change_hat_vargs prototypes to
use long (this would be an ABI change; however, there are no known users
of those particular functions).

Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-03-07 07:56:00 -08:00
Steve Beattie
03b8aee481 Merge from trunk revs 1676 and 1677: Override AF_MAX for kernels that
don't support proper masking. Older versions of the apparmor kernel
patches didn't handle receiving network tables of a larger size than
expected.  Allow the parser to detect the kernel version and override
the AF_MAX value for those kernels.  This also replaces the hack
using a hardcoded limit of 36 for kernels missing the features flag.

Also, ensure that the buffer read from /proc/sys/kernel/osrelease is
null terminated.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-03-07 07:05:37 -08:00
Steve Beattie
0c52d5219a Merge from trunk rev 1674: Make tcp test support current network syntax,
re-enable tcp test.

Signed-Off-By: Steve Beattie <sbeattie@ubuntu.com>
2011-03-07 06:48:35 -08:00
Steve Beattie
87d4ab1fa5 Merge from trunk rev 1667: more adjustments to the libapparmor license
headers.
2011-02-23 14:05:06 -08:00
Steve Beattie
74ae28012f Merge from trunk rev 1666: Update the copyright message in
apparmor_parser --version

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-23 13:28:53 -08:00
Steve Beattie
8cb6fa9dcd Merge from trunk rev 1658: Update licencing in libapparmor
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-23 13:27:21 -08:00
Steve Beattie
6f82124e52 Adjust clean target to match trunk. 2011-02-16 09:40:07 -08:00
Steve Beattie
d3989823ca toplevel makefile:
- adjust snapshot version to be less than the upcoming version
- add a tag target
- be a little more paranoid in the clean target and adjust for snapshot
  versioning scheme.
2011-02-16 09:35:55 -08:00
Steve Beattie
81dac29f52 Prep for 2.5.2 release 2011-02-16 00:12:38 -08:00
Steve Beattie
aeff455da5 Merge from trunk revisions 1519 and 1619: Add the compatibility patches
for the 2.6.36, 2.6.36.2 and 2.6.37 upstream kernel version of
AppArmor.

Nominated-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-15 23:11:03 -08:00
Steve Beattie
01b7969eee From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor-utils: Inherit flags in sub-profiles when generating profiles
References: bnc#496204

 When creating profiles with cx subprofiles, genprof will set the
 sub-profile in enforce mode. When genprof cycles multiple times, it
 prohibits the sub-profile from working correctly.

 e.g.

 # Last Modified: Mon Jan 24 13:52:26 2011
 #include <tunables/global>

 /home/jeffm/mycat flags=(complain) {
   #include <abstractions/base>
   #include <abstractions/bash>
   #include <abstractions/consoles>

   /bin/bash ix,
   /bin/cat cx,
   /home/jeffm/mycat r,

 profile /bin/cat {
     #include <abstractions/base>

     /bin/cat r,
     /home/jeffm/mycat r,

   }
 }

 This patch allows sub-profiles to inherit the flags from the parent
 profile, which allows it to be created in complain mode (if appropriate).
 The temporary complain flags are cleaned up at genprof completion as
 expected.

 This issue was reported at: https://bugzilla.novell.com/show_bug.cgi?id=496204

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>

Bug: https://launchpad.net/bugs/707092
2011-02-15 16:24:33 -08:00
Steve Beattie
8db18e6eb7 From: Jeff Mahoney <jeffm@suse.com>
Subject: Subdomain.pm: Fix for null path
References: bnc#407959

When handling the following log entry, logprof will spew perl errors and
ultimately generate an invalid config: "r,"

Since there is nothing to do with a null path, just skip to the next entry.

type=APPARMOR_DENIED msg=audit(1214497030.421:39): operation="inode_permission" info="Failed name resolution - object not a valid entry" requested_mask="r" denied_mask="r" pid=31367 profile="/usr/sbin/httpd2-worker

Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-15 14:42:10 -08:00
Steve Beattie
5e5d91ba76 From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor: Subdomain.pm: Fix handling of audits of unconfined processes

 The version of AppArmor that was accepted into the mainline kernel
 issues audit events for things like change_hat while unconfined.
 Previous versions just returned -EPERM without the audit.

 This results in logprof and friends spewing uninitialized value errors
 when it hits events like:
 type=AVC msg=audit(1291742101.899:220): apparmor="DENIED" operation="change_hat" info="unconfined" error=-1 pid=28005 comm="cron

 ... which happen any time an unconfined process does something with pam
 when pam_apparmor is installed.

 This patch skips those events.

[Note that the second half of the OpenSUSE patch had already been applied.]

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-15 11:14:15 -08:00
Steve Beattie
1d43cdae44 From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor-profiles: Fix proc usage in firefox profile
References: bnc#436262

 This patch corrects the use of the {proc} macro. It should be {PROC}.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-15 11:01:55 -08:00
Steve Beattie
bd6e9dcb9e From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor: Fix incorrect /proc/*/sys usage in usr.sbin.ntpd
References: bnc#634801

 /proc/sys/kernel exists, but /proc/*/sys/kernel doesn't. This patch
 fixes the profile.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-15 10:50:16 -08:00
Steve Beattie
955404ca00 Author: Jamie Strandboge <jamie@canonical.com>
Description: the Ubuntu buildds do not have the AppArmor securityfs mounted, so
 the cache tests fail. This patch skips these tests if the introspection
 directory is not mounted, but runs them if it is. This should allow testing of
 local builds while still allowing builds on the official buildds.

Acked-By: Steve Beattie <sbeattie@ubuntu.com> - both Ubuntu and
OpenSUSE were carrying patches that disabled the caching test,
though OpenSUSE's disabled it completely rather than checking. The
parser builds need to complete even when the kernel it's building on
doesn't support AppArmor or all the extensions that the parser needs
at runtime.
2011-02-15 10:34:17 -08:00
Steve Beattie
5425aadb6d From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor-utils: Translation unification
References: bnc#586072

 This patch removes small inconsistencies between identical strings to
 allow for easier translation.

Reported-by: Isis Binder <isis.binder@gmail.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-08 16:19:25 -08:00
Steve Beattie
08df8d93ce Merge from trunk rev 1644: Purge utils/severity.pl due to incorrect
license/copyright statement. It should have been covered under both
the Immunix acquisition by Novell Inc and by the open sourcing of
the apparmor tree by Novell Inc.
2011-02-08 15:56:43 -08:00
Steve Beattie
34c013f036 From: Jeff Mahoney <jeffm@suse.com>
Subject: [PATCH] apparmor-utils: cleanup after abort in genprof
References: bnc#307067

 The initial generation of the base profile is required to be written out
 to put the process in complain mode for observation. If the user
 decides to abort the profiling session, that base profile is left
 behind.

 This patch removes all profiles created during the run up to an abort.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-08 14:49:32 -08:00
Steve Beattie
ab927317e5 Merge from trunk rev 1639: Fix compilation in deprecated gnome
apparmor applet.

Nominated-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-08 13:20:05 -08:00
Steve Beattie
c1dacca6c7 From: Jeff Mahoney <jeffm@suse.com>
utils/Makefile: abstract out the perl vendor location for distros to
override if necessary

Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-08 10:35:10 -08:00
Steve Beattie
aa024ec29c From: Jeff Mahoney <jeffm@suse.com>
Fix grammar in in utils UI text.
2011-02-08 10:23:11 -08:00
Steve Beattie
829e75b2e2 Merge from trunk rev 1636: libapparmor: remove LD_RUN_PATH from swig
generated makefile as it results in an rpath binding in the library.

Nominated-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-02-08 09:48:57 -08:00
Steve Beattie
b5754812f0 Makefile: make setup target work independently. 2011-02-08 09:32:16 -08:00
Steve Beattie
3cb964c5ee Subject: logprof - variable definitions should not have trailing commas.
This patch fixes a logprof bug where when profiles with variable
declarations at the top level (not hidden in an include) were written
back to a file, a trailing comma was being added to the declaration
statement, which is invalid apparmor policy syntax. This patch corrects
this and no longer adds the trailing comma.
2011-02-04 21:16:20 -08:00
Steve Beattie
05450ac38a From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor: Fix network event parsing
References: bnc#665483

 The upstream version of AppArmor had network mediation but it was
 removed. There's a compability patch floating around that both openSUSE
 and Ubuntu have applied to their kernels. Unfortunately, one part was
 overlooked. The socket operation event names where changed from the
 socket_ prefixed names they had when AppArmor was out-of-tree and
 utils/SubDomain.pm was never updated to understand them.

 This patch adds an operation-type table so that the code can just
 do a optype($operation) call to discover what type of operation a
 particular name refers to. It then uses this in place of the socket_
 checks to decide whether an event is a network operation.

 This allows genprof and logprof to work with networking rules again.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>


Bug: https://launchpad.net/bugs/706733
2011-01-24 15:09:08 -08:00
Steve Beattie
d788ceb928 From: Jeff Mahoney <jeffm@suse.com>
Subject: apparmor-parser: Fix up translations
References: bnc#586070

Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 17:43:44 -06:00
Steve Beattie
c1a11fb8b6 Merge from trunk revision 1572: This patch fixes the parser's lexer to
not passthrough other invalid characters in variable declarations. It
also adds testcases demonstrating the issue.

Nominated-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 16:55:20 -06:00
Steve Beattie
d7e06b79bb Merge from trunk revision 1571: This patch fixes the parser to return
an error when variable declaration statements contain trailing commas,
instead of passing them through to STDOUT. It also adds parser
testcases demonstrating the issue.

Nominated-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 16:53:51 -06:00
Steve Beattie
7714b62889 Merge from trunk revision 1620: Attached is an updated dnsmasq profile
that fixes the following:
- allow net_admin capability for DHCP server
- allow net_raw and network inet raw for ICMP pings when used as a DHCP server
- allow read and write access to libvirt pid files for dnsmasq

See the FAQ in the dnsmasq source for details. This fixes
https://launchpad.net/bugs/697239

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 11:38:56 -06:00
Steve Beattie
bdb6eb82b6 Merge from trunk revision 1615: abstractions/freedesktop.org updates:
- require owner match for files in @{HOME}
- add new path for @{HOME}/.local/share/recently-used.xbel*
- add the following, confirmed via specifications:
  /usr/share/applications/mimeinfo.cache r,
  /usr/share/applications/*.desktop r,
  owner @{HOME}/.local/share/applications/defaults.list r,
  owner @{HOME}/.local/share/applications/mimeinfo.cache r,
  owner @{HOME}/.local/share/applications/mimeapps.list r,
  owner @{HOME}/.local/share/applications/*.desktop r,

References:
http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-0.9.4.html
http://www.freedesktop.org/wiki/Specifications/mime-actions-spec

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 11:35:15 -06:00
Steve Beattie
9142fc482a Merge from trunk revision 1614: abstractions/X: allow access to
/usr/lib32 and /usr/lib64 for dri modules (LP: #658135)

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 11:34:12 -06:00
Steve Beattie
1c55cf035c Merge from trunk revision 1613: add enchant abstraction. Enchant is a
frontend for spellcheckers and in use by more and more applications,
including empathy and evolution. It is listed on freedesktop.org. See:
http://www.abisource.com/projects/enchant/

This abstraction gives access to enchant itself, files in the user's
home directory for enchant and various dictionaries for:
  - aspell
  - ispell
  - hunspell
  - myspell
  - hspell
  - zemberek
  - voikko

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 11:31:44 -06:00
Steve Beattie
05dfb21b32 Merge from trunk revision 1612: allow 'rw' to /var/log/samba/cores/
(LP: #652562)

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 11:30:18 -06:00
Steve Beattie
4f856a0510 Merge from trunk revision 1611: add preliminary ibus abstraction. Will
likely need more once more ibus users start to use it. Additionally,
the 'rw' on the @{HOME}/.config/ibus/bus/ probably only needs 'create'
and 'chmod', so that could be tightened up once those are exposed in
the tools. LP: #649497.

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 11:28:30 -06:00
Steve Beattie
0a14cf2849 Merge from trunk revision 1610: abstractions/user-manpages: require
owner match for files in @{HOME} and /tmp

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 11:26:42 -06:00
Steve Beattie
fcd150c239 Merge from trunk revision 1609: abstractions/user-mail:
- use character globbing
  - require owner match for files in @{HOME}

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 11:25:16 -06:00
Steve Beattie
b33ff8be7f Merge from trunk revision 1608: abstractions/user-write:
- require owner match
  - add @{HOME}/Public/

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 11:23:58 -06:00
Steve Beattie
27257d564b Merge from trunk revision 1607: abstractions/user-download:
- fix typo for Desktop (should be Desktop/)
  - require owner match
  - allow writes to @{HOME}/[dD]ownload{,s}

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-14 11:21:38 -06:00
Steve Beattie
793bc2cc01 Merge from trunk revision 1595: add aa_change_profile.pod manpage and
reference it in aa_change_hat.pod

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-13 17:06:58 -06:00
Steve Beattie
4edf5a5a06 Merge from trunk revision 1582: update the man pages to:
* add Canonical to the headers of the pod files touched
    * use aa_change_hat() instead of change_hat() (LP: #692216)
    * use http://wiki.apparmor.net in the SEE ALSO
    * use http://https://bugs.launchpad.net/apparmor/+filebug for bugs
    * prefix 'aa-' in SEE ALSO section for utilities (eg, 'aa-complain'
      for 'complain')

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-13 16:29:20 -06:00
Steve Beattie
0a3c61b75f Merge from trunk revision 1581:
changehat/mod_apparmor/mod_apparmor.pod: make several clarifications
and add a summary for the order of operations

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-13 16:14:17 -06:00
Steve Beattie
ddf1e922d0 Merge from trunk revision 1580: parser/apparmor.d.pod: more fully
document child profiles, including:
    - cx and Cx
    - change_profile()

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-13 16:04:35 -06:00
Steve Beattie
2cc5b3ae70 Merge from trunk revision 1579: apparmor.d.pod: document [^]
Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-13 15:59:27 -06:00
Steve Beattie
e66c163042 Merge from trunk revision 1578: document audit, deny and owner rule
qualifiers (LP: #349049)

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-13 15:58:04 -06:00
Steve Beattie
d34b3d0d7f Merge from trunk revision 1577: mod_apparmor.pod: adjust for Canonical,
launchpad and Ubuntu binaries and tools

Nominated-by: Jamie Strandboge <jamie@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-01-13 15:55:26 -06:00