Skip to content

Commit 92f5bec

Browse files
holger-denglerSasha Levin
authored and
Sasha Levin
committed
s390/pkey: Wipe sensitive data on failure
[ Upstream commit 1d8c270 ] Wipe sensitive data from stack also if the copy_to_user() fails. Suggested-by: Heiko Carstens <[email protected]> Reviewed-by: Harald Freudenberger <[email protected]> Reviewed-by: Ingo Franzki <[email protected]> Acked-by: Heiko Carstens <[email protected]> Signed-off-by: Holger Dengler <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 6dbcd06 commit 92f5bec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/s390/crypto/pkey_api.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
11911191
if (rc)
11921192
break;
11931193
if (copy_to_user(ucs, &kcs, sizeof(kcs)))
1194-
return -EFAULT;
1194+
rc = -EFAULT;
11951195
memzero_explicit(&kcs, sizeof(kcs));
11961196
break;
11971197
}
@@ -1223,7 +1223,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
12231223
if (rc)
12241224
break;
12251225
if (copy_to_user(ucp, &kcp, sizeof(kcp)))
1226-
return -EFAULT;
1226+
rc = -EFAULT;
12271227
memzero_explicit(&kcp, sizeof(kcp));
12281228
break;
12291229
}

0 commit comments

Comments
 (0)