Skip to content

Commit f971e0c

Browse files
woodstscristian-stoica
authored andcommitted
Fix module loading with Linux v5.0-rc5
This commit fixes this module load error: [...] [ 29.112091] cryptodev: loading out-of-tree module taints kernel. [ 29.128906] cryptodev: Unknown symbol crypto_givcipher_type (err -2) [ 29.188842] cryptodev: Unknown symbol crypto_givcipher_type (err -2) modprobe: can't load module cryptodev (extra/cryptodev.ko): unknown symbol in module, or unknown parameter [...] Upstream Linux support for unused GIVCIPHER, and others, was dropped here: c79b411eaa72 (crypto: skcipher - remove remnants of internal IV generators) Signed-off-by: Derald D. Woods <[email protected]>
1 parent fd8b15e commit f971e0c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

cryptlib.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
#include "cryptodev_int.h"
3939
#include "cipherapi.h"
4040

41+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
4142
extern const struct crypto_type crypto_givcipher_type;
43+
#endif
4244

4345
static void cryptodev_complete(struct crypto_async_request *req, int err)
4446
{
@@ -157,8 +159,11 @@ int cryptodev_cipher_init(struct cipher_data *out, const char *alg_name,
157159

158160
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
159161
tfm = crypto_skcipher_tfm(out->async.s);
160-
if ((tfm->__crt_alg->cra_type == &crypto_ablkcipher_type) ||
161-
(tfm->__crt_alg->cra_type == &crypto_givcipher_type)) {
162+
if ((tfm->__crt_alg->cra_type == &crypto_ablkcipher_type)
163+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
164+
|| (tfm->__crt_alg->cra_type == &crypto_givcipher_type)
165+
#endif
166+
) {
162167
struct ablkcipher_alg *alg;
163168

164169
alg = &tfm->__crt_alg->cra_ablkcipher;

0 commit comments

Comments
 (0)