From: Rafal Krypa Date: Mon, 17 Sep 2012 13:38:30 +0000 (+0200) Subject: Smack: prevent revoke-subject from failing when unseen label is written to it X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91dfbb8a7c0dccbc14776dc2176a7794623610b2;p=sdk%2Femulator%2Femulator-kernel.git Smack: prevent revoke-subject from failing when unseen label is written to it commit d15d9fad16f6aa459cf4926a1d3aba36b004e9a2 upstream 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. Change-Id: I326e1fad79a99a48839de8c35abfe709391e0f30 Signed-off-by: Rafal Krypa Reviewed-on: http://165.213.202.130:8080/53903 Reviewed-by: Kyungmin Park Tested-by: Kyungmin Park --- diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 84d13e04d68c..952789b95cc0 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -2076,10 +2076,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;