diff options
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 76af95fa741a..9bc12bcddc2c 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -5884,7 +5884,7 @@ static int selinux_setprocattr(const char *name, void *value, size_t size) | |||
5884 | return error; | 5884 | return error; |
5885 | 5885 | ||
5886 | /* Obtain a SID for the context, if one was specified. */ | 5886 | /* Obtain a SID for the context, if one was specified. */ |
5887 | if (size && str[1] && str[1] != '\n') { | 5887 | if (size && str[0] && str[0] != '\n') { |
5888 | if (str[size-1] == '\n') { | 5888 | if (str[size-1] == '\n') { |
5889 | str[size-1] = 0; | 5889 | str[size-1] = 0; |
5890 | size--; | 5890 | size--; |
@@ -6346,7 +6346,7 @@ static __init int selinux_init(void) | |||
6346 | 0, SLAB_PANIC, NULL); | 6346 | 0, SLAB_PANIC, NULL); |
6347 | avc_init(); | 6347 | avc_init(); |
6348 | 6348 | ||
6349 | security_add_hooks(selinux_hooks, ARRAY_SIZE(selinux_hooks)); | 6349 | security_add_hooks(selinux_hooks, ARRAY_SIZE(selinux_hooks), "selinux"); |
6350 | 6350 | ||
6351 | if (avc_add_callback(selinux_netcache_avc_callback, AVC_CALLBACK_RESET)) | 6351 | if (avc_add_callback(selinux_netcache_avc_callback, AVC_CALLBACK_RESET)) |
6352 | panic("SELinux: Unable to register AVC netcache callback\n"); | 6352 | panic("SELinux: Unable to register AVC netcache callback\n"); |