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 /include/linux | |
| 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 'include/linux')
| -rw-r--r-- | include/linux/lsm_audit.h | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h index 6f4fb37aac88..d1b073ffec24 100644 --- a/include/linux/lsm_audit.h +++ b/include/linux/lsm_audit.h | |||
| @@ -22,6 +22,23 @@ | |||
| 22 | #include <linux/key.h> | 22 | #include <linux/key.h> |
| 23 | #include <linux/skbuff.h> | 23 | #include <linux/skbuff.h> |
| 24 | 24 | ||
| 25 | struct lsm_network_audit { | ||
| 26 | int netif; | ||
| 27 | struct sock *sk; | ||
| 28 | u16 family; | ||
| 29 | __be16 dport; | ||
| 30 | __be16 sport; | ||
| 31 | union { | ||
| 32 | struct { | ||
| 33 | __be32 daddr; | ||
| 34 | __be32 saddr; | ||
| 35 | } v4; | ||
| 36 | struct { | ||
| 37 | struct in6_addr daddr; | ||
| 38 | struct in6_addr saddr; | ||
| 39 | } v6; | ||
| 40 | } fam; | ||
| 41 | }; | ||
| 25 | 42 | ||
| 26 | /* Auxiliary data to use in generating the audit record. */ | 43 | /* Auxiliary data to use in generating the audit record. */ |
| 27 | struct common_audit_data { | 44 | struct common_audit_data { |
| @@ -41,23 +58,7 @@ struct common_audit_data { | |||
| 41 | struct path path; | 58 | struct path path; |
| 42 | struct dentry *dentry; | 59 | struct dentry *dentry; |
| 43 | struct inode *inode; | 60 | struct inode *inode; |
| 44 | struct { | 61 | struct lsm_network_audit *net; |
| 45 | int netif; | ||
| 46 | struct sock *sk; | ||
| 47 | u16 family; | ||
| 48 | __be16 dport; | ||
| 49 | __be16 sport; | ||
| 50 | union { | ||
| 51 | struct { | ||
| 52 | __be32 daddr; | ||
| 53 | __be32 saddr; | ||
| 54 | } v4; | ||
| 55 | struct { | ||
| 56 | struct in6_addr daddr; | ||
| 57 | struct in6_addr saddr; | ||
| 58 | } v6; | ||
| 59 | } fam; | ||
| 60 | } net; | ||
| 61 | int cap; | 62 | int cap; |
| 62 | int ipc_id; | 63 | int ipc_id; |
| 63 | struct task_struct *tsk; | 64 | struct task_struct *tsk; |
