LSM: SafeSetID: Stop releasing uninitialized ruleset
Subsystems (2)
[email protected]
maintainerPATCH 1/1 LSM: SafeSetID: Stop releasing uninitialized ruleset
From: Micah Morton <[email protected]>
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]>
--- security/safesetid/securityfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
security/safesetid/securityfs.c +2 -1
@@ -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; }
Signature · 1 line
2.23.0.237.gc6a4ce50a0-goog