mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 21:26:14 +01:00
tpm: Use -EPERM as fallback error code in tpm_ret_to_err
Using -EFAULT as the tpm_ret_to_err() fallback error code causes makes it incompatible on how trusted keys transmute TPM return codes. Change the fallback as -EPERM in order to gain compatibility with trusted keys. In addition, map TPM_RC_HASH to -EINVAL in order to be compatible with tpm2_seal_trusted() return values. Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@opinsys.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
This commit is contained in:
parent
faf07e611d
commit
7fcf459ac8
1 changed files with 3 additions and 1 deletions
|
|
@ -456,8 +456,10 @@ static inline ssize_t tpm_ret_to_err(ssize_t ret)
|
|||
return 0;
|
||||
case TPM2_RC_SESSION_MEMORY:
|
||||
return -ENOMEM;
|
||||
case TPM2_RC_HASH:
|
||||
return -EINVAL;
|
||||
default:
|
||||
return -EFAULT;
|
||||
return -EPERM;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue