Browse Source

Smack: change rule cap check

smk_write_change_rule() is calling capable rather than
the more correct smack_privileged(). This allows for setting
rules in violation of the onlycap facility. This is the
simple repair.

Targeted for git://git.gitorious.org/smack-next/kernel.git

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Casey Schaufler 11 years ago
parent
commit
4afde48be8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      security/smack/smackfs.c

+ 1 - 1
security/smack/smackfs.c

@@ -2152,7 +2152,7 @@ static ssize_t smk_write_change_rule(struct file *file, const char __user *buf,
 	/*
 	/*
 	 * Must have privilege.
 	 * Must have privilege.
 	 */
 	 */
-	if (!capable(CAP_MAC_ADMIN))
+	if (!smack_privileged(CAP_MAC_ADMIN))
 		return -EPERM;
 		return -EPERM;
 
 
 	return smk_write_rules_list(file, buf, count, ppos, NULL, NULL,
 	return smk_write_rules_list(file, buf, count, ppos, NULL, NULL,