diff options
author | Eric Paris <eparis@redhat.com> | 2012-04-02 13:15:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-03 12:49:10 -0400 |
commit | 48c62af68a403ef1655546bd3e021070c8508573 (patch) | |
tree | ba938e4fb45d5bdaad2dad44071d0625f8e36945 /security/smack/smack.h | |
parent | 3b3b0e4fc15efa507b902d90cea39e496a523c3b (diff) |
LSM: shrink the common_audit_data data union
After shrinking the common_audit_data stack usage for private LSM data I'm
not going to shrink the data union. To do this I'm going to move anything
larger than 2 void * ptrs to it's own structure and require it to be declared
separately on the calling stack. Thus hot paths which don't need more than
a couple pointer don't have to declare space to hold large unneeded
structures. I could get this down to one void * by dealing with the key
struct and the struct path. We'll see if that is helpful after taking care of
networking.
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/smack/smack.h')
-rw-r--r-- | security/smack/smack.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/security/smack/smack.h b/security/smack/smack.h index ccba3823d9ef..4ede719922ed 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h | |||
@@ -325,6 +325,14 @@ static inline void smk_ad_init(struct smk_audit_info *a, const char *func, | |||
325 | a->a.smack_audit_data->function = func; | 325 | a->a.smack_audit_data->function = func; |
326 | } | 326 | } |
327 | 327 | ||
328 | static inline void smk_ad_init_net(struct smk_audit_info *a, const char *func, | ||
329 | char type, struct lsm_network_audit *net) | ||
330 | { | ||
331 | smk_ad_init(a, func, type); | ||
332 | memset(net, 0, sizeof(*net)); | ||
333 | a->a.u.net = net; | ||
334 | } | ||
335 | |||
328 | static inline void smk_ad_setfield_u_tsk(struct smk_audit_info *a, | 336 | static inline void smk_ad_setfield_u_tsk(struct smk_audit_info *a, |
329 | struct task_struct *t) | 337 | struct task_struct *t) |
330 | { | 338 | { |
@@ -348,7 +356,7 @@ static inline void smk_ad_setfield_u_fs_path(struct smk_audit_info *a, | |||
348 | static inline void smk_ad_setfield_u_net_sk(struct smk_audit_info *a, | 356 | static inline void smk_ad_setfield_u_net_sk(struct smk_audit_info *a, |
349 | struct sock *sk) | 357 | struct sock *sk) |
350 | { | 358 | { |
351 | a->a.u.net.sk = sk; | 359 | a->a.u.net->sk = sk; |
352 | } | 360 | } |
353 | 361 | ||
354 | #else /* no AUDIT */ | 362 | #else /* no AUDIT */ |