[apparmor] [PATCH 5/6] tests: Add abstract socket tests to unix_socket.sh

2014-09-04 Thread Tyler Hicks
Tests abstract UNIX domain sockets with various combinations of implied permissions, explicit permissions, and conditionals. It also tests with bad permissions and conditionals. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket.sh | 176 --- 1 file

[apparmor] [PATCH 3/6] tests: Update unix_socket.sh pathname based socket tests for v7

2014-09-04 Thread Tyler Hicks
ned-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket.sh | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/regression/apparmor/unix_socket.sh b/tests/regression/apparmor/unix_socket.sh index 10fa59d..8fd70dd 100755 --- a/tests/regression/apparmor/unix

[apparmor] [PATCH 4/6] tests: Migrate unix_socket tests from poll to sock IO timeouts

2014-09-04 Thread Tyler Hicks
: Tyler Hicks --- tests/regression/apparmor/unix_socket.c| 43 +++--- tests/regression/apparmor/unix_socket.sh | 13 +--- tests/regression/apparmor/unix_socket_client.c | 34 3 files changed, 75 insertions(+), 15 deletions(-) diff --git a

[apparmor] [PATCH 0/6] Add tests for abstract and unnamed UNIX domain sockets

2014-09-04 Thread Tyler Hicks
This patch set creates regression tests for abstract and unnamed UNIX domain sockets for the soon-to-land AppArmor unix rule type. It does this by modifying tests/regression/apparmor/unix_socket{.sh,c,_client.c}. In hindsight, I think it was a good idea to put all of the logic needed for pathname,

[apparmor] [PATCH 1/6] tests: Create lists of unix_socket perm tests

2014-09-04 Thread Tyler Hicks
. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket.sh | 90 +--- 1 file changed, 35 insertions(+), 55 deletions(-) diff --git a/tests/regression/apparmor/unix_socket.sh b/tests/regression/apparmor/unix_socket.sh index 3d70886..b4fd59d 100755 --- a

[apparmor] [PATCH 6/6] tests: Update unix_socket to test for unnamed sockets

2014-09-04 Thread Tyler Hicks
Update the test server program to use socketpair() and pass the socket fd to the client program. Make the test script aware of the special "none" keyword for unnamed UNIX domain sockets. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket.c

[apparmor] [PATCH 2/6] tests: Update mkprofile.pl to accept unix rules

2014-09-04 Thread Tyler Hicks
Example gen_unix() inputs and outputs: "unix:ALL" -> " unix,\n" "unix:(create,bind,listen,accept):addr=@foo:peer=(label=bar)" -> " unix (create,bind,listen accept) addr=@foo peer=(label=bar),\n" Signed-off-by: Tyler Hicks ---

[apparmor] [PATCH 3/4] tests: Update unix_fd_server.sh for af_unix mediation

2014-09-04 Thread Tyler Hicks
Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_fd_server.sh | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tests/regression/apparmor/unix_fd_server.sh b/tests/regression/apparmor/unix_fd_server.sh index 6bc5158..b38ec68 100755

[apparmor] [PATCH 4/4] tests: Update dbus.inc for af_unix mediation

2014-09-04 Thread Tyler Hicks
ture changes in libdbus. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/dbus.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/regression/apparmor/dbus.inc b/tests/regression/apparmor/dbus.inc index 539d128..038ccf2 100755 --- a/tests/regression/apparmor/dbus.inc +++ b/t

[apparmor] [PATCH 2/4] tests: Update socketpair.sh for af_unix mediation

2014-09-04 Thread Tyler Hicks
Signed-off-by: Tyler Hicks --- tests/regression/apparmor/socketpair.sh | 39 - 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/tests/regression/apparmor/socketpair.sh b/tests/regression/apparmor/socketpair.sh index 8af3be2..802657c 100755 --- a

[apparmor] [PATCH 1/4] tests: Update deleted.sh for af_unix mediation

2014-09-04 Thread Tyler Hicks
Signed-off-by: Tyler Hicks --- tests/regression/apparmor/deleted.sh | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/regression/apparmor/deleted.sh b/tests/regression/apparmor/deleted.sh index a058b39..84a51fc 100755 --- a/tests/regression/apparmor

Re: [apparmor] [PATCH] tests: Add dbus tests for unrequested reply messages

2014-09-05 Thread Tyler Hicks
On 2014-08-28 14:07:48, Seth Arnold wrote: > On Thu, Aug 28, 2014 at 02:41:21AM -0500, Tyler Hicks wrote: > > Unrequested replies are message types that are typically replies, such > > as error and method_return message types, but have not been requested by > > the recipient.

Re: [apparmor] [patch 18/12] v3 unix socket rules

