aboutsummaryrefslogtreecommitdiffstats
path: root/security/smack/smack.h
diff options
context:
space:
mode:
authorEtienne Basset <etienne.basset@numericable.fr>2009-03-24 15:53:24 -0400
committerJames Morris <jmorris@namei.org>2009-03-25 18:17:04 -0400
commit7198e2eeb44b3fe7cc97f997824002da47a9c644 (patch)
tree4989ad0f9727ac4b861189217760517aa8beea43 /security/smack/smack.h
parent703a3cd72817e99201cef84a8a7aecc60b2b3581 (diff)
smack: convert smack to standard linux lists
the following patch (on top of 2.6.29) converts Smack lists to standard linux lists Please review and consider for inclusion in 2.6.30-rc regards, Etienne Signed-off-by: Etienne Basset <etienne.basset@numericable.fr> Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security/smack/smack.h')
-rw-r--r--security/smack/smack.h28
1 files changed, 12 insertions, 16 deletions
diff --git a/security/smack/smack.h b/security/smack/smack.h
index b79582e4fbfd..64164f8fde70 100644
--- a/security/smack/smack.h
+++ b/security/smack/smack.h
@@ -18,6 +18,8 @@
18#include <linux/security.h> 18#include <linux/security.h>
19#include <linux/in.h> 19#include <linux/in.h>
20#include <net/netlabel.h> 20#include <net/netlabel.h>
21#include <linux/list.h>
22#include <linux/rculist.h>
21 23
22/* 24/*
23 * Why 23? CIPSO is constrained to 30, so a 32 byte buffer is 25 * Why 23? CIPSO is constrained to 30, so a 32 byte buffer is
@@ -59,17 +61,10 @@ struct inode_smack {
59 * A label access rule. 61 * A label access rule.
60 */ 62 */
61struct smack_rule { 63struct smack_rule {
62 char *smk_subject; 64 struct list_head list;
63 char *smk_object; 65 char *smk_subject;
64 int smk_access; 66 char *smk_object;
65}; 67 int smk_access;
66
67/*
68 * An entry in the table of permitted label accesses.
69 */
70struct smk_list_entry {
71 struct smk_list_entry *smk_next;
72 struct smack_rule smk_rule;
73}; 68};
74 69
75/* 70/*
@@ -85,7 +80,7 @@ struct smack_cipso {
85 * An entry in the table identifying hosts. 80 * An entry in the table identifying hosts.
86 */ 81 */
87struct smk_netlbladdr { 82struct smk_netlbladdr {
88 struct smk_netlbladdr *smk_next; 83 struct list_head list;
89 struct sockaddr_in smk_host; /* network address */ 84 struct sockaddr_in smk_host; /* network address */
90 struct in_addr smk_mask; /* network mask */ 85 struct in_addr smk_mask; /* network mask */
91 char *smk_label; /* label */ 86 char *smk_label; /* label */
@@ -113,7 +108,7 @@ struct smk_netlbladdr {
113 * the cipso direct mapping in used internally. 108 * the cipso direct mapping in used internally.
114 */ 109 */
115struct smack_known { 110struct smack_known {
116 struct smack_known *smk_next; 111 struct list_head list;
117 char smk_known[SMK_LABELLEN]; 112 char smk_known[SMK_LABELLEN];
118 u32 smk_secid; 113 u32 smk_secid;
119 struct smack_cipso *smk_cipso; 114 struct smack_cipso *smk_cipso;
@@ -206,7 +201,6 @@ extern int smack_cipso_direct;
206extern char *smack_net_ambient; 201extern char *smack_net_ambient;
207extern char *smack_onlycap; 202extern char *smack_onlycap;
208 203
209extern struct smack_known *smack_known;
210extern struct smack_known smack_known_floor; 204extern struct smack_known smack_known_floor;
211extern struct smack_known smack_known_hat; 205extern struct smack_known smack_known_hat;
212extern struct smack_known smack_known_huh; 206extern struct smack_known smack_known_huh;
@@ -214,8 +208,10 @@ extern struct smack_known smack_known_invalid;
214extern struct smack_known smack_known_star; 208extern struct smack_known smack_known_star;
215extern struct smack_known smack_known_web; 209extern struct smack_known smack_known_web;
216 210
217extern struct smk_list_entry *smack_list; 211extern struct list_head smack_known_list;
218extern struct smk_netlbladdr *smack_netlbladdrs; 212extern struct list_head smack_rule_list;
213extern struct list_head smk_netlbladdr_list;
214
219extern struct security_operations smack_ops; 215extern struct security_operations smack_ops;
220 216
221/* 217/*