Skip to content

Commit e68368a

Browse files
Gilad Ben-Yossefherbertx
authored andcommitted
crypto: asymmetric_keys - handle EBUSY due to backlog correctly
public_key_verify_signature() was passing the CRYPTO_TFM_REQ_MAY_BACKLOG flag to akcipher_request_set_callback() but was not handling correctly the case where a -EBUSY error could be returned from the call to crypto_akcipher_verify() if backlog was used, possibly casuing data corruption due to use-after-free of buffers. Resolve this by handling -EBUSY correctly. Signed-off-by: Gilad Ben-Yossef <[email protected]> CC: [email protected] Signed-off-by: Herbert Xu <[email protected]>
1 parent 9933e11 commit e68368a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/asymmetric_keys/public_key.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ int public_key_verify_signature(const struct public_key *pkey,
141141
* signature and returns that to us.
142142
*/
143143
ret = crypto_akcipher_verify(req);
144-
if (ret == -EINPROGRESS) {
144+
if ((ret == -EINPROGRESS) || (ret == -EBUSY)) {
145145
wait_for_completion(&compl.completion);
146146
ret = compl.err;
147147
}

0 commit comments

Comments
 (0)