Commit graph

277 commits

Author SHA1 Message Date
John Johansen
648166ecca Fix error case of aa_getprocattr to set buffers to NULL
While aa_getprocattr does return the documented error code on failure
the **buf and **mode parameters can point into the buffer that was
allocated and then discarded on failure.

Set them to null on failure so that even if the error code is ignored
they do not point to heap data.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-03-22 07:57:18 -07:00
Steve Beattie
fb55e9cddc Two patches in one:
From: Kees Cook <kees@ubuntu.com>
This is a trivial manpage fix that makes pod2man stop yelling at me.
Acked-By: Steve Beattie <sbeattie@ubuntu.com>

From: Steve Beattie <sbeattie@ubuntu.com>
This patch adds --stderr to pod2man to make it report errors, as well as
fixes a few other minor text issues I noticed.
Acked-by: Kees Cook <kees@ubuntu.com>
2012-02-15 16:34:03 -08:00
John Johansen
f0f520eeff Update the documented error codes for aa_change_profile() and aa_change_onexe()
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees@ubuntu.com>
2012-01-02 15:34:23 -08:00
Steve Beattie
1e8dc4f375 This fixes the libapparmor log parsing library to properly parse log
entries where the comm entry has been hex-encoded. This occurs when the
binary being confined contains a space or other problematic character in
its filename. A test case is included.
2011-11-30 11:07:48 -08:00
Steve Beattie
7988124de5 Add a testcase for libapparmor for encoded profiles to ensure that
https://bugs.launchpad.net/apparmor/+bug/897957/ is in the utils and not
the parsing library itself.
2011-11-30 09:53:04 -08:00
John Johansen
e1763ba13c Auther: Michael (kensington)
libapparmor python bindings fail to build with python-3.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-11-10 09:22:09 -08:00
John Johansen
1056ef8418 Add missing documentation updates for aa_is_confined and aa_get_con.
This documentation should have been checked in as part of the patches
that added aa_is_confined and aa_get_con.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-08-31 16:07:55 -07:00
John Johansen
ac77e10a0f Fix missing pid_t dependency in apparmor.h
The define for pid_t is missing in apparmor.h so that if it is included
in programs that don't also include sys/types.h the compile will break.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-08-31 16:01:54 -07:00
Kees Cook
94f06d23c0 add missing libraries/libapparmor/doc/aa_find_mountpoint.pod from https://lists.ubuntu.com/archives/apparmor/2011-July/001280.html 2011-08-10 22:52:05 -07:00
Kees Cook
a8e0b0d0a3 add missed libraries/libapparmor/doc/aa_getcon.pod from https://lists.ubuntu.com/archives/apparmor/2011-July/001282.html 2011-08-10 22:49:16 -07:00
John Johansen
0287ce0c9d Function to test if apparmor support is enabled.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-08-09 06:48:56 -07:00
John Johansen
aae597bfde Library function to find the apparmorfs filesystem mount point
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-08-09 06:48:17 -07:00
John Johansen
8347fb69c2 Library interface for tasks introspecting confinement.
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-08-09 06:47:40 -07:00
John Johansen
685632db0c Add the ability to read proc attr interfaces
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-08-09 06:45:51 -07:00
John Johansen
a43931e987 Update the man page for change_hat/change_profile
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-07-22 05:20:06 -07:00
John Johansen
2fec4eb2b4 Make setprocattr more abstract so it will work for any pid
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-07-21 11:10:35 -07:00
John Johansen
3f59259dec Abstract out the construction of proc path generation more.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-07-21 11:09:22 -07:00
John Johansen
2c110ed3d5 Abstract the libraries getting of the tid
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-07-21 11:06:57 -07:00
Kees Cook
25f7aa6621 adjust documentation "release" name to match other manpages.
Signed-off-by: Kees Cook <kees.cook@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-05-27 15:04:42 -07:00
Kees Cook
e9d5d491b8 define PATH_MAX when missing from limits.h
Some non-Linux systems do not define PATH_MAX (Hurd). Since I have no
interest in supporting a fully dynamic PATH_MAX in AppArmor, work around
this by just defining a static value that matches Linux's limits.h value.

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-05-27 14:20:03 -07:00
Kees Cook
a25a2ec0d9 On Hurd and kfreebsd under Debian, I have disabled the build of the parser
since things go extremely badly when capabilities disappear. If someone
wants to work on it, I have some initial patch attempts, but it was getting
too time-consuming, so I back-burnered the parser. A very small change was
needed to get the libraries to build, and this is it.

Description: Workaround non-Linux environments to build everything but the
 parser.
