aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-07-10 04:02:07 -0400
committerJames Morris <jmorris@namei.org>2008-07-14 01:04:06 -0400
commit6f0f0fd496333777d53daff21a4e3b28c4d03a6d (patch)
tree202de67376fce2547b44ae5b016d6424c3c7409c /security/selinux/hooks.c
parent93cbace7a058bce7f99319ef6ceff4b78cf45051 (diff)
security: remove register_security hook
The register security hook is no longer required, as the capability module is always registered. LSMs wishing to stack capability as a secondary module should do so explicitly. Signed-off-by: James Morris <jmorris@namei.org> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 745a69e74e38..91200feb3f9c 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -126,13 +126,11 @@ __setup("selinux=", selinux_enabled_setup);
126int selinux_enabled = 1; 126int selinux_enabled = 1;
127#endif 127#endif
128 128
129/* Original (dummy) security module. */
130static struct security_operations *original_ops;
131 129
132/* Minimal support for a secondary security module, 130/*
133 just to allow the use of the dummy or capability modules. 131 * Minimal support for a secondary security module,
134 The owlsm module can alternatively be used as a secondary 132 * just to allow the use of the capability module.
135 module as long as CONFIG_OWLSM_FD is not enabled. */ 133 */
136static struct security_operations *secondary_ops; 134static struct security_operations *secondary_ops;
137 135
138/* Lists of inode and superblock security structures initialized 136/* Lists of inode and superblock security structures initialized
@@ -5115,24 +5113,6 @@ static void selinux_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid)
5115 *secid = isec->sid; 5113 *secid = isec->sid;
5116} 5114}
5117 5115
5118/* module stacking operations */
5119static int selinux_register_security(const char *name, struct security_operations *ops)
5120{
5121 if (secondary_ops != original_ops) {
5122 printk(KERN_ERR "%s: There is already a secondary security "
5123 "module registered.\n", __func__);
5124 return -EINVAL;
5125 }
5126
5127 secondary_ops = ops;
5128
5129 printk(KERN_INFO "%s: Registering secondary module %s\n",
5130 __func__,
5131 name);
5132
5133 return 0;
5134}
5135
5136static void selinux_d_instantiate(struct dentry *dentry, struct inode *inode) 5116static void selinux_d_instantiate(struct dentry *dentry, struct inode *inode)
5137{ 5117{
5138 if (inode) 5118 if (inode)
@@ -5517,8 +5497,6 @@ static struct security_operations selinux_ops = {
5517 .sem_semctl = selinux_sem_semctl, 5497 .sem_semctl = selinux_sem_semctl,
5518 .sem_semop = selinux_sem_semop, 5498 .sem_semop = selinux_sem_semop,
5519 5499
5520 .register_security = selinux_register_security,
5521
5522 .d_instantiate = selinux_d_instantiate, 5500 .d_instantiate = selinux_d_instantiate,
5523 5501
5524 .getprocattr = selinux_getprocattr, 5502 .getprocattr = selinux_getprocattr,
@@ -5612,7 +5590,7 @@ static __init int selinux_init(void)
5612 0, SLAB_PANIC, NULL); 5590 0, SLAB_PANIC, NULL);
5613 avc_init(); 5591 avc_init();
5614 5592
5615 original_ops = secondary_ops = security_ops; 5593 secondary_ops = security_ops;
5616 if (!secondary_ops) 5594 if (!secondary_ops)
5617 panic("SELinux: No initial security operations\n"); 5595 panic("SELinux: No initial security operations\n");
5618 if (register_security(&selinux_ops)) 5596 if (register_security(&selinux_ops))