Skip to content

Commit

Permalink
Smack: prevent revoke-subject from failing when unseen label is writt…
Browse files Browse the repository at this point in the history
…en 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 <[email protected]>
  • Loading branch information
rafal-krypa authored and cschaufler committed Mar 19, 2013
1 parent 921f3ac commit d15d9fa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions security/smack/smackfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d15d9fa

Please sign in to comment.