Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54b990ed authored by John Johansen's avatar John Johansen Committed by Greg Kroah-Hartman
Browse files

apparmor: fix resource audit messages when auditing peer



commit b5beb07ad32ab533027aa988d96a44965ec116f7 upstream.

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: 86b92cb7 ("apparmor: move resource checks to using labels")
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a0358f60
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;