diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/hooks.c | 3 | ||||
-rw-r--r-- | security/selinux/include/security.h | 5 | ||||
-rw-r--r-- | security/selinux/ss/services.c | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 3cf368a16448..d987048d3f33 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -101,6 +101,8 @@ static int __init selinux_enabled_setup(char *str) | |||
101 | return 1; | 101 | return 1; |
102 | } | 102 | } |
103 | __setup("selinux=", selinux_enabled_setup); | 103 | __setup("selinux=", selinux_enabled_setup); |
104 | #else | ||
105 | int selinux_enabled = 1; | ||
104 | #endif | 106 | #endif |
105 | 107 | ||
106 | /* Original (dummy) security module. */ | 108 | /* Original (dummy) security module. */ |
@@ -4535,6 +4537,7 @@ int selinux_disable(void) | |||
4535 | printk(KERN_INFO "SELinux: Disabled at runtime.\n"); | 4537 | printk(KERN_INFO "SELinux: Disabled at runtime.\n"); |
4536 | 4538 | ||
4537 | selinux_disabled = 1; | 4539 | selinux_disabled = 1; |
4540 | selinux_enabled = 0; | ||
4538 | 4541 | ||
4539 | /* Reset security_ops to the secondary module, dummy or capability. */ | 4542 | /* Reset security_ops to the secondary module, dummy or capability. */ |
4540 | security_ops = secondary_ops; | 4543 | security_ops = secondary_ops; |
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h index 5f016c98056f..063af47bb231 100644 --- a/security/selinux/include/security.h +++ b/security/selinux/include/security.h | |||
@@ -29,12 +29,7 @@ | |||
29 | #define POLICYDB_VERSION_MIN POLICYDB_VERSION_BASE | 29 | #define POLICYDB_VERSION_MIN POLICYDB_VERSION_BASE |
30 | #define POLICYDB_VERSION_MAX POLICYDB_VERSION_AVTAB | 30 | #define POLICYDB_VERSION_MAX POLICYDB_VERSION_AVTAB |
31 | 31 | ||
32 | #ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM | ||
33 | extern int selinux_enabled; | 32 | extern int selinux_enabled; |
34 | #else | ||
35 | #define selinux_enabled 1 | ||
36 | #endif | ||
37 | |||
38 | extern int selinux_mls_enabled; | 33 | extern int selinux_mls_enabled; |
39 | 34 | ||
40 | int security_load_policy(void * data, size_t len); | 35 | int security_load_policy(void * data, size_t len); |
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 7177e98df7f3..c284dbb8b8c0 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -594,6 +594,10 @@ int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len) | |||
594 | 594 | ||
595 | *scontext_len = strlen(initial_sid_to_string[sid]) + 1; | 595 | *scontext_len = strlen(initial_sid_to_string[sid]) + 1; |
596 | scontextp = kmalloc(*scontext_len,GFP_ATOMIC); | 596 | scontextp = kmalloc(*scontext_len,GFP_ATOMIC); |
597 | if (!scontextp) { | ||
598 | rc = -ENOMEM; | ||
599 | goto out; | ||
600 | } | ||
597 | strcpy(scontextp, initial_sid_to_string[sid]); | 601 | strcpy(scontextp, initial_sid_to_string[sid]); |
598 | *scontext = scontextp; | 602 | *scontext = scontextp; |
599 | goto out; | 603 | goto out; |