diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 15:41:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 15:41:19 -0400 |
commit | a8fe1500986c32b46b36118aa250f6badca11bfc (patch) | |
tree | d5517e16e633fa0c54248f27b5921e8ac4e4a459 /security/security.c | |
parent | 94ebd235c493f43681f609b0e02733337053e8f0 (diff) | |
parent | f0d3d9894e43fc68d47948e2c6f03e32da88b799 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (26 commits)
selinux: include vmalloc.h for vmalloc_user
secmark: fix config problem when CONFIG_NF_CONNTRACK_SECMARK is not set
selinux: implement mmap on /selinux/policy
SELinux: allow userspace to read policy back out of the kernel
SELinux: drop useless (and incorrect) AVTAB_MAX_SIZE
SELinux: deterministic ordering of range transition rules
kernel: roundup should only reference arguments once
kernel: rounddown helper function
secmark: export secctx, drop secmark in procfs
conntrack: export lsm context rather than internal secid via netlink
security: secid_to_secctx returns len when data is NULL
secmark: make secmark object handling generic
secmark: do not return early if there was no error
AppArmor: Ensure the size of the copy is < the buffer allocated to hold it
TOMOYO: Print URL information before panic().
security: remove unused parameter from security_task_setscheduler()
tpm: change 'tpm_suspend_pcr' to be module parameter
selinux: fix up style problem on /selinux/status
selinux: change to new flag variable
selinux: really fix dependency causing parallel compile failure.
...
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/security/security.c b/security/security.c index c53949f17d9e..b50f472061a4 100644 --- a/security/security.c +++ b/security/security.c | |||
@@ -89,20 +89,12 @@ __setup("security=", choose_lsm); | |||
89 | * Return true if: | 89 | * Return true if: |
90 | * -The passed LSM is the one chosen by user at boot time, | 90 | * -The passed LSM is the one chosen by user at boot time, |
91 | * -or the passed LSM is configured as the default and the user did not | 91 | * -or the passed LSM is configured as the default and the user did not |
92 | * choose an alternate LSM at boot time, | 92 | * choose an alternate LSM at boot time. |
93 | * -or there is no default LSM set and the user didn't specify a | ||
94 | * specific LSM and we're the first to ask for registration permission, | ||
95 | * -or the passed LSM is currently loaded. | ||
96 | * Otherwise, return false. | 93 | * Otherwise, return false. |
97 | */ | 94 | */ |
98 | int __init security_module_enable(struct security_operations *ops) | 95 | int __init security_module_enable(struct security_operations *ops) |
99 | { | 96 | { |
100 | if (!*chosen_lsm) | 97 | return !strcmp(ops->name, chosen_lsm); |
101 | strncpy(chosen_lsm, ops->name, SECURITY_NAME_MAX); | ||
102 | else if (strncmp(ops->name, chosen_lsm, SECURITY_NAME_MAX)) | ||
103 | return 0; | ||
104 | |||
105 | return 1; | ||
106 | } | 98 | } |
107 | 99 | ||
108 | /** | 100 | /** |
@@ -786,10 +778,9 @@ int security_task_setrlimit(struct task_struct *p, unsigned int resource, | |||
786 | return security_ops->task_setrlimit(p, resource, new_rlim); | 778 | return security_ops->task_setrlimit(p, resource, new_rlim); |
787 | } | 779 | } |
788 | 780 | ||
789 | int security_task_setscheduler(struct task_struct *p, | 781 | int security_task_setscheduler(struct task_struct *p) |
790 | int policy, struct sched_param *lp) | ||
791 | { | 782 | { |
792 | return security_ops->task_setscheduler(p, policy, lp); | 783 | return security_ops->task_setscheduler(p); |
793 | } | 784 | } |
794 | 785 | ||
795 | int security_task_getscheduler(struct task_struct *p) | 786 | int security_task_getscheduler(struct task_struct *p) |
@@ -1145,6 +1136,24 @@ void security_inet_conn_established(struct sock *sk, | |||
1145 | security_ops->inet_conn_established(sk, skb); | 1136 | security_ops->inet_conn_established(sk, skb); |
1146 | } | 1137 | } |
1147 | 1138 | ||
1139 | int security_secmark_relabel_packet(u32 secid) | ||
1140 | { | ||
1141 | return security_ops->secmark_relabel_packet(secid); | ||
1142 | } | ||
1143 | EXPORT_SYMBOL(security_secmark_relabel_packet); | ||
1144 | |||
1145 | void security_secmark_refcount_inc(void) | ||
1146 | { | ||
1147 | security_ops->secmark_refcount_inc(); | ||
1148 | } | ||
1149 | EXPORT_SYMBOL(security_secmark_refcount_inc); | ||
1150 | |||
1151 | void security_secmark_refcount_dec(void) | ||
1152 | { | ||
1153 | security_ops->secmark_refcount_dec(); | ||
1154 | } | ||
1155 | EXPORT_SYMBOL(security_secmark_refcount_dec); | ||
1156 | |||
1148 | int security_tun_dev_create(void) | 1157 | int security_tun_dev_create(void) |
1149 | { | 1158 | { |
1150 | return security_ops->tun_dev_create(); | 1159 | return security_ops->tun_dev_create(); |