From: Casey Schaufler Date: Thu, 19 Dec 2013 21:23:26 +0000 (-0800) Subject: Smack: change rule cap check X-Git-Tag: submit/tizen_common/20140905.094502~14^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0cd8ae728bc5635aae2a49e78f582b609faed50c;p=sdk%2Femulator%2Femulator-kernel.git 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 Change-Id: I473b1f610e0bc8f349babfac440b77e26fb1f073 Signed-off-by: Casey Schaufler --- diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index f5a6bb8e2828..3198cfe1dcc6 100644 --- a/security/smack/smackfs.c +++ b/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. */ - if (!capable(CAP_MAC_ADMIN)) + if (!smack_privileged(CAP_MAC_ADMIN)) return -EPERM; return smk_write_rules_list(file, buf, count, ppos, NULL, NULL,