Skip to content

Commit aab73d2

Browse files
hfreudeVasily Gorbik
authored andcommitted
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: efc598e ("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]>
1 parent bb6d3fb commit aab73d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/s390/crypto/pkey_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
994994
return -EFAULT;
995995
rc = cca_sec2protkey(ksp.cardnr, ksp.domain,
996996
ksp.seckey.seckey, ksp.protkey.protkey,
997-
NULL, &ksp.protkey.type);
997+
&ksp.protkey.len, &ksp.protkey.type);
998998
DEBUG_DBG("%s cca_sec2protkey()=%d\n", __func__, rc);
999999
if (rc)
10001000
break;

0 commit comments

Comments
 (0)