diff options
author | James Morris <jmorris@namei.org> | 2009-01-06 17:58:22 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-01-06 17:58:22 -0500 |
commit | ac8cc0fa5395fe2278e305a4cbed48e90d88d878 (patch) | |
tree | 515f577bfddd054ee4373228be7c974dfb8133af /security/smack/smack.h | |
parent | 238c6d54830c624f34ac9cf123ac04aebfca5013 (diff) | |
parent | 3699c53c485bf0168e6500d0ed18bf931584dd7c (diff) |
Merge branch 'next' into for-linus
Diffstat (limited to 'security/smack/smack.h')
-rw-r--r-- | security/smack/smack.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/security/smack/smack.h b/security/smack/smack.h index 31dce559595a..b79582e4fbfd 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/capability.h> | 16 | #include <linux/capability.h> |
17 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
18 | #include <linux/security.h> | 18 | #include <linux/security.h> |
19 | #include <linux/in.h> | ||
19 | #include <net/netlabel.h> | 20 | #include <net/netlabel.h> |
20 | 21 | ||
21 | /* | 22 | /* |
@@ -39,6 +40,7 @@ struct superblock_smack { | |||
39 | struct socket_smack { | 40 | struct socket_smack { |
40 | char *smk_out; /* outbound label */ | 41 | char *smk_out; /* outbound label */ |
41 | char *smk_in; /* inbound label */ | 42 | char *smk_in; /* inbound label */ |
43 | int smk_labeled; /* label scheme */ | ||
42 | char smk_packet[SMK_LABELLEN]; /* TCP peer label */ | 44 | char smk_packet[SMK_LABELLEN]; /* TCP peer label */ |
43 | }; | 45 | }; |
44 | 46 | ||
@@ -80,6 +82,16 @@ struct smack_cipso { | |||
80 | }; | 82 | }; |
81 | 83 | ||
82 | /* | 84 | /* |
85 | * An entry in the table identifying hosts. | ||
86 | */ | ||
87 | struct smk_netlbladdr { | ||
88 | struct smk_netlbladdr *smk_next; | ||
89 | struct sockaddr_in smk_host; /* network address */ | ||
90 | struct in_addr smk_mask; /* network mask */ | ||
91 | char *smk_label; /* label */ | ||
92 | }; | ||
93 | |||
94 | /* | ||
83 | * This is the repository for labels seen so that it is | 95 | * This is the repository for labels seen so that it is |
84 | * not necessary to keep allocating tiny chuncks of memory | 96 | * not necessary to keep allocating tiny chuncks of memory |
85 | * and so that they can be shared. | 97 | * and so that they can be shared. |
@@ -127,6 +139,20 @@ struct smack_known { | |||
127 | #define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT | 139 | #define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT |
128 | 140 | ||
129 | /* | 141 | /* |
142 | * How communications on this socket are treated. | ||
143 | * Usually it's determined by the underlying netlabel code | ||
144 | * but there are certain cases, including single label hosts | ||
145 | * and potentially single label interfaces for which the | ||
146 | * treatment can not be known in advance. | ||
147 | * | ||
148 | * The possibility of additional labeling schemes being | ||
149 | * introduced in the future exists as well. | ||
150 | */ | ||
151 | #define SMACK_UNLABELED_SOCKET 0 | ||
152 | #define SMACK_CIPSO_SOCKET 1 | ||
153 | |||
154 | /* | ||
155 | * smackfs magic number | ||
130 | * smackfs macic number | 156 | * smackfs macic number |
131 | */ | 157 | */ |
132 | #define SMACK_MAGIC 0x43415d53 /* "SMAC" */ | 158 | #define SMACK_MAGIC 0x43415d53 /* "SMAC" */ |
@@ -141,6 +167,7 @@ struct smack_known { | |||
141 | * CIPSO defaults. | 167 | * CIPSO defaults. |
142 | */ | 168 | */ |
143 | #define SMACK_CIPSO_DOI_DEFAULT 3 /* Historical */ | 169 | #define SMACK_CIPSO_DOI_DEFAULT 3 /* Historical */ |
170 | #define SMACK_CIPSO_DOI_INVALID -1 /* Not a DOI */ | ||
144 | #define SMACK_CIPSO_DIRECT_DEFAULT 250 /* Arbitrary */ | 171 | #define SMACK_CIPSO_DIRECT_DEFAULT 250 /* Arbitrary */ |
145 | #define SMACK_CIPSO_MAXCATVAL 63 /* Bigger gets harder */ | 172 | #define SMACK_CIPSO_MAXCATVAL 63 /* Bigger gets harder */ |
146 | #define SMACK_CIPSO_MAXLEVEL 255 /* CIPSO 2.2 standard */ | 173 | #define SMACK_CIPSO_MAXLEVEL 255 /* CIPSO 2.2 standard */ |
@@ -176,7 +203,6 @@ u32 smack_to_secid(const char *); | |||
176 | * Shared data. | 203 | * Shared data. |
177 | */ | 204 | */ |
178 | extern int smack_cipso_direct; | 205 | extern int smack_cipso_direct; |
179 | extern int smack_net_nltype; | ||
180 | extern char *smack_net_ambient; | 206 | extern char *smack_net_ambient; |
181 | extern char *smack_onlycap; | 207 | extern char *smack_onlycap; |
182 | 208 | ||
@@ -186,9 +212,10 @@ extern struct smack_known smack_known_hat; | |||
186 | extern struct smack_known smack_known_huh; | 212 | extern struct smack_known smack_known_huh; |
187 | extern struct smack_known smack_known_invalid; | 213 | extern struct smack_known smack_known_invalid; |
188 | extern struct smack_known smack_known_star; | 214 | extern struct smack_known smack_known_star; |
189 | extern struct smack_known smack_known_unset; | 215 | extern struct smack_known smack_known_web; |
190 | 216 | ||
191 | extern struct smk_list_entry *smack_list; | 217 | extern struct smk_list_entry *smack_list; |
218 | extern struct smk_netlbladdr *smack_netlbladdrs; | ||
192 | extern struct security_operations smack_ops; | 219 | extern struct security_operations smack_ops; |
193 | 220 | ||
194 | /* | 221 | /* |