Skip to content

Commit

Permalink
s390/crypto: remove retry loop with sleep from PAES pkey invocation
Browse files Browse the repository at this point in the history
Upon calling the pkey module to (re-)derive an protected
key from a secure key the PAES implementation did a retry
3 times with an 1000 ms sleep after each failure. This
patch removes this retry loop - retries should be done
if needed in a lower layer but the consumer of the pkey
module functions should not be bothered with retries.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
  • Loading branch information
Harald Freudenberger authored and Heiko Carstens committed Mar 7, 2024
1 parent 5dabfec commit ed6776c
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions arch/s390/crypto/paes_s390.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,8 @@ struct s390_pxts_ctx {
static inline int __paes_keyblob2pkey(struct key_blob *kb,
struct pkey_protkey *pk)
{
int i, ret;

/* try three times in case of failure */
for (i = 0; i < 3; i++) {
if (i > 0 && ret == -EAGAIN && in_task())
if (msleep_interruptible(1000))
return -EINTR;
ret = pkey_keyblob2pkey(kb->key, kb->keylen,
pk->protkey, &pk->len, &pk->type);
if (ret == 0)
break;
}

return ret;
return pkey_keyblob2pkey(kb->key, kb->keylen,
pk->protkey, &pk->len, &pk->type);
}

static inline int __paes_convert_key(struct s390_paes_ctx *ctx)
Expand Down

0 comments on commit ed6776c

Please sign in to comment.