Skip to content

Commit b5beb07

Browse files
committed
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: 86b92cb ("apparmor: move resource checks to using labels") Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent 040d9e2 commit b5beb07

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎security/apparmor/include/audit.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ struct apparmor_audit_data {
126126
const char *target;
127127
kuid_t ouid;
128128
} fs;
129+
struct {
130+
int rlim;
131+
unsigned long max;
132+
} rlim;
129133
int signal;
130134
};
131135
};
@@ -134,10 +138,6 @@ struct apparmor_audit_data {
134138
const char *ns;
135139
long pos;
136140
} iface;
137-
struct {
138-
int rlim;
139-
unsigned long max;
140-
} rlim;
141141
struct {
142142
const char *src_name;
143143
const char *type;

0 commit comments

Comments
 (0)