From d15d9fad16f6aa459cf4926a1d3aba36b004e9a2 Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Tue, 27 Nov 2012 16:28:11 +0100 Subject: Smack: prevent revoke-subject from failing when unseen label is written to it Special file /smack/revoke-subject will silently accept labels that are not present on the subject label list. Nothing has to be done for such labels, as there are no rules for them to revoke. Targeted for git://git.gitorious.org/smack-next/kernel.git Signed-off-by: Rafal Krypa --- security/smack/smackfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'security/smack') diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 76a5dca46404..337e32c551da 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -2035,10 +2035,8 @@ static ssize_t smk_write_revoke_subj(struct file *file, const char __user *buf, } skp = smk_find_entry(cp); - if (skp == NULL) { - rc = -EINVAL; + if (skp == NULL) goto free_out; - } rule_list = &skp->smk_rules; rule_lock = &skp->smk_rules_lock; -- cgit v1.2.1