0df34a64 | 30-Jul-2019 |
John Johansen <john.johansen@canonical.com> |
apparmor: add outofband transition and use it in xattr match
There are cases where the a special out of band transition that can not be triggered by input is useful in separating match conditions in
apparmor: add outofband transition and use it in xattr match
There are cases where the a special out of band transition that can not be triggered by input is useful in separating match conditions in the dfa encoding.
The null_transition is currently used as an out of band transition for match conditions that can not contain a \0 in their input but apparmor needs an out of band transition for cases where the match condition is allowed to contain any input character.
Achieve this by allowing for an explicit transition out of input range that can only be triggered by code.
Signed-off-by: John Johansen <john.johansen@canonical.com>
show more ...
|
df323337 | 03-May-2019 |
Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
apparmor: Use a memory pool instead per-CPU caches
The get_buffers() macro may provide one or two buffers to the caller. Those buffers are pre-allocated on init for each CPU. By default it allocates
apparmor: Use a memory pool instead per-CPU caches
The get_buffers() macro may provide one or two buffers to the caller. Those buffers are pre-allocated on init for each CPU. By default it allocates 2* 2 * MAX_PATH * POSSIBLE_CPU
which equals 64KiB on a system with 4 CPUs or 1MiB with 64 CPUs and so on.
Replace the per-CPU buffers with a common memory pool which is shared across all CPUs. The pool grows on demand and never shrinks. The pool starts with two (UP) or four (SMP) elements. By using this pool it is possible to request a buffer and keeping preemption enabled which avoids the hack in profile_transition().
It has been pointed out by Tetsuo Handa that GFP_KERNEL allocations for small amount of memory do not fail. In order not to have an endless retry, __GFP_RETRY_MAYFAIL is passed (so the memory allocation is not repeated until success) and retried once hoping that in the meantime a buffer has been returned to the pool. Since now NULL is possible all allocation paths check the buffer pointer and return -ENOMEM on failure.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: John Johansen <john.johansen@canonical.com>
show more ...
|
f4ad8f2c | 22-Sep-2018 |
Casey Schaufler <casey@schaufler-ca.com> |
LSM: Infrastructure management of the task security
Move management of the task_struct->security blob out of the individual security modules and into the security infrastructure. Instead of allocati
LSM: Infrastructure management of the task security
Move management of the task_struct->security blob out of the individual security modules and into the security infrastructure. Instead of allocating the blobs from within the modules the modules tell the infrastructure how much space is required, and the space is allocated there. The only user of this blob is AppArmor. The AppArmor use is abstracted to avoid future conflict.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> Reviewed-by: Kees Cook <keescook@chromium.org> [kees: adjusted for ordered init series] Signed-off-by: Kees Cook <keescook@chromium.org>
show more ...
|
33bf60ca | 12-Nov-2018 |
Casey Schaufler <casey@schaufler-ca.com> |
LSM: Infrastructure management of the file security
Move management of the file->f_security blob out of the individual security modules and into the infrastructure. The modules no longer allocate or
LSM: Infrastructure management of the file security
Move management of the file->f_security blob out of the individual security modules and into the infrastructure. The modules no longer allocate or free the data, instead they tell the infrastructure how much space they require.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> Reviewed-by: Kees Cook <keescook@chromium.org> [kees: adjusted for ordered init series] Signed-off-by: Kees Cook <keescook@chromium.org>
show more ...
|
9caafbe2 | 24-May-2018 |
Matthew Garrett <mjg59@google.com> |
apparmor: Parse secmark policy
Add support for parsing secmark policy provided by userspace, and store that in the overall policy.
Signed-off-by: Matthew Garrett <mjg59@google.com> Signed-off-by: J
apparmor: Parse secmark policy
Add support for parsing secmark policy provided by userspace, and store that in the overall policy.
Signed-off-by: Matthew Garrett <mjg59@google.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
show more ...
|
617a629c | 24-May-2018 |
Matthew Garrett <mjg59@google.com> |
apparmor: Add a wildcard secid
Reserve a secid value that we can use as a wildcard, allowing us to define policy that's expected to match against all secids.
Signed-off-by: Matthew Garrett <mjg59@g
apparmor: Add a wildcard secid
Reserve a secid value that we can use as a wildcard, allowing us to define policy that's expected to match against all secids.
Signed-off-by: Matthew Garrett <mjg59@google.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
show more ...
|
1f8266ff | 13-Sep-2018 |
Jann Horn <jannh@google.com> |
apparmor: don't try to replace stale label in ptrace access check
As a comment above begin_current_label_crit_section() explains, begin_current_label_crit_section() must run in sleepable context bec
apparmor: don't try to replace stale label in ptrace access check
As a comment above begin_current_label_crit_section() explains, begin_current_label_crit_section() must run in sleepable context because when label_is_stale() is true, aa_replace_current_label() runs, which uses prepare_creds(), which can sleep. Until now, the ptrace access check (which runs with a task lock held) violated this rule.
Also add a might_sleep() assertion to begin_current_label_crit_section(), because asserts are less likely to be ignored than comments.
Fixes: b2d09ae449ced ("apparmor: move ptrace checks to using labels") Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
show more ...
|
a4c3f89c | 05-Jun-2018 |
John Johansen <john.johansen@canonical.com> |
apparmor: fixup secid map conversion to using IDR
The IDR conversion did not handle an error case for when allocating a mapping fails, and it did not ensure that mappings did not allocate or use a 0
apparmor: fixup secid map conversion to using IDR
The IDR conversion did not handle an error case for when allocating a mapping fails, and it did not ensure that mappings did not allocate or use a 0 value, which is used as an invalid secid. Which is used when a mapping fails.
Fixes: 3ae7eb49a2be ("apparmor: Use an IDR to allocate apparmor secids") Signed-off-by: John Johansen <john.johansen@canonical.com>
show more ...
|
e79c26d0 | 16-Apr-2018 |
Matthew Garrett <mjg59@google.com> |
apparmor: Add support for audit rule filtering
This patch adds support to Apparmor for integrating with audit rule filtering. Right now it only handles SUBJ_ROLE, interpreting it as a single compone
apparmor: Add support for audit rule filtering
This patch adds support to Apparmor for integrating with audit rule filtering. Right now it only handles SUBJ_ROLE, interpreting it as a single component of a label. This is sufficient to get Apparmor working with IMA's appraisal rules without any modifications on the IMA side.
Signed-off-by: Matthew Garrett <mjg59@google.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
show more ...
|