Commit 083beff0 authored by Felix Beck's avatar Felix Beck Committed by Greg Kroah-Hartman

zcrypt: Do not remove coprocessor for error 8/72

commit 19b123eb upstream.

In a case where the number of the input data is bigger than the
modulus of the key, the coprocessor adapters will report an 8/72
error. This case is not caught yet, thus the adapter will be taken
offline. To prevent this, we return an -EINVAL instead.
Signed-off-by: default avatarFelix Beck <felix.beck@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 63693ee8
...@@ -373,6 +373,8 @@ static int convert_type86(struct zcrypt_device *zdev, ...@@ -373,6 +373,8 @@ static int convert_type86(struct zcrypt_device *zdev,
zdev->max_mod_size = PCICC_MAX_MOD_SIZE_OLD; zdev->max_mod_size = PCICC_MAX_MOD_SIZE_OLD;
return -EAGAIN; return -EAGAIN;
} }
if (service_rc == 8 && service_rs == 72)
return -EINVAL;
zdev->online = 0; zdev->online = 0;
return -EAGAIN; /* repeat the request on a different device. */ return -EAGAIN; /* repeat the request on a different device. */
} }
......
...@@ -462,6 +462,8 @@ static int convert_type86_ica(struct zcrypt_device *zdev, ...@@ -462,6 +462,8 @@ static int convert_type86_ica(struct zcrypt_device *zdev,
} }
if (service_rc == 12 && service_rs == 769) if (service_rc == 12 && service_rs == 769)
return -EINVAL; return -EINVAL;
if (service_rc == 8 && service_rs == 72)
return -EINVAL;
zdev->online = 0; zdev->online = 0;
return -EAGAIN; /* repeat the request on a different device. */ return -EAGAIN; /* repeat the request on a different device. */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment