diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-30 17:32:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-30 17:32:24 -0500 |
commit | 44c3b59102e3ecc7a01e9811862633e670595e51 (patch) | |
tree | 5bf397b2b4bd8fc08c59ad5f9f9c83874259da48 /include/linux | |
parent | 3b470ac43fcd9848fa65e58e54875ad75be61cec (diff) | |
parent | f71ea9ddf0ff110f3fcbb89a46686bfba264014c (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6:
security: compile capabilities by default
selinux: make selinux_set_mnt_opts() static
SELinux: Add warning messages on network denial due to error
SELinux: Add network ingress and egress control permission checks
NetLabel: Add auditing to the static labeling mechanism
NetLabel: Introduce static network labels for unlabeled connections
SELinux: Allow NetLabel to directly cache SIDs
SELinux: Enable dynamic enable/disable of the network access checks
SELinux: Better integration between peer labeling subsystems
SELinux: Add a new peer class and permissions to the Flask definitions
SELinux: Add a capabilities bitmap to SELinux policy version 22
SELinux: Add a network node caching mechanism similar to the sel_netif_*() functions
SELinux: Only store the network interface's ifindex
SELinux: Convert the netif code to use ifindex values
NetLabel: Add IP address family information to the netlbl_skbuff_getattr() function
NetLabel: Add secid token support to the NetLabel secattr struct
NetLabel: Consolidate the LSM domain mapping/hashing locks
NetLabel: Cleanup the LSM domain hash functions
NetLabel: Remove unneeded RCU read locks
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/audit.h | 2 | ||||
-rw-r--r-- | include/linux/selinux.h | 45 |
2 files changed, 39 insertions, 8 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index c68781692838..bdd6f5de5fc4 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -115,6 +115,8 @@ | |||
115 | #define AUDIT_MAC_IPSEC_ADDSPD 1413 /* Not used */ | 115 | #define AUDIT_MAC_IPSEC_ADDSPD 1413 /* Not used */ |
116 | #define AUDIT_MAC_IPSEC_DELSPD 1414 /* Not used */ | 116 | #define AUDIT_MAC_IPSEC_DELSPD 1414 /* Not used */ |
117 | #define AUDIT_MAC_IPSEC_EVENT 1415 /* Audit an IPSec event */ | 117 | #define AUDIT_MAC_IPSEC_EVENT 1415 /* Audit an IPSec event */ |
118 | #define AUDIT_MAC_UNLBL_STCADD 1416 /* NetLabel: add a static label */ | ||
119 | #define AUDIT_MAC_UNLBL_STCDEL 1417 /* NetLabel: del a static label */ | ||
118 | 120 | ||
119 | #define AUDIT_FIRST_KERN_ANOM_MSG 1700 | 121 | #define AUDIT_FIRST_KERN_ANOM_MSG 1700 |
120 | #define AUDIT_LAST_KERN_ANOM_MSG 1799 | 122 | #define AUDIT_LAST_KERN_ANOM_MSG 1799 |
diff --git a/include/linux/selinux.h b/include/linux/selinux.h index 6080f73fc85f..8c2cc4c02526 100644 --- a/include/linux/selinux.h +++ b/include/linux/selinux.h | |||
@@ -120,16 +120,35 @@ void selinux_get_task_sid(struct task_struct *tsk, u32 *sid); | |||
120 | int selinux_string_to_sid(char *str, u32 *sid); | 120 | int selinux_string_to_sid(char *str, u32 *sid); |
121 | 121 | ||
122 | /** | 122 | /** |
123 | * selinux_relabel_packet_permission - check permission to relabel a packet | 123 | * selinux_secmark_relabel_packet_permission - secmark permission check |
124 | * @sid: ID value to be applied to network packet (via SECMARK, most likely) | 124 | * @sid: SECMARK ID value to be applied to network packet |
125 | * | 125 | * |
126 | * Returns 0 if the current task is allowed to label packets with the | 126 | * Returns 0 if the current task is allowed to set the SECMARK label of |
127 | * supplied security ID. Note that it is implicit that the packet is always | 127 | * packets with the supplied security ID. Note that it is implicit that |
128 | * being relabeled from the default unlabled value, and that the access | 128 | * the packet is always being relabeled from the default unlabeled value, |
129 | * control decision is made in the AVC. | 129 | * and that the access control decision is made in the AVC. |
130 | */ | 130 | */ |
131 | int selinux_relabel_packet_permission(u32 sid); | 131 | int selinux_secmark_relabel_packet_permission(u32 sid); |
132 | 132 | ||
133 | /** | ||
134 | * selinux_secmark_refcount_inc - increments the secmark use counter | ||
135 | * | ||
136 | * SELinux keeps track of the current SECMARK targets in use so it knows | ||
137 | * when to apply SECMARK label access checks to network packets. This | ||
138 | * function incements this reference count to indicate that a new SECMARK | ||
139 | * target has been configured. | ||
140 | */ | ||
141 | void selinux_secmark_refcount_inc(void); | ||
142 | |||
143 | /** | ||
144 | * selinux_secmark_refcount_dec - decrements the secmark use counter | ||
145 | * | ||
146 | * SELinux keeps track of the current SECMARK targets in use so it knows | ||
147 | * when to apply SECMARK label access checks to network packets. This | ||
148 | * function decements this reference count to indicate that one of the | ||
149 | * existing SECMARK targets has been removed/flushed. | ||
150 | */ | ||
151 | void selinux_secmark_refcount_dec(void); | ||
133 | #else | 152 | #else |
134 | 153 | ||
135 | static inline int selinux_audit_rule_init(u32 field, u32 op, | 154 | static inline int selinux_audit_rule_init(u32 field, u32 op, |
@@ -184,11 +203,21 @@ static inline int selinux_string_to_sid(const char *str, u32 *sid) | |||
184 | return 0; | 203 | return 0; |
185 | } | 204 | } |
186 | 205 | ||
187 | static inline int selinux_relabel_packet_permission(u32 sid) | 206 | static inline int selinux_secmark_relabel_packet_permission(u32 sid) |
188 | { | 207 | { |
189 | return 0; | 208 | return 0; |
190 | } | 209 | } |
191 | 210 | ||
211 | static inline void selinux_secmark_refcount_inc(void) | ||
212 | { | ||
213 | return; | ||
214 | } | ||
215 | |||
216 | static inline void selinux_secmark_refcount_dec(void) | ||
217 | { | ||
218 | return; | ||
219 | } | ||
220 | |||
192 | #endif /* CONFIG_SECURITY_SELINUX */ | 221 | #endif /* CONFIG_SECURITY_SELINUX */ |
193 | 222 | ||
194 | #endif /* _LINUX_SELINUX_H */ | 223 | #endif /* _LINUX_SELINUX_H */ |