Author: Kees Cook <kees@debian.org>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-05-02 13:38:12 -07:00
Steve Beattie
2fed7cdb61 Adjust the python setup to actually match what swig expects so it will work 2011-02-23 23:34:36 -08:00
Steve Beattie
cd97402779 Update project info in libapparmor's setup.py.in. 2011-02-23 21:10:20 -08:00
Steve Beattie
3dde3d5322 libraries/libapparmor/: more license cleanups, adjust my email address
in the AUTHORS file.
2011-02-23 14:02:45 -08:00
John Johansen
ee0d5b7d50 Update documentation for change_hatv, change_hat_varags and change_onexec
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-02-22 03:55:53 -08:00
John Johansen
6d62a3634e Update change_hatv and change_hat_vargs prototypes to use long
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-02-22 03:55:16 -08:00
John Johansen
54fd453d35 Update swig to export all current interface fns
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-02-22 03:54:35 -08:00
John Johansen
18537e6c38 Rename change_hat.c to kernel_interface.c
Rename change_hat.c to kernel_interface.c to better reflect that it
is providing multiple kernel_interfaces.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-02-22 03:53:39 -08:00
John Johansen
7e78ee6363 Update licencing in libapparmor
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-02-22 03:51:16 -08:00
Steve Beattie
94dfe15b28 From: Jeff Mahoney <jeffm@suse.com>
libapparmor: remove LD_RUN_PATH from swig generated makefile as it
results in an rpath binding in the library.
2011-02-08 09:27:32 -08:00
Steve Beattie
1c2591de1e This patch removes all of the old log parsing code from libapparmor.
The testcases that were in place for the old style log messages have
had their expected output modified such that they are expected to
return invalid results, rather than deleting the testcases outright.
2011-01-21 11:47:54 -08:00
Steve Beattie
cb96345f21 From: Jeff Mahoney <jeffm@suse.com>
dynamically link in libapparmor library in libapparmor's testsuite.
2011-01-05 14:41:11 -08:00
Kees Cook
723a20ba7d as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
Jamie Strandboge
b3c6ec3ded add aa_change_profile.pod manpage and reference it in aa_change_hat.pod 2010-12-20 14:01:58 -06:00
Jamie Strandboge
49f27414e0 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')
2010-12-20 13:47:09 -06:00
Kees Cook
eaa6a3c297 This cleans up a number of warnings that appeared after the parser rework
commits were made (as well as a few other minor warnings elsewhere).

The Makefile change is to avoid passing -Wstrict-prototypes and
-Wnested-externs to the C++ compiler, which the compiler yells about and
then ignores.

Since we compile with -Wmissing-field-initializers I dropped the
unreferenced zero-width fields in the header structs, and then explicitly
initialized the remaining fields.

I tagged several unused function parameters to silence those warnings.

And finally, I dropped the unused filter_escapes() too.
2010-11-09 13:39:18 -08:00
Kees Cook
225c779225 This patch cleans up the testsuite output harder, and removes a bashism in
another clean target.
2010-11-03 17:04:43 -07:00
Steve Beattie
c90b199488 This patch moves the overall version definition of the software out of
the common/Make.rules file into common/Version so that libapparmor's
configure.in can make use of it, meaning there's one less thing to
adjust when updating the version. It also bumps the trunk version
from 2.5 to 2.5.90 in (perhaps excessively long) preparation for the
2.6.0 release, and to indicate that it's newer than the 2.5.x branch.
2010-10-07 15:37:30 -07:00
Steve Beattie
8fd1f15ae7 Add testcases for trunk commits 1486-1490. 2010-09-09 17:14:25 -07:00
John Johansen
5c43890b31 Change the second key_capability entry into a comment and document why
its there and what to do with it once the old entry types are cleaned up.
2010-09-09 16:51:44 -07:00
John Johansen
073064bdb0 The new apparmor module uses has added a target key that is used to report
the target of an operation instead of name2 used in previous kernels
2010-09-09 12:22:02 -07:00
John Johansen
59597775e5 Status messages have and offset field used to debug why and where a policy
load failed.  For now just ignore it.
2010-09-09 12:21:19 -07:00
John Johansen
4c666b4d2f The kernel can return negative error codes for error= 2010-09-09 12:20:30 -07:00
John Johansen
1e098b5928 The capability operation picked up the capability and capname fields.
capability is reported by LSM_AUDIT and is just the capability number.
capname is reported by the apparmor module and is the name the kernel
knows the capability as.

For now just use capname and silently drop capability when it is found.
2010-09-09 12:19:08 -07:00
John Johansen
4fcd7e94f5 If encountered the scanner will dump unmatched text from <audit_id>. 2010-09-09 12:17:03 -07:00
Steve Beattie
046e1fb215 This is an incomplete fix for bug
https://bugs.launchpad.net/apparmor/+bug/623467

This patch adds some additional testcases to the log parsing
testsuite, to cover rejections for operations that aren't covered by
other testcase (truncate, rename_src, rename_dest, mkdir) as well
as fixing SubDomain.pm to take those operations into account when
parsing log files.

The operations link, unlink, and possibly setattr still need to be
covered by SubDomain.pm
2010-08-25 09:53:39 -07:00
Steve Beattie
341877416e Creating lame empty error files that dejagnu needs for its tests.
Apologies for not getting an ACK on this commit.
2010-08-23 22:34:51 -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
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