summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2018-02-09 13:57:39 +0100
committerJohn Johansen <john.johansen@canonical.com>2018-02-09 20:30:00 +0100
commitb5beb07ad32ab533027aa988d96a44965ec116f7 (patch)
tree187176b624ad9dfe857f6b2625426b9e7ac1d5d1 /security
parentapparmor: fix display of .ns_name for containers (diff)
downloadlinux-b5beb07ad32ab533027aa988d96a44965ec116f7.tar.xz
linux-b5beb07ad32ab533027aa988d96a44965ec116f7.zip
apparmor: fix resource audit messages when auditing peer
Resource auditing is using the peer field which is not available when the rlim data struct is used, because it is a different element of the same union. Accessing peer during resource auditing could cause garbage log entries or even oops the kernel. Move the rlim data block into the same struct as the peer field so they can be used together. CC: <stable@vger.kernel.org> Fixes: 86b92cb782b3 ("apparmor: move resource checks to using labels") Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security')
-rw-r--r--security/apparmor/include/audit.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/security/apparmor/include/audit.h b/security/apparmor/include/audit.h
index 4ac095118717..2ebc00a579fd 100644
--- a/security/apparmor/include/audit.h
+++ b/security/apparmor/include/audit.h
@@ -126,6 +126,10 @@ struct apparmor_audit_data {
const char *target;
kuid_t ouid;
} fs;
+ struct {
+ int rlim;
+ unsigned long max;
+ } rlim;
int signal;
};
};
@@ -135,10 +139,6 @@ struct apparmor_audit_data {
long pos;
} iface;
struct {
- int rlim;
- unsigned long max;
- } rlim;
- struct {
const char *src_name;
const char *type;
const char *trans;