diff options
author | Eric Paris <eparis@redhat.com> | 2012-04-03 12:37:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-03 12:48:40 -0400 |
commit | 3b3b0e4fc15efa507b902d90cea39e496a523c3b (patch) | |
tree | d7b91c21ad6c6f4ac21dd51297b74eec47c61684 /security/apparmor/policy.c | |
parent | 95694129b43165911dc4e8a972f0d39ad98d86be (diff) |
LSM: shrink sizeof LSM specific portion of common_audit_data
Linus found that the gigantic size of the common audit data caused a big
perf hit on something as simple as running stat() in a loop. This patch
requires LSMs to declare the LSM specific portion separately rather than
doing it in a union. Thus each LSM can be responsible for shrinking their
portion and don't have to pay a penalty just because other LSMs have a
bigger space requirement.
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/apparmor/policy.c')
-rw-r--r-- | security/apparmor/policy.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 906414383022..f1f7506a464d 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c | |||
@@ -964,11 +964,13 @@ static int audit_policy(int op, gfp_t gfp, const char *name, const char *info, | |||
964 | int error) | 964 | int error) |
965 | { | 965 | { |
966 | struct common_audit_data sa; | 966 | struct common_audit_data sa; |
967 | struct apparmor_audit_data aad = {0,}; | ||
967 | COMMON_AUDIT_DATA_INIT(&sa, NONE); | 968 | COMMON_AUDIT_DATA_INIT(&sa, NONE); |
968 | sa.aad.op = op; | 969 | sa.aad = &aad; |
969 | sa.aad.name = name; | 970 | aad.op = op; |
970 | sa.aad.info = info; | 971 | aad.name = name; |
971 | sa.aad.error = error; | 972 | aad.info = info; |
973 | aad.error = error; | ||
972 | 974 | ||
973 | return aa_audit(AUDIT_APPARMOR_STATUS, __aa_current_profile(), gfp, | 975 | return aa_audit(AUDIT_APPARMOR_STATUS, __aa_current_profile(), gfp, |
974 | &sa, NULL); | 976 | &sa, NULL); |