mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
![]() v3: fix freeing of filename when undefined v2: address tyhicks feedback refactor to have a common write routine fix issue with set profile load being done even if !kernel_load Profile loads from cache files that contain multiple profiles can result in multiple reloads of the same profile or error messages about failure to load profiles if the --add option is used. eg. apparmor="STATUS" operation="profile_load" name="/usr/lib/apache2/mpm-prefork/apache2" pid=8631 comm="apparmor_parser" <sth0R> [82932.058388] type=1400 audit(1395415826.937:616): apparmor="STATUS" operation="profile_load" name="DEFAULT_URI" pid=8631 comm="apparmor_parser" <sth0R> [82932.058391] type=1400 audit(1395415826.937:617): apparmor="STATUS" operation="profile_load" name="HANDLING_UNTRUSTED_INPUT" pid=8631 comm="apparmor_parser" <sth0R> [82932.058394] type=1400 audit(1395415826.937:618): apparmor="STATUS" operation="profile_load" name="phpsysinfo" pid=8631 comm="apparmor_parser" <sth0R> [82932.059058] type=1400 audit(1395415826.937:619): apparmor="STATUS" operation="profile_replace" info="profile can not be replaced" error=-17 name="/usr/lib/apache2/mpm-prefork/apache2//DEFAULT_URI" pid=8631 comm="apparmor_parser" <sth0R> [82932.059574] type=1400 audit(1395415826.937:620): apparmor="STATUS" operation="profile_replace" info="profile can not be replaced" error=-17 name="/usr/lib/apache2/mpm-prefork/apache2//HANDLING_UNTRUSTED_INPUT" pid=8631 comm="apparmor_parser" The reason this happens is that the cache file is a container that can contain multiple profiles in sequential order profile1 profile2 profile3 The parser loads the entire cache file to memory and the writes the whole file to the kernel interface. It then skips foward in the file to the next profile and reloads the file from that profile into the kernel. eg. First load profile1 profile2 profile3 advance to profile2, do second load profile2 profile3 advance to profile3, do third load profile3 With older kernels the interface would stop after the first profile and return that it had processed the whole file, thus while wasting compute resources copying extra data no errors occurred. However newer kernels now support atomic loading of multipe profiles, so that all the profiles passed in to the interface get processed. This means on newer kernels the current parser load behavior results in multiple loads/replacements when a cache file contains more than one profile (note: loads from a compile do not have this problem). To fix this, detect if the kernel supports atomic set loads, and load the cache file once. If it doesn't only load one profile section from a cache file at a time. Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Seth Arnold <seth.arnold@canonical.com> |
||
---|---|---|
.. | ||
libapparmor_re | ||
po | ||
tst | ||
apparmor-parser.spec.in | ||
apparmor.d.pod | ||
apparmor.pod | ||
apparmor_parser.pod | ||
common_optarg.c | ||
common_optarg.h | ||
COPYING.GPL | ||
dbus.c | ||
dbus.h | ||
frob_slack_rc | ||
immunix.h | ||
lib.c | ||
lib.h | ||
Makefile | ||
mount.c | ||
mount.h | ||
parser.conf | ||
parser.h | ||
parser_alias.c | ||
parser_common.c | ||
parser_include.c | ||
parser_include.h | ||
parser_interface.c | ||
parser_lex.l | ||
parser_main.c | ||
parser_merge.c | ||
parser_misc.c | ||
parser_policy.c | ||
parser_regex.c | ||
parser_symtab.c | ||
parser_variable.c | ||
parser_yacc.y | ||
policydb.h | ||
profile.cc | ||
profile.h | ||
ptrace.c | ||
ptrace.h | ||
rc.aaeventd.redhat | ||
rc.aaeventd.suse | ||
rc.apparmor.debian | ||
rc.apparmor.functions | ||
rc.apparmor.redhat | ||
rc.apparmor.slackware | ||
rc.apparmor.suse | ||
README | ||
README.devel | ||
rule.c | ||
rule.h | ||
signal.c | ||
signal.h | ||
subdomain.conf | ||
subdomain.conf.pod | ||
techdoc.tex | ||
unit_test.h |
The apparmor_parser allows you to add, replace, and remove AppArmor policy through the use of command line options. The default is to add. `apparmor_parser --help` shows what the command line options are. You can also find more information at http://wiki.apparmor.net Please send all complaints, feature requests, rants about the software, and questions to the apparmor@lists.ubuntu.com mailing list. Bug reports can be filed against the AppArmor project on launchpad.net at https://launchpad.net/apparmor or reported to the mailing list directly for those who wish not to register for an account on launchpad. Security issues can be filed as security bugs on launchpad or directed to security@ubuntu.com. We will attempt to conform to the RFP vulnerability disclosure protocol: http://www.wiretrip.net/rfp/policy.html Thanks. -- The AppArmor development team