diff options
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(); |