Commit graph

4120 commits

Author SHA1 Message Date
Christian Boltz
2fdc5ca603 Merge branch 'fix-nvidia-dir' into 'master'
Allow to create .nv directory

See merge request apparmor/apparmor!69

Acked-by: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..master

(cherry picked from commit 21b0d14ea4)

11e7dab9 Allow to create .nv directory
2018-02-17 15:58:58 +00:00
Christian Boltz
872d3f3bc2 Merge branch 'update-base-abstraction' into 'master'
Update base abstraction for ld.so.conf and friends.

See merge request apparmor/apparmor!62

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..master

(cherry picked from commit e88af93322)

6d22c871 Update base abstraction for ld.so.conf and friends.
2018-02-15 20:15:09 +00:00
intrigeri
54725ee516 apparmor(7): clarify the effect of reloading a profile.
LP: #1608075

Partly fixes: https://bugs.debian.org/826218

(cherry picked from commit 967d394ef4)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-31 11:00:14 +01:00
Christian Boltz
4a76852648 tools: Mark profiles with multiple rules in one line as known-failing
The tools don't support having multiple rules in one line (they expect
\n after each rule), therefore mark some of the bare_include_tests as
known failures.

(cherry picked from commit 26af640fda)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-24 00:19:18 -08:00
Christian Boltz
c78752911e Merge branch 'cboltz-ntpd' into 'master'
allow access to ntp clockstats

See merge request apparmor/apparmor!54

(cherry picked from commit 85f8cace12)

1b58f226 allow access to ntp clockstats
2018-01-23 23:02:54 +00:00
Christian Boltz
7f074b6677 Merge branch 'master' into 'master'
abstractions/gnupg: allow pubring.kbx

See merge request apparmor/apparmor!58

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..trunk

(cherry picked from commit e1929298ac)

8fc3dcb3 abstractions/gnupg: allow pubring.kbx
2018-01-20 22:59:55 +00:00
John Johansen
1fe48e09dd regression tests: fix regression tests to pass on 4.14 upstream kernel
Some of the regression tests are missing conditionals or have the
wrong conditionals so that they fail on current upstream kernels.

Fix this by adding and changing conditionals and requires where
appropriate. With the patches the tests report passing on 4.14 and
4.15 kernels.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Time out
(cherry picked from commit 6f1d054468)
2018-01-20 01:47:02 -08:00
John Johansen
fa1d2a1fc1 parser: add support for conditional includes
This is a minimal patch to add conditional includes to the profile
language.

The syntax for conditional includes is similar to regular includes
except with the addition of "if exists" after "include"

  include if exists <foo/bar>
  include if exists "foo/bar"
  include if exists "/foo/bar"
  include if exists foo/bar

Note: The patch is designed to be backportable with minimum
effort. Cleanups and code refactoring are planned for follow up
patches that won't be back ported.

Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 2ea3309942)
2018-01-20 00:46:50 -08:00
John Johansen
5e6948d2f9 parser tests: fix includes to allow white space
includes were not handling WS in path names correctly. Allow WS within
quotes. Eg
  include "foo bar"
  include <"foo bar">

BugLink: http://bugs.launchpad.net/bugs/1738880
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 8d142809f5)
2018-01-20 00:46:37 -08:00
John Johansen
4184b0c363 parser tests: add tests for relative path includes
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit efd8eedd52)
2018-01-20 00:46:20 -08:00
Thorsten Kukuk
d97a8034fc disable write cache if filesystem is read-only
... and don't bail out

Patch by Thorsten Kukuk <kukuk@suse.com>

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1069906
            https://bugzilla.opensuse.org/show_bug.cgi?id=1074429

(cherry picked from commit 924983e702)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-16 11:34:59 -08:00
John Johansen
41f29cbe1c parser: fix parser so that cache creation failure doesn't cause load failure
This is a minimal patch so that it can be backported to 2.11 and 2.10
which reverts the abort on error failure when the cache can not be
created and write-cache is set.

This is meant as a temporary fix for
https://bugzilla.suse.com/show_bug.cgi?id=1069906
https://bugzilla.opensuse.org/show_bug.cgi?id=1074429

where the cache location is being mounted readonly and the cache
creation failure is causing policy to not be loaded. And the
thrown parser error to cause issues for openQA.

