]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KEYS: trusted: Rollback init_trusted() consistently
authorJarkko Sakkinen <jarkko@kernel.org>
Tue, 10 Oct 2023 23:08:25 +0000 (02:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:56:30 +0000 (16:56 +0000)
commitf4f12667167c02a25cb182b3e18310894e7e5a6a
tree98a6e8c2639ba76914bb9e2990c526698ea71ae5
parentc407ff72fb3a46ee6ad41be0421b9384d00e58de
KEYS: trusted: Rollback init_trusted() consistently

commit 31de287345f41bbfaec36a5c8cbdba035cf76442 upstream.

Do bind neither static calls nor trusted_key_exit() before a successful
init, in order to maintain a consistent state. In addition, depart the
init_trusted() in the case of a real error (i.e. getting back something
else than -ENODEV).

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Closes: https://lore.kernel.org/linux-integrity/CAHk-=whOPoLaWM8S8GgoOPT7a2+nMH5h3TLKtn=R_3w4R1_Uvg@mail.gmail.com/
Cc: stable@vger.kernel.org # v5.13+
Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework")
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/keys/trusted-keys/trusted_core.c