Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54031109 authored by Jesper Juhl's avatar Jesper Juhl Committed by James Morris
Browse files

trusted keys: Fix a memory leak in trusted_update().



One failure path in security/keys/trusted.c::trusted_update() does
not free 'new_p' while the others do. This patch makes sure we also free
it in the remaining path (if datablob_parse() returns different from
Opt_update).

Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 7f3c68be
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1032,6 +1032,7 @@ static int trusted_update(struct key *key, const void *data, size_t datalen)
	ret = datablob_parse(datablob, new_p, new_o);
	if (ret != Opt_update) {
		ret = -EINVAL;
		kfree(new_p);
		goto out;
	}
	/* copy old key values, and reseal with new pcrs */