Note: A cache failure warning will be reported after the policy load.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz apparmor@cboltz.de
(cherry picked from commit 42b68b65fe1861609ffe31e05be02a007d11ca1c)
2018-01-05 01:26:48 -08:00
John Johansen
1a3c0cd277 aa-decode: add the ability to support PROCTITLE string
buglink: https://bugs.launchpad.net/apparmor/+bug/1736841

Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 3afbfed9ee)
2017-12-24 00:26:17 -08:00
John Johansen
6cb59226bf profile: fix syslog-ng startup for some configurations
buglink: https://bugs.launchpad.net/bugs/1739909

Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit e55583ff27)
2017-12-24 00:26:01 -08:00
John Johansen
2997b7d912 Merge branch 'cboltz-netstat' into 'master'
netstat: allow capability sys_ptrace,

See merge request apparmor/apparmor!46

(cherry picked from commit a3693f56f3)

81ca52d9 netstat: allow capability sys_ptrace,
2017-12-22 21:07:59 +00:00
John Johansen
6ffe9f5fda Merge branch 'cboltz-xauth' into 'master'
abstractions/X: add another location for .Xauthority

See merge request apparmor/apparmor!39

Acked-by: John Johansen <john.johansen@canonical.com>


(cherry picked from commit bcfb735b9a)

