linux/drivers/s390
Harald Freudenberger 7f8209580c s390/zcrypt: do not retry administrative requests
commit af40322e90 upstream.

All kind of administrative requests should not been retried. Some card
firmware detects this and assumes a replay attack. This patch checks
on failure if the low level functions indicate a retry (EAGAIN) and
checks for the ADMIN flag set on the request message.  If this both
are true, the response code for this message is changed to EIO to make
sure the zcrypt API layer does not attempt to retry the request. As of
now the ADMIN flag is set for a request message when
- for EP11 the field 'flags' of the EP11 CPRB struct has the leftmost
  bit set.
- for CCA when the CPRB minor version is 'T3', 'T5', 'T6' or 'T7'.

Please note that the do-not-retry only applies to a request
which has been sent to the card (= has been successfully enqueued) but
the reply indicates some kind of failure and by default it would be
replied. It is totally fine to retry a request if a previous attempt
to enqueue the msg into the firmware queue had some kind of failure
and thus the card has never seen this request.

Reported-by: Frank Uhlig <Frank.Uhlig1@ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2023-07-23 13:53:59 +02:00
..
block s390/dasd: Use correct lock while counting channel queue length 2023-06-09 11:35:52 -06:00
char s390 updates for the 6.4 merge window 2023-04-30 11:43:31 -07:00
cio s390/cio: unregister device when the only path is gone 2023-05-22 12:45:44 +02:00
crypto s390/zcrypt: do not retry administrative requests 2023-07-23 13:53:59 +02:00
net s390/ism: Do not unregister clients with registered DMBs 2023-07-23 13:53:42 +02:00
scsi scsi: zfcp: Declare SCSI host template const 2023-03-24 19:19:20 -04:00
virtio virtio: add VIRTIO_F_NOTIFICATION_DATA feature support 2023-04-21 03:02:35 -04:00
Makefile s390: remove pointless drivers-y in drivers/s390/Makefile 2019-09-16 13:21:51 +02:00