]> git.dujemihanovic.xyz Git - linux.git/commit
s390/paes: Reestablish retry loop in paes
authorHarald Freudenberger <freude@linux.ibm.com>
Thu, 25 Apr 2024 14:29:48 +0000 (16:29 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Wed, 1 May 2024 09:52:54 +0000 (11:52 +0200)
commit7bbe449d0bdb68892cc67e9f5f1bfa106a3588d5
treea616fa35db511d26a52e03e0a3f538cb43dba97c
parentda5658320bc962634c36ece6052c5a543493e3cf
s390/paes: Reestablish retry loop in paes

With commit ed6776c96c60 ("s390/crypto: remove retry
loop with sleep from PAES pkey invocation") the retry
loop to retry derivation of a protected key from a
secure key has been removed. This was based on the
assumption that theses retries are not needed any
more as proper retries are done in the zcrypt layer.

However, tests have revealed that there exist some
cases with master key change in the HSM and immediately
(< 1 second) attempt to derive a protected key from a
secure key with exact this HSM may eventually fail.

The low level functions in zcrypt_ccamisc.c and
zcrypt_ep11misc.c detect and report this temporary
failure and report it to the caller as -EBUSY. The
re-established retry loop in the paes implementation
catches exactly this -EBUSY and eventually may run
some retries.

Fixes: ed6776c96c60 ("s390/crypto: remove retry loop with sleep from PAES pkey invocation")
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/crypto/paes_s390.c