Smack: prevent revoke-subject from failing when unseen label is written to it
authorRafal Krypa <r.krypa@samsung.com>
Mon, 17 Sep 2012 13:38:30 +0000 (15:38 +0200)
committerKitae Kim <kt920.kim@samsung.com>
Tue, 21 May 2013 10:37:12 +0000 (19:37 +0900)
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 <r.krypa@samsung.com>
Reviewed-on: http://165.213.202.130:8080/53903
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Kyungmin Park <kyungmin.park@samsung.com>
security/smack/smackfs.c

index 84d13e04d68cd4ccba9ac735ede7913317da78f9..952789b95cc09f641b69bda63b936c7ee10dc345 100644 (file)
@@ -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;