diff options
author | Harald Freudenberger <[email protected]> | 2020-01-31 12:08:31 +0100 |
---|---|---|
committer | Vasily Gorbik <[email protected]> | 2020-02-10 12:49:35 +0100 |
commit | aab73d278d49c718b722ff5052e16c9cddf144d4 (patch) | |
tree | e78352e7e8662c8847e8b05ab54330acff3f6d25 | |
parent | bb6d3fb354c5ee8d6bde2d576eb7220ea09862b9 (diff) |
s390/pkey: fix missing length of protected key on return
The pkey ioctl call PKEY_SEC2PROTK updates a struct pkey_protkey
on return. The protected key is stored in, the protected key type
is stored in but the len information was not updated. This patch
now fixes this and so the len field gets an update to refrect
the actual size of the protected key value returned.
Fixes: efc598e6c8a9 ("s390/zcrypt: move cca misc functions to new code file")
Cc: Stable <[email protected]>
Signed-off-by: Harald Freudenberger <[email protected]>
Reported-by: Christian Rund <[email protected]>
Suggested-by: Ingo Franzki <[email protected]>
Signed-off-by: Vasily Gorbik <[email protected]>
-rw-r--r-- | drivers/s390/crypto/pkey_api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/crypto/pkey_api.c b/drivers/s390/crypto/pkey_api.c index 71dae64ba994..2f33c5fcf676 100644 --- a/drivers/s390/crypto/pkey_api.c +++ b/drivers/s390/crypto/pkey_api.c @@ -994,7 +994,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd, return -EFAULT; rc = cca_sec2protkey(ksp.cardnr, ksp.domain, ksp.seckey.seckey, ksp.protkey.protkey, - NULL, &ksp.protkey.type); + &ksp.protkey.len, &ksp.protkey.type); DEBUG_DBG("%s cca_sec2protkey()=%d\n", __func__, rc); if (rc) break; |