s390/crypto: Fix kernel crash on aes_s390 module remove.
authorHarald Freudenberger <freude@linux.vnet.ibm.com>
Thu, 1 Mar 2018 15:40:00 +0000 (16:40 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 19 Mar 2018 06:02:05 +0000 (23:02 -0700)
commitc7260ca335a09fb186885c80bd6022318c10c541
tree4fb3fff6dc73c723a785ebbd80be373ad6ed076d
parentc9f52c2ddb285738219ff2231a96ba3c8f5bd746
s390/crypto: Fix kernel crash on aes_s390 module remove.

A kernel crash occurs when the aes_s390 kernel module is
removed on machines < z14. This only happens on kernel
version 4.15 and higher on machines not supporting MSA 8.

The reason for the crash is a unconditional
crypto_unregister_aead() invocation where no previous
crypto_register_aead() had been called. The fix now
remembers if there has been a successful registration and
only then calls the unregister function upon kernel module
remove.

The code now crashing has been introduced with
"bf7fa03 s390/crypto: add s390 platform specific aes gcm support."

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/crypto/aes_s390.c