mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:09:29 +02:00
s390/crypto: Map EBUSY to EIO when key conversion fails repeatedly
When hardware persistently returns -EBUSY after exhausting retries,
the error propagates to crypto_finalize_*_request(). The crypto API's
completion wrapper treats -EBUSY as a queueing status and swallows it,
preventing the completion callback from firing. This causes callers
using crypto_wait_req() to block indefinitely.
Translate persistent -EBUSY to -EIO after retry exhaustion to ensure
proper error propagation and callback invocation.
Fixes: 6cd87cb5ef ("s390/crypto: Rework protected key AES for true asynch support")
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Cc: stable@vger.kernel.org # 6.16+
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
committed by
Vasily Gorbik
parent
ac14813201
commit
7a08507ea5
@@ -220,6 +220,10 @@ static inline int convert_key(const u8 *key, unsigned int keylen,
|
||||
xflags);
|
||||
}
|
||||
|
||||
/* But finally map -EBUSY to -EIO to indicate an IO failure */
|
||||
if (rc == -EBUSY)
|
||||
rc = -EIO;
|
||||
|
||||
out:
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
|
||||
@@ -341,6 +341,10 @@ static inline int convert_key(const u8 *key, unsigned int keylen,
|
||||
xflags);
|
||||
}
|
||||
|
||||
/* But finally map -EBUSY to -EIO to indicate an IO failure */
|
||||
if (rc == -EBUSY)
|
||||
rc = -EIO;
|
||||
|
||||
out:
|
||||
pr_debug("rc=%d\n", rc);
|
||||
return rc;
|
||||
|
||||
Reference in New Issue
Block a user