bb96e38a abstractions/X: add another location for .Xauthority
2017-12-22 20:21:29 +00:00
John Johansen
8518a39a4b Merge branch 'cboltz-dovecot' into 'master'
Update /usr/lib/dovecot/* profiles

See merge request apparmor/apparmor!42

Acked-by: John Johansen <john.johansen@canonical.com>


(cherry picked from commit f8b208ee80)

06928db1 Update /usr/lib/dovecot/* profiles
2017-12-22 20:20:29 +00:00
Christian Boltz
14ce11f608 Merge branch 'fix-pulse-config' into 'master'
Fix local pulseaudio config file access

See merge request apparmor/apparmor!38


Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..trunk

(cherry picked from commit 6713f9d94a)

f73627cb Fix local pulseaudio config file access
2017-12-17 16:20:05 +00:00
Christian Boltz
2b7313cdd2 Merge branch 'dovecot-signals' into 'master'
Fix signal sending for usr.sbin.dovecot

See merge request apparmor/apparmor!36

Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..trunk

(cherry picked from commit 6db30f8faf)

9f24650e Fix signal sending for usr.sbin.dovecot
2017-12-16 17:26:54 +00:00
John Johansen
0ecc171de9 Merge branch 'cboltz-inherit-mr' into 'master'
handle_children(): automatically add m permissions on ix rules

See merge request apparmor/apparmor!22

Acked-by: John Johansen <john.johansen@canonical.com>


(cherry picked from commit b2df42f55b)

7a49f37c handle_children(): automatically add m permissions on ix rules
2017-12-12 22:53:27 +00:00
John Johansen
d4218f6ca4 Merge branch 'cboltz-file-w-covered-by-a' into 'master'
FileRule: detect that 'a' is covered by 'w'

See merge request apparmor/apparmor!23

Acked-by: John Johansen <john.johansen@canonical.com>


(cherry picked from commit 6483c627d2)

1857f07d test-file.py: Document that w doesn't cover a yet
a0d4e246 FileRule: detect that 'a' is covered by 'w'
2017-12-12 22:52:10 +00:00
Tyler Hicks
d7bbfeee53 Merge branch 'cherry-pick-debc4e3f' into 'apparmor-2.11'
See merge request apparmor/apparmor!28

Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-12-05 18:45:30 +00:00
Tyler Hicks
e9287e066b Merge branch 'exit-from-Makefile-shell-snippets' into 'master'
binutils, parser, utils: Exit from Makefile shell snippets

See merge request apparmor/apparmor!27

Acked-by: Christian Boltz <apparmor@cboltz.de>

(cherry picked from commit debc4e3ffe)

2c04f44a binutils, parser, utils: Exit from Makefile shell snippets
2017-12-05 17:47:29 +00:00
Tyler Hicks
1872c52c6d Merge branch 'utils-check-depends-on-parser-2.11' into 'apparmor-2.11'
Utils check depends on parser

See merge request apparmor/apparmor!26

Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-12-05 17:40:14 +00:00
Tyler Hicks
da42248a95 README: Document that the parser should be built before the utils
The utils have tests that rely on the in-tree parser to be built so it
should be documented that the parser should be built first.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2017-12-04 23:12:14 +00:00
Tyler Hicks
fca085a352 utils: Gracefully handle a missing parser in the check target
The test-aa-easyprof.py script relies on the parser to be built so the
check target of the utils/test/Makefile should detect if the parser
exists before running any tests.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Christian Boltz <apparmor@cboltz.de>
2017-12-04 23:12:14 +00:00
Christian Boltz
2d0ab611b2 Merge branch 'cherry-pick-794d1c4a' into 'apparmor-2.11'
Merge branch 'cboltz-double-read-inactive' into 'master'

See merge request apparmor/apparmor!19

Acked-by: Seth Arnold seth.arnold@canonical.com for trunk, 2.11 and 2.10
2017-12-01 22:24:32 +00:00
Steve Beattie
8316d34b2b dovecot: allow capability dac_read_search
Merge branch 'cboltz-dovecot-caps' into 'master'

See merge request 
https://gitlab.com/apparmor/apparmor/merge_requests/16

(cherry picked from commit ca983811fb)

4ef505a6 dovecot: allow capability dac_read_search
2017-12-01 21:20:33 +00:00
Christian Boltz
bfbda33038 Merge branch 'cboltz-remove-unknown-newline' into 'master'
Don't print a literal '\n' in aa-remove-unknown help

See merge request apparmor/apparmor!21

Acked-by: Tyler Hicks tyhicks@canonical.com for 2.9..trunk

(cherry picked from commit 3d40bc6f23)

4d4228d1 Don't print a literal '\n' in aa-remove-unknown help
2017-12-01 10:09:58 +00:00
Christian Boltz
b4310a9366 Merge branch 'cboltz-double-read-inactive' into 'master'
Let read_inactive_profiles() do nothing when calling it the second time

See merge request apparmor/apparmor!17

(cherry picked from commit 794d1c4a07)

b307e535 Let read_inactive_profiles() do nothing when calling it the second time
2017-11-28 21:56:38 +00:00
Christian Boltz
67be2e9e9b Merge branch 'cboltz-dovecot-auth' into 'master'
allow dac_read_search and dac_override for dovecot/auth

See merge request apparmor/apparmor!14


Acked-by: Seth Arnold <seth.arnold@canonical.com> for 2.9, 2.10, 2.11 and trunk

(cherry picked from commit 42bd81df01)

6f6b3c57 allow dac_read_search and dac_override for dovecot/auth
2017-11-27 21:38:14 +00:00
Christian Boltz
d1da150d97 Merge branch 'patch-1' into 'master'
Allow to read pulseaudio config subdirectories

See merge request apparmor/apparmor!12


Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9, 2.10, 2.11 and trunk

(cherry picked from commit 4b8b08562a)

9658471d Allow to read pulseaudio config subdirectories
2017-11-18 17:25:56 +00:00
Christian Boltz
16c83927c0 Merge branch 'utils_save_profiles_2.11' into 'apparmor-2.11'
utils: fix and improve "save profiles"

See merge request apparmor/apparmor!11
2017-11-14 20:28:03 +00:00
Christian Boltz
535b3074ab
Remember selected profile in save_profiles()
After using "view changes", the selection got reset to the first changed
profile. This could mislead the user into saving the wrong profile.

This patch ensures the selection is kept.

Cherry-picked from master 051be5dec0
(+ whitespace adjustments)

Acked-by: Tyler Hicks <tyhicks@canonical.com> for master and 2.11
2017-11-14 21:19:25 +01:00
Christian Boltz
50b7db4e3d
Fix sorted() regression in save_profiles()
The last change in save_profiles() sorted() the order in which the
changed profiles get displayed. However, it did not honor the sorting
when displaying changes or saving the selected profile, leading to the
wrong profile displayed or saved.

This patch fixes picking the selected profile, and at the same time
replaces the duplicated code for doing this with a single instance.

Note that the 2.11 branch needs a slightly different patch (different
indentation).

Also note that this regression made it into 2.11.1, so distributions
shipping 2.11.1 should add this patch.

Cherry-picked from master fe1fb7caa3
(+ whitespace adjusted)

Acked-by: Tyler Hicks <tyhicks@canonical.com> for master and 2.11
2017-11-14 21:19:17 +01:00
Steve Beattie
f993585e77
git conversion: move .bzrignore to .gitignore
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2017-10-27 22:46:03 -07:00
Simon Deziel
728f02bf3c profiles: update wireshark profile for modern releases
MErge from trunk commit 3728

Acked-by: Steve Beattie <steve@nxnw.org>
2017-10-26 17:02:24 -07:00
intrigeri
831c93294f profiles: allow OpenAL HRTF support in audio abstraction
Merge from trunk commit 3726

The files are "head-related transfer function" data sets, used by
OpenAL for better spatialization of sounds when headphones are detected.

Acked-by: Steve Beattie <steve@nxnw.org>

Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874665
2017-10-26 10:24:07 -07:00
intrigeri
89f3fb70a2 binutils: honor ${CFLAGS} and ${CPPFLAGS}
Merge from trunk revision 3723.

Acked-by: Steve Beattie <steve@nxnw.org>
2017-10-26 00:50:00 -07:00
Vincas Dargis
a29704b445 profiles: tunables/global - accept seven digit pids
[Merge from trunk revision 3722]

On 64bit systems, /proc/sys/kernel/pid_max can be set to PID_MAX_LIMIT,
(2^22), which results in seven digit pids. Adjust the @{PID} variable in
tunables/global to accept this.

Acked-by: intrigeri <intrigeri@boum.org>
Acked-by: Steve Beattie <steve@nxnw.org>

Bug: https://bugs.launchpad.net/apparmor/+bug/1717714
2017-10-25 23:22:36 -07:00
Christian Boltz
90e086986d Add python3.6 line to utils/logprof.conf
This is a backport of trunk r3718 by intrigeri


Acked-by: John Johansen <john.johansen@canonical.com> for 2.11 and 2.10 (on IRC)
2017-10-23 20:05:39 +02:00
Christian Boltz
0eedfe8319 Allow reading /etc/netconfig in abstractions/nameservice
/etc/netconfig is required by the tirpc library which nscd and several
other programs use.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1062244


Acked-by: Seth Arnold <seth.arnold@canonical.com> for 2.9, 2.10, 2.11 and trunk
2017-10-20 22:54:21 +02:00
John Johansen
8b81fe065f bump release version to 2.11.1 2017-10-19 02:13:37 -07:00
Steve Beattie
a8f5b8f0db libapparmor: fix swig test_apparmor.py for zero length ptrace records
Merge from trunk revision 3715

The added testcase for a ptrace target with an empty string
(ptrace_garbage_lp1689667_1.in) was causing the swig python test script
to fail. The generated python swig record for libapparmor ends up
setting a number of fields to None or other values that indicate the
value is unset, and the test script was checking if the value in the
field didn't evaluate to False in a python 'if' test.

Unfortunately, python evaluates the empty string '' as False in 'if'
tests, resulting in the specific field that contained the empty string
to be dropped from the returned record. This commit fixes that by
special case checking for the empty string.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2017-10-18 17:06:28 -07:00
John Johansen
878ebd4b33 Fix af_unix downgrade of network rules
with unix rules we output a downgraded rule compatible with network rules
so that policy will work on kernels that support network socket controls
but not the extended af_unix rules

however this is currently broken if the socket type is left unspecified
(initialized to -1), resulting in denials for kernels that don't support
the extended af_unix rules.

cherry-pick: lp:apparmor r3700
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: timeout
2017-10-18 14:31:16 -07:00
Christian Boltz
bc5634f2af Fix save_profiles() for YaST
YaST has two issues in the "save changed profiles" dialog:
- when using "save selected", the list of profiles doesn't get updated.
  Update q.options inside the loop to fix this.
- the list of profiles is displayed as "["/usr/bin/foo", true]" instead
  of just "/usr/bin/foo". Use changed.keys() instead of changed to fix
  this. (text-mode aa-logprof doesn't change, it always displayed
  "/usr/bin/foo" and continues to do so.)

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1062667 part a)


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk and 2.11.

Note that 2.11 needs a slightly different patch (whitespace diff).
2017-10-12 13:28:51 +02:00
Christian Boltz
7c217b7413 Allow /var/run/dovecot/login-master-notify* in dovecot imap-login profiles
Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.11, 2.10 and 2.9.
2017-09-28 17:48:13 +02:00
Christian Boltz
86037e0a23 abstractions/freedesktop.org: support /usr/local/applications; support subdirs of applications folder
Merge request by Cameron Norman 2015-06-07
https://code.launchpad.net/~cameronnemo/apparmor/abstraction-fdo-applications-fixups/+merge/261336

Acked-by: Christian Boltz <apparmor@cboltz.de> for trunk, 2.11, 2.10 and 2.9
2017-09-10 12:28:30 +02:00
Christian Boltz
1f82a98029 Add network 'smc' keyword in NetworkRule and apparmor.d manpage
'smc' seems to be new in kernel 4.12.


Note that the 2.10 apparmor.d manpage also misses the 'kcm' keyword, so
the patch also adds it there.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.11 and 2.10.
2017-08-30 11:06:56 +02:00
Christian Boltz
7adbc4b3ee Samba profile updates for ActiveDirectory / Kerberos
The Samba package used by the INVIS server (based on openSUSE) needs
some additional Samba permissions for the added ActiveDirectory /
Kerberos support.

As discussed with Seth, add /var/lib/sss/mc/initgroups read permissions
to abstractions/nameservice instead of only to the smbd profile because
it's probably needed by more than just Samba if someone uses sss.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for 2.9, 2.10, 2.11 and trunk.
2017-08-29 13:32:03 +02:00