diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-25 03:45:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-25 03:45:31 -0400 |
commit | 36b8d186e6cc8e32cb5227f5645a58e1bc0af190 (patch) | |
tree | 1000ad26e189e6ff2c53fb7eeff605f59c7ad94e /security/selinux | |
parent | cd85b557414fe4cd44ea6608825e96612a5fe2b2 (diff) | |
parent | c45ed235abf1b0b6666417e3c394f18717976acd (diff) |
Merge branch 'next' of git://selinuxproject.org/~jmorris/linux-security
* 'next' of git://selinuxproject.org/~jmorris/linux-security: (95 commits)
TOMOYO: Fix incomplete read after seek.
Smack: allow to access /smack/access as normal user
TOMOYO: Fix unused kernel config option.
Smack: fix: invalid length set for the result of /smack/access
Smack: compilation fix
Smack: fix for /smack/access output, use string instead of byte
Smack: domain transition protections (v3)
Smack: Provide information for UDS getsockopt(SO_PEERCRED)
Smack: Clean up comments
Smack: Repair processing of fcntl
Smack: Rule list lookup performance
Smack: check permissions from user space (v2)
TOMOYO: Fix quota and garbage collector.
TOMOYO: Remove redundant tasklist_lock.
TOMOYO: Fix domain transition failure warning.
TOMOYO: Remove tomoyo_policy_memory_lock spinlock.
TOMOYO: Simplify garbage collector.
TOMOYO: Fix make namespacecheck warnings.
target: check hex2bin result
encrypted-keys: check hex2bin result
...
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/exports.c | 1 | ||||
-rw-r--r-- | security/selinux/hooks.c | 13 | ||||
-rw-r--r-- | security/selinux/include/avc_ss.h | 6 | ||||
-rw-r--r-- | security/selinux/include/security.h | 8 | ||||
-rw-r--r-- | security/selinux/netlink.c | 2 | ||||
-rw-r--r-- | security/selinux/nlmsgtab.c | 1 | ||||
-rw-r--r-- | security/selinux/selinuxfs.c | 5 | ||||
-rw-r--r-- | security/selinux/ss/conditional.c | 2 | ||||
-rw-r--r-- | security/selinux/ss/conditional.h | 1 | ||||
-rw-r--r-- | security/selinux/ss/policydb.c | 2 | ||||
-rw-r--r-- | security/selinux/ss/services.c | 3 |
11 files changed, 23 insertions, 21 deletions
diff --git a/security/selinux/exports.c b/security/selinux/exports.c index 90664385dead..e75dd94e2d2b 100644 --- a/security/selinux/exports.c +++ b/security/selinux/exports.c | |||
@@ -12,6 +12,7 @@ | |||
12 | * as published by the Free Software Foundation. | 12 | * as published by the Free Software Foundation. |
13 | */ | 13 | */ |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/selinux.h> | ||
15 | 16 | ||
16 | #include "security.h" | 17 | #include "security.h" |
17 | 18 | ||
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 266a2292451d..e545b9f67072 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -89,14 +89,14 @@ | |||
89 | #include "xfrm.h" | 89 | #include "xfrm.h" |
90 | #include "netlabel.h" | 90 | #include "netlabel.h" |
91 | #include "audit.h" | 91 | #include "audit.h" |
92 | #include "avc_ss.h" | ||
92 | 93 | ||
93 | #define NUM_SEL_MNT_OPTS 5 | 94 | #define NUM_SEL_MNT_OPTS 5 |
94 | 95 | ||
95 | extern int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm); | ||
96 | extern struct security_operations *security_ops; | 96 | extern struct security_operations *security_ops; |
97 | 97 | ||
98 | /* SECMARK reference count */ | 98 | /* SECMARK reference count */ |
99 | atomic_t selinux_secmark_refcount = ATOMIC_INIT(0); | 99 | static atomic_t selinux_secmark_refcount = ATOMIC_INIT(0); |
100 | 100 | ||
101 | #ifdef CONFIG_SECURITY_SELINUX_DEVELOP | 101 | #ifdef CONFIG_SECURITY_SELINUX_DEVELOP |
102 | int selinux_enforcing; | 102 | int selinux_enforcing; |
@@ -279,10 +279,6 @@ static void superblock_free_security(struct super_block *sb) | |||
279 | kfree(sbsec); | 279 | kfree(sbsec); |
280 | } | 280 | } |
281 | 281 | ||
282 | /* The security server must be initialized before | ||
283 | any labeling or access decisions can be provided. */ | ||
284 | extern int ss_initialized; | ||
285 | |||
286 | /* The file system's label must be initialized prior to use. */ | 282 | /* The file system's label must be initialized prior to use. */ |
287 | 283 | ||
288 | static const char *labeling_behaviors[6] = { | 284 | static const char *labeling_behaviors[6] = { |
@@ -2097,9 +2093,6 @@ static int selinux_bprm_secureexec(struct linux_binprm *bprm) | |||
2097 | return (atsecure || cap_bprm_secureexec(bprm)); | 2093 | return (atsecure || cap_bprm_secureexec(bprm)); |
2098 | } | 2094 | } |
2099 | 2095 | ||
2100 | extern struct vfsmount *selinuxfs_mount; | ||
2101 | extern struct dentry *selinux_null; | ||
2102 | |||
2103 | /* Derived from fs/exec.c:flush_old_files. */ | 2096 | /* Derived from fs/exec.c:flush_old_files. */ |
2104 | static inline void flush_unauthorized_files(const struct cred *cred, | 2097 | static inline void flush_unauthorized_files(const struct cred *cred, |
2105 | struct files_struct *files) | 2098 | struct files_struct *files) |
@@ -5803,8 +5796,6 @@ static int selinux_disabled; | |||
5803 | 5796 | ||
5804 | int selinux_disable(void) | 5797 | int selinux_disable(void) |
5805 | { | 5798 | { |
5806 | extern void exit_sel_fs(void); | ||
5807 | |||
5808 | if (ss_initialized) { | 5799 | if (ss_initialized) { |
5809 | /* Not permitted after initial policy load. */ | 5800 | /* Not permitted after initial policy load. */ |
5810 | return -EINVAL; | 5801 | return -EINVAL; |
diff --git a/security/selinux/include/avc_ss.h b/security/selinux/include/avc_ss.h index 4677aa519b04..d5c328452df0 100644 --- a/security/selinux/include/avc_ss.h +++ b/security/selinux/include/avc_ss.h | |||
@@ -18,5 +18,11 @@ struct security_class_mapping { | |||
18 | 18 | ||
19 | extern struct security_class_mapping secclass_map[]; | 19 | extern struct security_class_mapping secclass_map[]; |
20 | 20 | ||
21 | /* | ||
22 | * The security server must be initialized before | ||
23 | * any labeling or access decisions can be provided. | ||
24 | */ | ||
25 | extern int ss_initialized; | ||
26 | |||
21 | #endif /* _SELINUX_AVC_SS_H_ */ | 27 | #endif /* _SELINUX_AVC_SS_H_ */ |
22 | 28 | ||
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h index 3ba4feba048a..d871e8ad2103 100644 --- a/security/selinux/include/security.h +++ b/security/selinux/include/security.h | |||
@@ -216,6 +216,14 @@ struct selinux_kernel_status { | |||
216 | 216 | ||
217 | extern void selinux_status_update_setenforce(int enforcing); | 217 | extern void selinux_status_update_setenforce(int enforcing); |
218 | extern void selinux_status_update_policyload(int seqno); | 218 | extern void selinux_status_update_policyload(int seqno); |
219 | extern void selinux_complete_init(void); | ||
220 | extern int selinux_disable(void); | ||
221 | extern void exit_sel_fs(void); | ||
222 | extern struct dentry *selinux_null; | ||
223 | extern struct vfsmount *selinuxfs_mount; | ||
224 | extern void selnl_notify_setenforce(int val); | ||
225 | extern void selnl_notify_policyload(u32 seqno); | ||
226 | extern int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm); | ||
219 | 227 | ||
220 | #endif /* _SELINUX_SECURITY_H_ */ | 228 | #endif /* _SELINUX_SECURITY_H_ */ |
221 | 229 | ||
diff --git a/security/selinux/netlink.c b/security/selinux/netlink.c index 36ac257cec9a..ce3f481558d8 100644 --- a/security/selinux/netlink.c +++ b/security/selinux/netlink.c | |||
@@ -19,6 +19,8 @@ | |||
19 | #include <linux/selinux_netlink.h> | 19 | #include <linux/selinux_netlink.h> |
20 | #include <net/net_namespace.h> | 20 | #include <net/net_namespace.h> |
21 | 21 | ||
22 | #include "security.h" | ||
23 | |||
22 | static struct sock *selnl; | 24 | static struct sock *selnl; |
23 | 25 | ||
24 | static int selnl_msglen(int msgtype) | 26 | static int selnl_msglen(int msgtype) |
diff --git a/security/selinux/nlmsgtab.c b/security/selinux/nlmsgtab.c index 8b02b2137da2..0920ea3bf599 100644 --- a/security/selinux/nlmsgtab.c +++ b/security/selinux/nlmsgtab.c | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #include "flask.h" | 22 | #include "flask.h" |
23 | #include "av_permissions.h" | 23 | #include "av_permissions.h" |
24 | #include "security.h" | ||
24 | 25 | ||
25 | struct nlmsg_perm { | 26 | struct nlmsg_perm { |
26 | u16 nlmsg_type; | 27 | u16 nlmsg_type; |
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 55d92cbb177a..f46658722c78 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
@@ -75,8 +75,6 @@ static char policy_opened; | |||
75 | /* global data for policy capabilities */ | 75 | /* global data for policy capabilities */ |
76 | static struct dentry *policycap_dir; | 76 | static struct dentry *policycap_dir; |
77 | 77 | ||
78 | extern void selnl_notify_setenforce(int val); | ||
79 | |||
80 | /* Check whether a task is allowed to use a security operation. */ | 78 | /* Check whether a task is allowed to use a security operation. */ |
81 | static int task_has_security(struct task_struct *tsk, | 79 | static int task_has_security(struct task_struct *tsk, |
82 | u32 perms) | 80 | u32 perms) |
@@ -278,7 +276,6 @@ static ssize_t sel_write_disable(struct file *file, const char __user *buf, | |||
278 | char *page = NULL; | 276 | char *page = NULL; |
279 | ssize_t length; | 277 | ssize_t length; |
280 | int new_value; | 278 | int new_value; |
281 | extern int selinux_disable(void); | ||
282 | 279 | ||
283 | length = -ENOMEM; | 280 | length = -ENOMEM; |
284 | if (count >= PAGE_SIZE) | 281 | if (count >= PAGE_SIZE) |
@@ -478,7 +475,7 @@ static struct vm_operations_struct sel_mmap_policy_ops = { | |||
478 | .page_mkwrite = sel_mmap_policy_fault, | 475 | .page_mkwrite = sel_mmap_policy_fault, |
479 | }; | 476 | }; |
480 | 477 | ||
481 | int sel_mmap_policy(struct file *filp, struct vm_area_struct *vma) | 478 | static int sel_mmap_policy(struct file *filp, struct vm_area_struct *vma) |
482 | { | 479 | { |
483 | if (vma->vm_flags & VM_SHARED) { | 480 | if (vma->vm_flags & VM_SHARED) { |
484 | /* do not allow mprotect to make mapping writable */ | 481 | /* do not allow mprotect to make mapping writable */ |
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index a53373207fb4..2ec904177fe0 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c | |||
@@ -555,7 +555,7 @@ static int cond_write_av_list(struct policydb *p, | |||
555 | return 0; | 555 | return 0; |
556 | } | 556 | } |
557 | 557 | ||
558 | int cond_write_node(struct policydb *p, struct cond_node *node, | 558 | static int cond_write_node(struct policydb *p, struct cond_node *node, |
559 | struct policy_file *fp) | 559 | struct policy_file *fp) |
560 | { | 560 | { |
561 | struct cond_expr *cur_expr; | 561 | struct cond_expr *cur_expr; |
diff --git a/security/selinux/ss/conditional.h b/security/selinux/ss/conditional.h index 3f209c635295..4d1f87466508 100644 --- a/security/selinux/ss/conditional.h +++ b/security/selinux/ss/conditional.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include "avtab.h" | 13 | #include "avtab.h" |
14 | #include "symtab.h" | 14 | #include "symtab.h" |
15 | #include "policydb.h" | 15 | #include "policydb.h" |
16 | #include "../include/conditional.h" | ||
16 | 17 | ||
17 | #define COND_EXPR_MAXDEPTH 10 | 18 | #define COND_EXPR_MAXDEPTH 10 |
18 | 19 | ||
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 2381d0ded228..a7f61d52f05c 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -1743,8 +1743,6 @@ static int policydb_bounds_sanity_check(struct policydb *p) | |||
1743 | return 0; | 1743 | return 0; |
1744 | } | 1744 | } |
1745 | 1745 | ||
1746 | extern int ss_initialized; | ||
1747 | |||
1748 | u16 string_to_security_class(struct policydb *p, const char *name) | 1746 | u16 string_to_security_class(struct policydb *p, const char *name) |
1749 | { | 1747 | { |
1750 | struct class_datum *cladatum; | 1748 | struct class_datum *cladatum; |
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index f6917bc0aa05..185f849a26f6 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -70,8 +70,6 @@ | |||
70 | #include "ebitmap.h" | 70 | #include "ebitmap.h" |
71 | #include "audit.h" | 71 | #include "audit.h" |
72 | 72 | ||
73 | extern void selnl_notify_policyload(u32 seqno); | ||
74 | |||
75 | int selinux_policycap_netpeer; | 73 | int selinux_policycap_netpeer; |
76 | int selinux_policycap_openperm; | 74 | int selinux_policycap_openperm; |
77 | 75 | ||
@@ -1790,7 +1788,6 @@ static void security_load_policycaps(void) | |||
1790 | POLICYDB_CAPABILITY_OPENPERM); | 1788 | POLICYDB_CAPABILITY_OPENPERM); |
1791 | } | 1789 | } |
1792 | 1790 | ||
1793 | extern void selinux_complete_init(void); | ||
1794 | static int security_preserve_bools(struct policydb *p); | 1791 | static int security_preserve_bools(struct policydb *p); |
1795 | 1792 | ||
1796 | /** | 1793 | /** |