]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.15.18/apparmor-fix-resource-audit-messages-when-auditing-peer.patch
Linux 5.1.4
[thirdparty/kernel/stable-queue.git] / releases / 4.15.18 / apparmor-fix-resource-audit-messages-when-auditing-peer.patch
CommitLineData
c4ffb79e
GKH
1From b5beb07ad32ab533027aa988d96a44965ec116f7 Mon Sep 17 00:00:00 2001
2From: John Johansen <john.johansen@canonical.com>
3Date: Fri, 9 Feb 2018 04:57:39 -0800
4Subject: apparmor: fix resource audit messages when auditing peer
5
6From: John Johansen <john.johansen@canonical.com>
7
8commit b5beb07ad32ab533027aa988d96a44965ec116f7 upstream.
9
10Resource auditing is using the peer field which is not available
11when the rlim data struct is used, because it is a different element
12of the same union. Accessing peer during resource auditing could
13cause garbage log entries or even oops the kernel.
14
15Move the rlim data block into the same struct as the peer field
16so they can be used together.
17
18CC: <stable@vger.kernel.org>
19Fixes: 86b92cb782b3 ("apparmor: move resource checks to using labels")
20Signed-off-by: John Johansen <john.johansen@canonical.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23---
24 security/apparmor/include/audit.h | 8 ++++----
25 1 file changed, 4 insertions(+), 4 deletions(-)
26
27--- a/security/apparmor/include/audit.h
28+++ b/security/apparmor/include/audit.h
29@@ -126,6 +126,10 @@ struct apparmor_audit_data {
30 const char *target;
31 kuid_t ouid;
32 } fs;
33+ struct {
34+ int rlim;
35+ unsigned long max;
36+ } rlim;
37 int signal;
38 };
39 };
40@@ -135,10 +139,6 @@ struct apparmor_audit_data {
41 long pos;
42 } iface;
43 struct {
44- int rlim;
45- unsigned long max;
46- } rlim;
47- struct {
48 const char *src_name;
49 const char *type;
50 const char *trans;