Skip to content

Commit

Permalink
LSM: SafeSetID: Stop releasing uninitialized ruleset
Browse files Browse the repository at this point in the history
The first time a rule set is configured for SafeSetID, we shouldn't be
trying to release the previously configured ruleset, since there isn't
one. Currently, the pointer that would point to a previously configured
ruleset is uninitialized on first rule set configuration, leading to a
crash when we try to call release_ruleset with that pointer.

Acked-by: Jann Horn <[email protected]>
Signed-off-by: Micah Morton <[email protected]>
  • Loading branch information
micah-morton committed Sep 17, 2019
1 parent 609488b commit 21ab858
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion security/safesetid/securityfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ static ssize_t handle_policy_update(struct file *file,
out_free_buf:
kfree(buf);
out_free_pol:
release_ruleset(pol);
if (pol)
release_ruleset(pol);
return err;
}

Expand Down

0 comments on commit 21ab858

Please sign in to comment.