010-Fix-module-loading-with-Linux-v5.0-rc5.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From f971e0cd4a0ebe59fb2e8e17240399bf6901b09b Mon Sep 17 00:00:00 2001
  2. From: "Derald D. Woods" <[email protected]>
  3. Date: Sun, 10 Feb 2019 13:22:19 -0600
  4. Subject: [PATCH] Fix module loading with Linux v5.0-rc5
  5. This commit fixes this module load error:
  6. [...]
  7. [ 29.112091] cryptodev: loading out-of-tree module taints kernel.
  8. [ 29.128906] cryptodev: Unknown symbol crypto_givcipher_type (err -2)
  9. [ 29.188842] cryptodev: Unknown symbol crypto_givcipher_type (err -2)
  10. modprobe: can't load module cryptodev (extra/cryptodev.ko): unknown symbol in module, or unknown parameter
  11. [...]
  12. Upstream Linux support for unused GIVCIPHER, and others, was dropped here:
  13. c79b411eaa72 (crypto: skcipher - remove remnants of internal IV generators)
  14. Signed-off-by: Derald D. Woods <[email protected]>
  15. ---
  16. cryptlib.c | 9 +++++++--
  17. 1 file changed, 7 insertions(+), 2 deletions(-)
  18. diff --git a/cryptlib.c b/cryptlib.c
  19. index 6e66698..4a87037 100644
  20. --- a/cryptlib.c
  21. +++ b/cryptlib.c
  22. @@ -38,7 +38,9 @@
  23. #include "cryptodev_int.h"
  24. #include "cipherapi.h"
  25. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
  26. extern const struct crypto_type crypto_givcipher_type;
  27. +#endif
  28. static void cryptodev_complete(struct crypto_async_request *req, int err)
  29. {
  30. @@ -157,8 +159,11 @@ int cryptodev_cipher_init(struct cipher_data *out, const char *alg_name,
  31. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
  32. tfm = crypto_skcipher_tfm(out->async.s);
  33. - if ((tfm->__crt_alg->cra_type == &crypto_ablkcipher_type) ||
  34. - (tfm->__crt_alg->cra_type == &crypto_givcipher_type)) {
  35. + if ((tfm->__crt_alg->cra_type == &crypto_ablkcipher_type)
  36. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
  37. + || (tfm->__crt_alg->cra_type == &crypto_givcipher_type)
  38. +#endif
  39. + ) {
  40. struct ablkcipher_alg *alg;
  41. alg = &tfm->__crt_alg->cra_ablkcipher;