Skip to content

Commit

Permalink
s390/zcrypt: kernel oops at insmod of the z90crypt device driver
Browse files Browse the repository at this point in the history
Kernel oops caused by invalid parameter at TAPQ instruction:
On older systems where the QCI instruction is not available
all possible domains are probed via TAPQ instruction. The
range for the probe has been extended with the > 16 domain
support now leading to a possible specification exception
when this instruction is called for probing higher values
within the new range. This may happen during insmod and/or
ap bus reset only on machines without a QCI instruction (z10,
z196, z114), zEC12 and newer systems are not affected.
The fix modifies the domain checking function to limit the
allowed range if no QCI info is available.

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Harald Freudenberger authored and Martin Schwidefsky committed Dec 18, 2014
1 parent 44e8967 commit 099eae1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/s390/crypto/ap_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,9 +1163,13 @@ static inline int ap_test_config_card_id(unsigned int id)
*/
static inline int ap_test_config_domain(unsigned int domain)
{
if (!ap_configuration)
return 1;
return ap_test_config(ap_configuration->aqm, domain);
if (!ap_configuration) /* QCI not supported */
if (domain < 16)
return 1; /* then domains 0...15 are configured */
else
return 0;
else
return ap_test_config(ap_configuration->aqm, domain);
}

/**
Expand Down

0 comments on commit 099eae1

Please sign in to comment.