Commit 6ba4eba6 authored by Chris Wright's avatar Chris Wright Committed by Linus Torvalds

[PATCH] lsm: reduce noise during security_register

Registering a security module can be a noisy operation, esp. when it
retries registration with the primary module.  Eliminate some noise, and
distinguish the return values for register_security so a module can tell
the difference between failure modes.
Signed-off-by: default avatarChris Wright <chrisw@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d52dd365
......@@ -29,11 +29,8 @@ struct security_operations *security_ops; /* Initialized to NULL */
static inline int verify (struct security_operations *ops)
{
/* verify the security_operations structure exists */
if (!ops) {
printk (KERN_INFO "Passed a NULL security_operations "
"pointer, %s failed.\n", __FUNCTION__);
if (!ops)
return -EINVAL;
}
security_fixup_ops (ops);
return 0;
}
......@@ -85,16 +82,13 @@ int __init security_init(void)
int register_security (struct security_operations *ops)
{
if (verify (ops)) {
printk (KERN_INFO "%s could not verify "
printk(KERN_DEBUG "%s could not verify "
"security_operations structure.\n", __FUNCTION__);
return -EINVAL;
}
if (security_ops != &dummy_security_ops) {
printk (KERN_INFO "There is already a security "
"framework initialized, %s failed.\n", __FUNCTION__);
return -EINVAL;
}
if (security_ops != &dummy_security_ops)
return -EAGAIN;
security_ops = ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment