• Harald Freudenberger's avatar
    s390/paes: Reestablish retry loop in paes · 7bbe449d
    Harald Freudenberger authored
    With commit ed6776c9 ("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: ed6776c9 ("s390/crypto: remove retry loop with sleep from PAES pkey invocation")
    Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
    Reviewed-by: default avatarIngo Franzki <ifranzki@linux.ibm.com>
    Reviewed-by: default avatarHolger Dengler <dengler@linux.ibm.com>
    Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
    7bbe449d
paes_s390.c 20.4 KB