2014-09-05 Thread Tyler Hicks
On 2014-09-05 09:25:03, John Johansen wrote: > Do not output local permissions for rules that have peer_conditionals > > while it is not possible to specify a rule with local conditionals with > peer conditionals > eg. >unix listen peer=(addr=@foo), > > a rule such as >unix peer=(addr=@fo

Re: [apparmor] [patch 18/12] v3 unix socket rules

2014-09-05 Thread Tyler Hicks
On 2014-09-05 10:36:32, John Johansen wrote: > On 09/05/2014 10:23 AM, Tyler Hicks wrote: > > On 2014-09-05 09:25:03, John Johansen wrote: > >> Do not output local permissions for rules that have peer_conditionals > >> > >> while it is not possible to specify

Re: [apparmor] [PATCH 2/4] tests: Update socketpair.sh for af_unix mediation

2014-09-10 Thread Tyler Hicks
On 2014-09-10 18:31:27, Seth Arnold wrote: > On Thu, Sep 04, 2014 at 05:43:22PM -0500, Tyler Hicks wrote: > > Signed-off-by: Tyler Hicks > > Acked-by: Seth Arnold Thanks! > > Is the 'getopt' permission in af_unix_create still necessary? It is. The serve

Re: [apparmor] [PATCH 3/4] tests: Update unix_fd_server.sh for af_unix mediation

2014-09-10 Thread Tyler Hicks
On 2014-09-10 18:53:27, Seth Arnold wrote: > On Thu, Sep 04, 2014 at 05:43:23PM -0500, Tyler Hicks wrote: > > Signed-off-by: Tyler Hicks > > Acked-by: Seth Arnold Thanks again! > > Though I noticed that the unix:create is being passed along to the > -> confined

[apparmor] [PATCH] parser: Sync parser and man page regarding local and peer perms

2014-09-15 Thread Tyler Hicks
describe the two sets of socket permissions and fixes an example rule that resulted in a parser error after the change described above. Signed-off-by: Tyler Hicks --- parser/af_unix.cc | 8 ++-- parser/apparmor.d.pod | 17 + 2 files changed, 11 insertions(+), 14 deletions

[apparmor] [PATCH v2 03/11] tests: Revert to grouping AF_UNIX tests into addr type specific scripts

2014-09-15 Thread Tyler Hicks
having each address type be tested in their own file. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket.sh | 171 -- tests/regression/apparmor/unix_socket_pathname.sh | 129 2 files changed, 129 insertions(+), 171 deletions

[apparmor] [PATCH v2 02/11] tests: Fix socket addr lengths in unix_socket/unix_socket_client

2014-09-15 Thread Tyler Hicks
. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket.c| 13 +++-- tests/regression/apparmor/unix_socket_client.c | 13 +++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/tests/regression/apparmor/unix_socket.c b/tests/regression

[apparmor] [PATCH v2 05/11] tests: Migrate unix_socket tests from poll to sock IO timeouts

2014-09-15 Thread Tyler Hicks
: Tyler Hicks Acked-by: Seth Arnold --- tests/regression/apparmor/unix_socket.c | 43 +-- tests/regression/apparmor/unix_socket_client.c| 34 ++ tests/regression/apparmor/unix_socket_pathname.sh | 4 ++- 3 files changed, 69 insertions(+), 12

[apparmor] [PATCH v2 07/11] tests: Don't call connect() for connectionless sockets

2014-09-15 Thread Tyler Hicks
Use the sendto()/recvfrom() functions when dealing with dgram sockets in unix_socket_client. This allows us to test different interfaces besides the typical write()/read() and will allow for a smaller permissions set for unix_socket_client. Signed-off-by: Tyler Hicks --- tests/regression

[apparmor] [PATCH v2 08/11] tests: Test the shutdown permission in unix_socket

2014-09-15 Thread Tyler Hicks
The server will now do a shutdown() on its socket in order to test the AppArmor 'shutdown' unix rule permission. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests/regression/apparmor/unix_socket.

[apparmor] [PATCH v2 01/11] tests: Exit with error from unix_client if execl() fails

2014-09-15 Thread Tyler Hicks
Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/regression/apparmor/unix_socket.c b/tests/regression/apparmor/unix_socket.c index b6dc0dd..3d86225 100644 --- a/tests/regression/apparmor

[apparmor] [PATCH v2 11/11] tests: Add unnamed socket tests

2014-09-15 Thread Tyler Hicks
Tests abstract UNIX domain sockets with various combinations of implied permissions, explicit permissions, and conditionals. It also tests with bad permissions and conditionals. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket.c | 89 +- tests

[apparmor] [PATCH v2 04/11] tests: Update unix_socket_pathname.sh socket tests for v7

2014-09-15 Thread Tyler Hicks
ned-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket_pathname.sh | 40 ++- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/tests/regression/apparmor/unix_socket_pathname.sh b/tests/regression/apparmor/unix_socket_pathname.sh index b6f6b69..45d74b9 10

[apparmor] [PATCH v2 10/11] tests: Add abstract socket tests

2014-09-15 Thread Tyler Hicks
Tests abstract UNIX domain sockets with various combinations of implied permissions, explicit permissions, and conditionals. It also tests with bad permissions and conditionals. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket.inc | 179 ++ tests

[apparmor] [PATCH v2 09/11] tests: Test the getattr permission in unix_socket_client

2014-09-15 Thread Tyler Hicks
The client will now do a getsockname() on its socket in order to test the AppArmor 'getattr' unix rule permission. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket_client.c| 19 +++ tests/regression/apparmor/unix_socket_pathname.sh | 3 ++

[apparmor] [PATCH v2 06/11] tests: Don't use autobinding in unix_socket_client

2014-09-15 Thread Tyler Hicks
string ".client" will be added to the end of the server's address. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket_client.c| 29 ++-- tests/regression/apparmor/unix_socket_pathname.sh | 40 +-- 2 files changed, 49 insertions(+

Re: [apparmor] [PATCH] parser: Sync parser and man page regarding local and peer perms

2014-09-15 Thread Tyler Hicks
On 2014-09-15 22:47:50, Christian Boltz wrote: > Hello, > > Am Montag, 15. September 2014 schrieb Tyler Hicks: > > +applies to the combination of a local and peer socket. It is required > > +that create, bind, listen, shutdown, getattr, setattr, getopt, and > > +

[apparmor] [PATCH v2] parser: Sync parser and man page regarding local and peer perms

2014-09-18 Thread Tyler Hicks
describe the two sets of socket permissions and fixes an example rule that resulted in a parser error after the change described above. Signed-off-by: Tyler Hicks --- * Changes from v1 - Rewrote the blurb in apparmor.d.pod + Define the 3 sets of permissions (local, peer, and combination) to

Re: [apparmor] [PATCH v2 06/11] tests: Don't use autobinding in unix_socket_client

2014-09-18 Thread Tyler Hicks
On 2014-09-16 16:52:12, Steve Beattie wrote: > On Mon, Sep 15, 2014 at 02:55:59PM -0500, Tyler Hicks wrote: > > The unix_socket_client test program was using an abstract socket, which > > was set up using the autobind feature, when testing any socket address > > types. > &

Re: [apparmor] [patch] tests: fix socketpair tests for added af_unix crosscheck

2014-09-18 Thread Tyler Hicks
additional tests that > are expected to fail when they are not present, to try to ensure that > if our crosscheck behavior changes, we catch it. > > Signed-off-by: Steve Beattie Acked-by: Tyler Hicks Thanks! > --- > tests/regression/apparmor/socketpair.sh | 27 ++

Re: [apparmor] [patch 18/12] v3 unix socket rules

2014-09-22 Thread Tyler Hicks
socket. Which may indeed be the > behavior if we wish to enforce that the socket was created in another > process and passed in. Is this what we want to do? > > Signed-off-by: John Johansen Acked-by: Tyler Hicks I've been testing this patch quite a bit, too. I'm going to

Re: [apparmor] [Patch][parser] if a cache load fails, attempt to rebuild and load it

2014-09-22 Thread Tyler Hicks
On 2014-09-21 04:04:48, John Johansen wrote: > On 09/19/2014 06:48 PM, Seth Arnold wrote: > > On Fri, Sep 19, 2014 at 01:48:09PM -0700, John Johansen wrote: > >> On 09/19/2014 12:37 PM, John Johansen wrote: > >> > >> fix: if the apparmor parser fails to load the cache try rebuilding > >> > >> v2. C

[apparmor] [PATCH v3 5/7] tests: Break up unix_socket getopt and setopt operations

2014-09-22 Thread Tyler Hicks
test policy to test setopt without an addr= conditional and to test getopt with an addr= conditional. Additionally, the wrapper functions that call setsockopt()/getsockopt() are moved into a new file that both unix_socket.c and unix_socket_client.c can reuse. Signed-off-by: Tyler Hicks --- * New

[apparmor] [PATCH v3 2/7] tests: Don't call connect() for connectionless sockets

2014-09-22 Thread Tyler Hicks
Use the sendto()/recvfrom() functions when dealing with dgram sockets in unix_socket_client. This allows us to test different interfaces besides the typical write()/read() and will allow for a smaller permissions set for unix_socket_client. Signed-off-by: Tyler Hicks --- * No changes since v2

[apparmor] [PATCH v3 3/7] tests: Test the shutdown permission in unix_socket

2014-09-22 Thread Tyler Hicks
The server will now do a shutdown() on its socket in order to test the AppArmor 'shutdown' unix rule permission. Signed-off-by: Tyler Hicks --- * No changes since v2 tests/regression/apparmor/unix_socket.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests/regressio

[apparmor] [PATCH v3 7/7] tests: Add unnamed socket tests

2014-09-22 Thread Tyler Hicks
Tests abstract UNIX domain sockets with various combinations of implied permissions, explicit permissions, and conditionals. It also tests with bad permissions and conditionals. Signed-off-by: Tyler Hicks --- * Changes since v2: - Added unix_socket_unnamed to the TESTS variable in the

[apparmor] [PATCH v3 6/7] tests: Add abstract socket tests

2014-09-22 Thread Tyler Hicks
unnamed AF_UNIX socket mediation. The do_test() function is conditionalized in a way that it can test confined servers and confined clients depending on the arguments passed in. Signed-off-by: Tyler Hicks --- * Changes since v2: - Added unix_socket_abstract to the TESTS variable in the

[apparmor] [PATCH v3 0/7] Add regression tests for af_unix mediation

2014-09-22 Thread Tyler Hicks
I've committed the v2 patches that received acks. This v3 patch set contains the remaining patches that have not yet received acks plus a new patch (PATCH 5/7). -- AppArmor mailing list AppArmor@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparm

[apparmor] [PATCH v3 1/7] tests: Don't use autobinding in unix_socket_client

2014-09-22 Thread Tyler Hicks
string ".client" will be added to the end of the server's address. Signed-off-by: Tyler Hicks --- * Changes since v2: - Added missing $client_sockpath argument to a removesockets() call + Found by sbeattie's last review tests/regression/apparmor/unix_soc

[apparmor] [PATCH v3 4/7] tests: Test the getattr permission in unix_socket_client

2014-09-22 Thread Tyler Hicks
The client will now do a getsockname() on its socket in order to test the AppArmor 'getattr' unix rule permission. Signed-off-by: Tyler Hicks --- * No changes since v2 tests/regression/apparmor/unix_socket_client.c| 19 +++ tests/regression/apparmor/unix_socket_p

Re: [apparmor] [Patch][parser]

2014-09-24 Thread Tyler Hicks
On 2014-09-24 11:32:33, John Johansen wrote: > Fix: Parser error when using regex profile names in IPC rules > > BugLink: http://bugs.launchpad.net/bugs/1373085 > > The parser fails to accept certain characters, even when escaped or quoted > as part of the profile or label name in ipc rules. This

Re: [apparmor] [Patch][parser]

2014-09-24 Thread Tyler Hicks
On 2014-09-24 15:00:27, Tyler Hicks wrote: > On 2014-09-24 11:32:33, John Johansen wrote: > > Fix: Parser error when using regex profile names in IPC rules > > > > BugLink: http://bugs.launchpad.net/bugs/1373085 > > > > The parser fails to accept certain charac

[apparmor] [PATCH v3 8/7] tests: Separate client and server AF_UNIX pathname permissions

2014-09-29 Thread Tyler Hicks
The client and server programs require a different set of AF_UNIX permissions. This patch makes it so that the unix rules are constructed differently depending on the program under test. Signed-off-by: Tyler Hicks --- * New patch to address feedback from sbeattie tests/regression/apparmor

[apparmor] [PATCH v3 9/7] tests: Add negative tests for missing individual AF_UNIX pathname perms

2014-09-29 Thread Tyler Hicks
Iterate through the individual client and server AF_UNIX pathname permissions and remove them, one-by-one, to verify that the test fails. Signed-off-by: Tyler Hicks --- * New patch to address feedback from sbeattie tests/regression/apparmor/unix_socket_pathname.sh | 23

Re: [apparmor] [PATCH v3 4/7] tests: Test the getattr permission in unix_socket_client

2014-09-29 Thread Tyler Hicks
On 2014-09-25 03:19:08, Steve Beattie wrote: > On Mon, Sep 22, 2014 at 07:09:14PM -0500, Tyler Hicks wrote: > > The client will now do a getsockname() on its socket in order to test > > the AppArmor 'getattr' unix rule permission. > > > > Signed-off-by: Tyle

[apparmor] [PATCH] tests: getopt is not required for bound AF_UNIX pathname sockets

2014-09-30 Thread Tyler Hicks
filesystem path. The getopt permission is one of those socket operations. To account for this lack of mediation, the getopt permission should be removed from the server permissions list. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/unix_socket_pathname.sh | 2 +- 1 file changed, 1

Re: [apparmor] [patch] C tools: rename __unused macro

2014-09-30 Thread Tyler Hicks
On 2014-09-30 11:36:55, John Johansen wrote: > On 09/30/2014 10:28 AM, Steve Beattie wrote: > > On Wed, Sep 24, 2014 at 04:00:12PM -0700, Seth Arnold wrote: > >> On Wed, Sep 24, 2014 at 03:45:46PM -0700, Steve Beattie wrote: > >>> Not at all. Honestly, my preferences are: > >>> > >>> 1) __unused —

