]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
apparmor: fix resource audit messages when auditing peer
authorJohn Johansen <john.johansen@canonical.com>
Fri, 9 Feb 2018 12:57:39 +0000 (04:57 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Fri, 9 Feb 2018 19:30:00 +0000 (11:30 -0800)
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>
security/apparmor/include/audit.h

index 4ac095118717022cfb3ea564b5ec37deaad91a90..2ebc00a579fde7152d0b955db70b4eccd8c0b330 100644 (file)
@@ -126,6 +126,10 @@ struct apparmor_audit_data {
                                        const char *target;
                                        kuid_t ouid;
                                } fs;
+                               struct {
+                                       int rlim;
+                                       unsigned long max;
+                               } rlim;
                                int signal;
                        };
                };
@@ -134,10 +138,6 @@ struct apparmor_audit_data {
                        const char *ns;
                        long pos;
                } iface;
-               struct {
-                       int rlim;
-                       unsigned long max;
-               } rlim;
                struct {
                        const char *src_name;
                        const char *type;