Re: [apparmor] [patch] C tools: rename __unused macro

2014-10-02 Thread Tyler Hicks
On 2014-10-02 05:07:40, Steve Beattie wrote: > On Wed, Oct 01, 2014 at 09:59:43AM -0700, Steve Beattie wrote: > > On Tue, Sep 30, 2014 at 11:36:55AM -0700, John Johansen wrote: > > > What do people think about using just the bare word? > > > unused > > > > I'm fine with either the bare word or C

Re: [apparmor] [patch] AppArmor.pm: add basic support for signal, unix, ptrace and dbus rules

2014-10-08 Thread Tyler Hicks
On 2014-10-07 20:19:15, Christian Boltz wrote: > Hello, > > YaST still uses AppArmor.pm, and now errors out when starting the > profile editor because it doesn't know about signal, unix, ptrace and > dbus rules. > > This patch adds basic support for those rules to AppArmor.pm by adding > them

Re: [apparmor] [patch] tests: mark failing dgram tests in unix_socket_unnamed.sh as xpass

2014-10-09 Thread Tyler Hicks
is given as only > the confining profile (the stream and seqpacket dgram tests/permissions > don't seem to trigger this revalidation rejection). > > Until this bug is diagnosed and addressed, mark these tests as failing > but expected to pass (i.e. 'xpass'). > >

Re: [apparmor] [patch] tests: warn about xpass/xfail marked tests

2014-10-09 Thread Tyler Hicks
sible reminder is probably for the best. > > [0] The test infrastructure does give an alert if there is a test that > has been marked xpass or xfail but has started behaving correctly. > > Signed-off-by: Steve Beattie This seems like a good idea to me. Acked-by: Tyler

Re: [apparmor] [patch][2.9] Document the ability to load profiles from a directory

2014-10-20 Thread Tyler Hicks
On 2014-10-20 12:25:42, John Johansen wrote: > Document the ability for apparmor_parser to load profiles from a dir > > Update the apparmor_parser documentation for the new ability to load > profiles from a specified directory. > > Signed-off-by: John Johansen Acked-by: T

[apparmor] [PATCH] apparmor: Fix build error when CRYPTO_SHA1=m

2014-10-23 Thread Tyler Hicks
error because LSMs must be built-in and SECURITY_APPARMOR and SECURITY_APPARMOR_HASH are both bools. Selecting CRYPTO solves the problem by enforcing that the crypto subsystem and the SHA-1 code are built-in when CONFIG_SECURITY_APPARMOR_HASH is selected. Signed-off-by: Tyler Hicks --- security

Re: [apparmor] [PATCH] apparmor: Fix build error when CRYPTO_SHA1=m

2014-10-23 Thread Tyler Hicks
On 2014-10-23 11:50:28, Seth Arnold wrote: > On Thu, Oct 23, 2014 at 11:21:22AM -0400, Tyler Hicks wrote: > > The AppArmor profile hashing feature, configured by > > CONFIG_SECURITY_APPARMOR_HASH, uses SHA-1 as the hashing algorithm and > > selects CRYPTO_SHA1. However, b

Re: [apparmor] [patch] apparmor: add parameter to control whether policy hashing is used

2014-10-23 Thread Tyler Hicks
; Signed-off-by: John Johansen Looks good! Acked-by: Tyler Hicks Tyler > --- > security/apparmor/include/apparmor.h | 1 + > security/apparmor/lsm.c | 4 > security/apparmor/policy_unpack.c| 5 +++-- > 3 files changed, 8 insertions(+), 2 deletions(-) > &

Re: [apparmor] [patch] apparmor: add parameter to control whether policy hashing is used

2014-10-23 Thread Tyler Hicks
On 2014-10-23 12:35:29, John Johansen wrote: > From e81978b2341136b8abdd3669f011c053309a5129 Mon Sep 17 00:00:00 2001 > From: John Johansen > Date: Thu, 23 Oct 2014 12:33:08 -0400 > Subject: [PATCH] apparmor: add parameter to control whether policy hashing is > used > > v2. Add kconfig option to

[apparmor] [PATCH] tests: Add ptrace tests for LP: #1390592

2014-11-12 Thread Tyler Hicks
. Signed-off-by: Tyler Hicks --- tests/regression/apparmor/ptrace_v6.inc | 9 + 1 file changed, 9 insertions(+) diff --git a/tests/regression/apparmor/ptrace_v6.inc b/tests/regression/apparmor/ptrace_v6.inc index d691b4e..3778155 100644 --- a/tests/regression/apparmor/ptrace_v6.inc

Re: [apparmor] [patch] update dependencies for utils coverage

2014-11-13 Thread Tyler Hicks
On 2014-11-07 17:52:19, Christian Boltz wrote: > Hello, > > now that the severity tests are part of make coverage, we should extend > the dependencies to the files needed by test-severity.py. > > Another (easier) option would be to use > .coverage: $(wildcard ../aa-* ../apparmor/*.py *) > >

[apparmor] [PATCH 2/6] libapparmor: Don't print perl version in the configure script output

2014-11-17 Thread Tyler Hicks
There's no need to date ourselves. Signed-off-by: Tyler Hicks --- libraries/libapparmor/m4/ac_pod2man.m4 | 5 - 1 file changed, 5 deletions(-) diff --git a/libraries/libapparmor/m4/ac_pod2man.m4 b/libraries/libapparmor/m4/ac_pod2man.m4 index 45ab82c..98eea70 100644 --- a/libr

[apparmor] [PATCH 6/6] Update the top-level README for the utils rewrite

2014-11-17 Thread Tyler Hicks
Modify the build instructions and project requirements to reflect the utils rewrite from Perl to Python. Signed-off-by: Tyler Hicks --- README | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/README b/README index 83dec86..b8e1303 100644 --- a/README +++ b

[apparmor] [PATCH 0/6] Minor doc and build updates after utils rewrite

2014-11-17 Thread Tyler Hicks
The rewrite of the utils from Perl to Python allows us to update the libapparmor build system and the README to not require the libapparmor Perl wrapper. This patch set updates the libapparmor autoconf tooling to not require --with-perl to build the man pages. This means that Perl is still require

[apparmor] [PATCH 1/6] libapparmor: Always generate the man pages

2014-11-17 Thread Tyler Hicks
The configure script fails if pod2man isn't available since PROG_POD2MAN is called unconditionally so it is safe to split man page generation out of the --with-perl configure option. Signed-off-by: Tyler Hicks --- libraries/libapparmor/doc/Makefile.am | 5 - 1 file changed, 5 dele

[apparmor] [PATCH 5/6] libapparmor: Fix spacing in the configure script usage

2014-11-17 Thread Tyler Hicks
Signed-off-by: Tyler Hicks --- libraries/libapparmor/configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/libapparmor/configure.ac b/libraries/libapparmor/configure.ac index 1a317ce..27c0c55 100644 --- a/libraries/libapparmor/configure.ac +++ b

[apparmor] [PATCH 3/6] libapparmor: Point to the correct site for downloading Perl

2014-11-17 Thread Tyler Hicks
Point to the site for Perl the language and not Perl news. Signed-off-by: Tyler Hicks --- libraries/libapparmor/m4/ac_pod2man.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libapparmor/m4/ac_pod2man.m4 b/libraries/libapparmor/m4/ac_pod2man.m4 index 98eea70

[apparmor] [PATCH 4/6] libapparmor: Check for podchecker during configure stage

2014-11-17 Thread Tyler Hicks
Fail the configure stage if podchecker is not available since man page generation always happens. Signed-off-by: Tyler Hicks --- libraries/libapparmor/configure.ac| 3 +++ libraries/libapparmor/m4/ac_podchecker.m4 | 11 +++ 2 files changed, 14 insertions(+) create mode 100644

Re: [apparmor] [PATCH 4/6] libapparmor: Check for podchecker during configure stage

2014-11-17 Thread Tyler Hicks
On 2014-11-17 14:33:38, Steve Beattie wrote: > On Mon, Nov 17, 2014 at 03:05:19PM -0600, Tyler Hicks wrote: > > Fail the configure stage if podchecker is not available since man page > > generation always happens. > > I think I disagree with this patch and the first patch.

[apparmor] [PATCH 7/6] libapparmor: Make man page generation optional

2014-11-17 Thread Tyler Hicks
This patch adds the --enable-man-pages option, defaulting to "yes", to libapparmor's configure stage so that libapparmor can be built on systems lacking Perl. Signed-off-by: Tyler Hicks --- libraries/libapparmor/configure.ac| 19 ++- libraries/libapparmor/

Re: [apparmor] [PATCH 6/6] Update the top-level README for the utils rewrite

2014-11-17 Thread Tyler Hicks
On 2014-11-18 00:56:31, Christian Boltz wrote: > Hello, > > Am Montag, 17. November 2014 schrieb Tyler Hicks: > > Modify the build instructions and project requirements to reflect the > > utils rewrite from Perl to Python. > > > --- a/README > > +++ b/README &

[apparmor] [PATCH 6/6 v2] Update the top-level README for the utils rewrite

2014-11-17 Thread Tyler Hicks
Modify the build instructions and project requirements to reflect the utils rewrite from Perl to Python. Signed-off-by: Tyler Hicks --- * Changes since v1: - Recommend --with-perl since some tools still use the Perl libapparmor wrapper - Leave a mention of Perl in 'Required ve

[apparmor] [PATCH 04/31] split the policy cache handling fns into their own file

2014-12-05 Thread Tyler Hicks
From: John Johansen Signed-off-by: John Johansen [tyhicks: Don't move globals in favor of lifting those out later] Signed-off-by: Tyler Hicks --- parser/Makefile | 14 +++-- parser/parser.h | 16 +- parser/parser_lex.l | 1 + parser/parser_main.c

[apparmor] [PATCH 01/31] change cache check so that debugging can see which file caused failure

2014-12-05 Thread Tyler Hicks
option, and that the cache file timestamp is set first so that we can output a deug message for each file that causes a cache check failure. Signed-off-by: John Johansen [tyhicks: Forward ported to trunk and minor cleanups] Signed-off-by: Tyler Hicks --- parser/parser.h | 2 +- parser

[apparmor] [PATCH 12/31] parser: Get rid of the cacheloc global

2014-12-05 Thread Tyler Hicks
directory will soon be two different paths. The cache location will typically be the parent of the cache directory. Signed-off-by: Tyler Hicks --- parser/parser_main.c | 37 + parser/policy_cache.c | 30 ++ parser/policy_cache.h | 5

[apparmor] [PATCH 05/31] Use the gcc cleanup extension attribute to handle freeing temp allocations

2014-12-05 Thread Tyler Hicks
From: John Johansen While some of these allocations will go away as we convert to C++, some of these need to stay C as the are going to be moved into a library to support loading cache from init daemons etc. For the bits that will eventually be C++ this helps clean things up, in the interim. TO

[apparmor] [PATCH 06/31] Use the gcc cleanup extension attribute to handle closing temp files

2014-12-05 Thread Tyler Hicks
From: John Johansen While some of these allocations will go away as we convert to C++, some of these need to stay C as the are going to be moved into a library to support loading cache from init daemons etc. For the bits that will eventually be C++ this helps clean things up, in the interim. TO

[apparmor] [PATCH 02/31] fix cache write to not happen when skip-bad-cache is specified

2014-12-05 Thread Tyler Hicks
From: John Johansen Signed-off-by: John Johansen --- parser/parser_main.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/parser/parser_main.c b/parser/parser_main.c index 58456e4..091eaa5 100644 --- a/parser/parser_main.c +++ b/parser/parser_main.c @@ -964,8 +964

[apparmor] [PATCH 16/31] parser: Move match file handling to separate file

2014-12-05 Thread Tyler Hicks
In addition, define MATCH_STRING_SIZE macro instead of using a magic number. Signed-off-by: Tyler Hicks --- parser/Makefile | 10 +++--- parser/features.c| 19 --- parser/features.h| 1 - parser/match.c | 46

[apparmor] [PATCH 13/31] parser: Don't use the basedir global in setup_cache()

2014-12-05 Thread Tyler Hicks
path. The return value is changed to an int so an error code can be returned instead of using exit(). Signed-off-by: Tyler Hicks --- parser/parser_main.c | 17 + parser/policy_cache.c | 30 +++--- parser/policy_cache.h | 2 +- 3 files changed, 25 inserti

[apparmor] [PATCH 18/31] parser: Begin to flesh out library interface for features

2014-12-05 Thread Tyler Hicks
apparmorfs. A temporary convenience function, aa_features_get_string(), is provided while code that uses aa_features is migrated from expecting raw features string access to something more abstract. The function will be removed in an upcoming patch. Signed-off-by: Tyler Hicks --- parser/features.c

[apparmor] [PATCH 08/31] split routines for loading binary policy into its own file

2014-12-05 Thread Tyler Hicks
functions static] Signed-off-by: Tyler Hicks --- parser/Makefile | 12 ++- parser/kernel_interface.c | 206 ++ parser/kernel_interface.h | 25 ++ parser/lib.c | 2 +- parser/lib.h | 2 +- parser

[apparmor] [PATCH 0/31] Prepare to move cache loading functionality to libapparmor

2014-12-05 Thread Tyler Hicks
This patch set is the precursor to moving the cache loading code into libapparmor. It sets up a clean, supportable interface for external programs to interact with match files, feature files, the policy cache, and the kernel interface (apparmorfs). It doesn't provide an API for individual binary ca

[apparmor] [PATCH 07/31] With the auto cleanup changes we can now directly return the value if we have a cache hit.

2014-12-05 Thread Tyler Hicks
From: John Johansen Signed-off-by: John Johansen [tyhicks: Forward ported patch to trunk] Signed-off-by: Tyler Hicks --- parser/parser_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/parser_main.c b/parser/parser_main.c index c7f8f33..7ef74e7 100644 --- a

[apparmor] [PATCH 15/31] parser: Add support for atomic inc and dec

2014-12-05 Thread Tyler Hicks
These operations will be used for grabbing and releasing references to objects. They leverage the GCC builtins for atomic operations. Signed-off-by: Tyler Hicks --- parser/lib.c | 10 ++ parser/lib.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/parser/lib.c b/parser/lib.c

[apparmor] [PATCH 14/31] parser: Lift force_clear_cache handling from setup_cache()

2014-12-05 Thread Tyler Hicks
This keeps us from having to use the force_clear_cache global in policy_cache.c. Signed-off-by: Tyler Hicks --- parser/parser_main.c | 10 ++ parser/policy_cache.c | 3 --- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/parser/parser_main.c b/parser/parser_main.c

[apparmor] [PATCH 11/31] parser: Move policy cache initialization code into its own function

2014-12-05 Thread Tyler Hicks
This patch moves the logic that sets up the policy into a new function in policy_cache.c Signed-off-by: Tyler Hicks --- parser/Makefile | 2 +- parser/parser_main.c | 48 ++-- parser/policy_cache.c | 49

[apparmor] [PATCH 03/31] Move feature handling code into its own file

2014-12-05 Thread Tyler Hicks
From: John Johansen Signed-off-by: John Johansen [tyhicks: Forward ported patch to trunk] [tyhicks: Don't move set_supported_features()] Signed-off-by: Tyler Hicks --- parser/Makefile | 8 ++- parser/features.c| 196 +++ p

[apparmor] [PATCH 17/31] parser: Make match file interface suitable for a library

2014-12-05 Thread Tyler Hicks
e ref count hits zero, all allocated memory is freed. Like with free(), aa_match_unref() can be called with a NULL pointer for convenience. A set of aa_match_supports_*() functions are added for checking the features represented by a match file. Signed-off-by: Tyler Hicks --- parser/match.c

[apparmor] [PATCH 19/31] parser: Get rid of snprintf_buffer()

2014-12-05 Thread Tyler Hicks
o snprintf(). Signed-off-by: Tyler Hicks --- parser/features.c | 45 +++-- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/parser/features.c b/parser/features.c index 1464ac5..5f43c44 100644 --- a/parser/features.c +++ b/parser/features.c @@ -4

[apparmor] [PATCH 10/31] parser: Move policy cache functionality into policy_cache.c

2014-12-05 Thread Tyler Hicks
From: John Johansen Signed-off-by: John Johansen [tyhicks: Fixed build failures] [tyhicks: Fixed bug where a warning was being printed when it shouldn't] [tyhicks: Forward ported to trunk] Signed-off-by: Tyler Hicks --- parser/parser.h | 6 ++-- parser/parser_interface.c

[apparmor] [PATCH 28/31] parser: Use aa_kernel_interface API in parser_interface.c

2014-12-05 Thread Tyler Hicks
__sd_serialize_profile() had a duplicated implementation for writing to apparmorfs interface files after a profile compilation. This patch migrates it to the new aa_kernel_interface API. Signed-off-by: Tyler Hicks --- parser/parser_interface.c | 56

[apparmor] [PATCH 24/31] parser: Deprecate the --create-cache-dir option

2014-12-05 Thread Tyler Hicks
This option adds unneeded complexity to the parser CLI and the upcoming aa_policy_cache API. Get rid of it and simply create the cache dir if --write-cache is specified. Signed-off-by: Tyler Hicks --- parser/parser_main.c | 6 -- parser/policy_cache.c | 2 +- 2 files changed, 5 insertions

[apparmor] [PATCH 09/31] Add fns to handle profile removal to the kernel interface

2014-12-05 Thread Tyler Hicks
From: John Johansen Signed-off-by: John Johansen [tyhicks: Forward ported patch to trunk] [tyhicks: remove commented out code] Signed-off-by: Tyler Hicks --- parser/kernel_interface.c | 23 +++ parser/kernel_interface.h | 1 + parser/parser_interface.c | 46

[apparmor] [PATCH 30/31] parser: Add aa_policy_cache function to replace all policies

2014-12-05 Thread Tyler Hicks
This may be useful for something like an init daemon that simply wants to load all cached binaries without worrying about any sort of policy compilation. Signed-off-by: Tyler Hicks --- parser/policy_cache.c | 61 +++ parser/policy_cache.h | 3

[apparmor] [PATCH 31/31] libapparmor: Create a private API

2014-12-05 Thread Tyler Hicks
isted() is moved into libapparmor. The purpose of a private libapparmor API is to prevent duplicated code between the parser and libapparmor. This becomes an issue as we prepare to move chunks of the parser into libapparmor. Signed-off-by: Tyler Hicks --- libraries/libapparmor/include/sys/M

[apparmor] [PATCH 20/31] parser: Remove prints and exits from features code

2014-12-05 Thread Tyler Hicks
This is done in preparation for moving the features code to a library. Signed-off-by: Tyler Hicks --- parser/features.c | 33 +++-- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/parser/features.c b/parser/features.c index 5f43c44..f3bdcd0 100644

[apparmor] [PATCH 26/31] parser: Add policy cache function for cache removal

2014-12-05 Thread Tyler Hicks
This function allows for a policy cache to be removed without having a previously instatiated aa_policy_cache object. It simply works off of a path. Signed-off-by: Tyler Hicks --- parser/parser_main.c | 2 +- parser/policy_cache.c | 18 -- parser/policy_cache.h | 2 +- 3

[apparmor] [PATCH 29/31] parser: Finalize the aa_kernel_interface API

2014-12-05 Thread Tyler Hicks
o be discovered once instead of during every policy load. Signed-off-by: Tyler Hicks --- parser/kernel_interface.c | 183 +++--- parser/kernel_interface.h | 32 ++-- parser/parser.h | 12 ++- parser/parser_common.c| 1 - parser/pars

[apparmor] [PATCH 22/31] parser: Add functions for features parsing and support tests

2014-12-05 Thread Tyler Hicks
Defines a set of functions that can be called to test features support. The use of global variables in the parser to store and check features support is still preserved. The parser should probably move over to passing the aa_features object around but that's left for later. Signed-off-by:

[apparmor] [PATCH 25/31] parser: Create initial interface for policy cache

2014-12-05 Thread Tyler Hicks
s file doesn't match the kernel features file), then a new aa_policy_cache object is still created but a call to aa_policy_cache_is_valid() will return false. The caller can then decide what to do (create a new valid cache, stop, etc.) Signed-off-by: Tyler Hicks --- parser/parser_main.c |

  1   2   3   4   5   6   7   8   9   10   >