Skip to content

This module doesn't compile on newer kernels anymore #2

@phantomcraft

Description

@phantomcraft

When I switched from kernel 5.4.20 to a more recent version, this error begun to happen:


user@localhost:/dev/shm/threefish_512/master$ make
make -C /lib/modules/5.10.0-3-amd64/build M=/dev/shm/threefish_512/master modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.0-3-amd64'
  CC [M]  /dev/shm/threefish_512/master/threefish512.o
/dev/shm/threefish_512/master/threefish512.c:2281:14: warning: ‘struct blkcipher_walk’ declared inside parameter list will not be visible outside of this definition or declaration
 2281 |       struct blkcipher_walk *walk)
      |              ^~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2280:51: warning: ‘struct blkcipher_desc’ declared inside parameter list will not be visible outside of this definition or declaration
 2280 | static unsigned int __threefish512_encrypt(struct blkcipher_desc *desc,
      |                                                   ^~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c: In function ‘__threefish512_encrypt’:
/dev/shm/threefish_512/master/threefish512.c:2283:54: error: implicit declaration of function ‘crypto_blkcipher_ctx’; did you mean ‘crypto_cipher_alg’? [-Werror=implicit-function-declaration]
 2283 |  struct threefish_key *ctx = (struct threefish_key *)crypto_blkcipher_ctx(desc->tfm);
      |                                                      ^~~~~~~~~~~~~~~~~~~~
      |                                                      crypto_cipher_alg
/dev/shm/threefish_512/master/threefish512.c:2283:79: error: invalid use of undefined type ‘struct blkcipher_desc’
 2283 |  struct threefish_key *ctx = (struct threefish_key *)crypto_blkcipher_ctx(desc->tfm);
      |                                                                               ^~
/dev/shm/threefish_512/master/threefish512.c:2285:28: error: invalid use of undefined type ‘struct blkcipher_walk’
 2285 |  unsigned int nbytes = walk->nbytes;
      |                            ^~
/dev/shm/threefish_512/master/threefish512.c:2286:24: error: invalid use of undefined type ‘struct blkcipher_walk’
 2286 |  u64 *src = (u64 *)walk->src.virt.addr;
      |                        ^~
/dev/shm/threefish_512/master/threefish512.c:2287:24: error: invalid use of undefined type ‘struct blkcipher_walk’
 2287 |  u64 *dst = (u64 *)walk->dst.virt.addr;
      |                        ^~
In file included from /usr/src/linux-headers-5.10.0-3-common/include/linux/swab.h:5,
                 from /usr/src/linux-headers-5.10.0-3-common/include/uapi/linux/byteorder/little_endian.h:13,
                 from /usr/src/linux-headers-5.10.0-3-common/include/linux/byteorder/little_endian.h:5,
                 from /usr/src/linux-headers-5.10.0-3-common/arch/x86/include/uapi/asm/byteorder.h:5,
                 from /usr/src/linux-headers-5.10.0-3-common/include/asm-generic/bitops/le.h:6,
                 from /usr/src/linux-headers-5.10.0-3-common/arch/x86/include/asm/bitops.h:395,
                 from /usr/src/linux-headers-5.10.0-3-common/include/linux/bitops.h:29,
                 from /usr/src/linux-headers-5.10.0-3-common/include/linux/kernel.h:12,
                 from /usr/src/linux-headers-5.10.0-3-common/include/linux/list.h:9,
                 from /usr/src/linux-headers-5.10.0-3-common/include/linux/module.h:12,
                 from /dev/shm/threefish_512/master/threefish512.c:22:
/dev/shm/threefish_512/master/threefish512.c:2288:38: error: invalid use of undefined type ‘struct blkcipher_walk’
 2288 |  u64 tweak = be64_to_cpu(*(u64 *)walk->iv);
      |                                      ^~
/usr/src/linux-headers-5.10.0-3-common/include/uapi/linux/swab.h:128:54: note: in definition of macro ‘__swab64’
  128 | #define __swab64(x) (__u64)__builtin_bswap64((__u64)(x))
      |                                                      ^
/usr/src/linux-headers-5.10.0-3-common/include/linux/byteorder/generic.h:93:21: note: in expansion of macro ‘__be64_to_cpu’
   93 | #define be64_to_cpu __be64_to_cpu
      |                     ^~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2288:14: note: in expansion of macro ‘be64_to_cpu’
 2288 |  u64 tweak = be64_to_cpu(*(u64 *)walk->iv);
      |              ^~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2297:14: error: invalid use of undefined type ‘struct blkcipher_walk’
 2297 |  *(u64 *)walk->iv=cpu_to_be64(tweak);
      |              ^~
/dev/shm/threefish_512/master/threefish512.c: At top level:
/dev/shm/threefish_512/master/threefish512.c:2301:44: warning: ‘struct blkcipher_desc’ declared inside parameter list will not be visible outside of this definition or declaration
 2301 | static int cra_threefish512_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
      |                                            ^~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c: In function ‘cra_threefish512_encrypt’:
/dev/shm/threefish_512/master/threefish512.c:2304:24: error: storage size of ‘walk’ isn’t known
 2304 |  struct blkcipher_walk walk;
      |                        ^~~~
/dev/shm/threefish_512/master/threefish512.c:2307:2: error: implicit declaration of function ‘blkcipher_walk_init’ [-Werror=implicit-function-declaration]
 2307 |  blkcipher_walk_init(&walk, dst, src, nbytes);
      |  ^~~~~~~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2308:8: error: implicit declaration of function ‘blkcipher_walk_virt’ [-Werror=implicit-function-declaration]
 2308 |  err = blkcipher_walk_virt(desc, &walk);
      |        ^~~~~~~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2311:35: error: passing argument 1 of ‘__threefish512_encrypt’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2311 |   nbytes = __threefish512_encrypt(desc, &walk);
      |                                   ^~~~
      |                                   |
      |                                   struct blkcipher_desc *
/dev/shm/threefish_512/master/threefish512.c:2280:67: note: expected ‘struct blkcipher_desc *’ but argument is of type ‘struct blkcipher_desc *’
 2280 | static unsigned int __threefish512_encrypt(struct blkcipher_desc *desc,
      |                                            ~~~~~~~~~~~~~~~~~~~~~~~^~~~
/dev/shm/threefish_512/master/threefish512.c:2312:9: error: implicit declaration of function ‘blkcipher_walk_done’ [-Werror=implicit-function-declaration]
 2312 |   err = blkcipher_walk_done(desc, &walk, nbytes);
      |         ^~~~~~~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2304:24: warning: unused variable ‘walk’ [-Wunused-variable]
 2304 |  struct blkcipher_walk walk;
      |                        ^~~~
/dev/shm/threefish_512/master/threefish512.c: At top level:
/dev/shm/threefish_512/master/threefish512.c:2319:14: warning: ‘struct blkcipher_walk’ declared inside parameter list will not be visible outside of this definition or declaration
 2319 |       struct blkcipher_walk *walk)
      |              ^~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2318:51: warning: ‘struct blkcipher_desc’ declared inside parameter list will not be visible outside of this definition or declaration
 2318 | static unsigned int __threefish512_decrypt(struct blkcipher_desc *desc,
      |                                                   ^~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c: In function ‘__threefish512_decrypt’:
/dev/shm/threefish_512/master/threefish512.c:2321:79: error: invalid use of undefined type ‘struct blkcipher_desc’
 2321 |  struct threefish_key *ctx = (struct threefish_key *)crypto_blkcipher_ctx(desc->tfm);
      |                                                                               ^~
/dev/shm/threefish_512/master/threefish512.c:2323:28: error: invalid use of undefined type ‘struct blkcipher_walk’
 2323 |  unsigned int nbytes = walk->nbytes;
      |                            ^~
/dev/shm/threefish_512/master/threefish512.c:2324:24: error: invalid use of undefined type ‘struct blkcipher_walk’
 2324 |  u64 *src = (u64 *)walk->src.virt.addr;
      |                        ^~
/dev/shm/threefish_512/master/threefish512.c:2325:24: error: invalid use of undefined type ‘struct blkcipher_walk’
 2325 |  u64 *dst = (u64 *)walk->dst.virt.addr;
      |                        ^~
In file included from /usr/src/linux-headers-5.10.0-3-common/include/linux/swab.h:5,
                 from /usr/src/linux-headers-5.10.0-3-common/include/uapi/linux/byteorder/little_endian.h:13,
                 from /usr/src/linux-headers-5.10.0-3-common/include/linux/byteorder/little_endian.h:5,
                 from /usr/src/linux-headers-5.10.0-3-common/arch/x86/include/uapi/asm/byteorder.h:5,
                 from /usr/src/linux-headers-5.10.0-3-common/include/asm-generic/bitops/le.h:6,
                 from /usr/src/linux-headers-5.10.0-3-common/arch/x86/include/asm/bitops.h:395,
                 from /usr/src/linux-headers-5.10.0-3-common/include/linux/bitops.h:29,
                 from /usr/src/linux-headers-5.10.0-3-common/include/linux/kernel.h:12,
                 from /usr/src/linux-headers-5.10.0-3-common/include/linux/list.h:9,
                 from /usr/src/linux-headers-5.10.0-3-common/include/linux/module.h:12,
                 from /dev/shm/threefish_512/master/threefish512.c:22:
/dev/shm/threefish_512/master/threefish512.c:2326:38: error: invalid use of undefined type ‘struct blkcipher_walk’
 2326 |  u64 tweak = be64_to_cpu(*(u64 *)walk->iv);
      |                                      ^~
/usr/src/linux-headers-5.10.0-3-common/include/uapi/linux/swab.h:128:54: note: in definition of macro ‘__swab64’
  128 | #define __swab64(x) (__u64)__builtin_bswap64((__u64)(x))
      |                                                      ^
/usr/src/linux-headers-5.10.0-3-common/include/linux/byteorder/generic.h:93:21: note: in expansion of macro ‘__be64_to_cpu’
   93 | #define be64_to_cpu __be64_to_cpu
      |                     ^~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2326:14: note: in expansion of macro ‘be64_to_cpu’
 2326 |  u64 tweak = be64_to_cpu(*(u64 *)walk->iv);
      |              ^~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2335:14: error: invalid use of undefined type ‘struct blkcipher_walk’
 2335 |  *(u64 *)walk->iv=cpu_to_be64(tweak);
      |              ^~
/dev/shm/threefish_512/master/threefish512.c: At top level:
/dev/shm/threefish_512/master/threefish512.c:2339:44: warning: ‘struct blkcipher_desc’ declared inside parameter list will not be visible outside of this definition or declaration
 2339 | static int cra_threefish512_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
      |                                            ^~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c: In function ‘cra_threefish512_decrypt’:
/dev/shm/threefish_512/master/threefish512.c:2342:24: error: storage size of ‘walk’ isn’t known
 2342 |  struct blkcipher_walk walk;
      |                        ^~~~
/dev/shm/threefish_512/master/threefish512.c:2349:35: error: passing argument 1 of ‘__threefish512_decrypt’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2349 |   nbytes = __threefish512_decrypt(desc, &walk);
      |                                   ^~~~
      |                                   |
      |                                   struct blkcipher_desc *
/dev/shm/threefish_512/master/threefish512.c:2318:67: note: expected ‘struct blkcipher_desc *’ but argument is of type ‘struct blkcipher_desc *’
 2318 | static unsigned int __threefish512_decrypt(struct blkcipher_desc *desc,
      |                                            ~~~~~~~~~~~~~~~~~~~~~~~^~~~
/dev/shm/threefish_512/master/threefish512.c:2342:24: warning: unused variable ‘walk’ [-Wunused-variable]
 2342 |  struct blkcipher_walk walk;
      |                        ^~~~
/dev/shm/threefish_512/master/threefish512.c: At top level:
/dev/shm/threefish_512/master/threefish512.c:2379:16: error: ‘CRYPTO_ALG_TYPE_BLKCIPHER’ undeclared here (not in a function); did you mean ‘CRYPTO_ALG_TYPE_AKCIPHER’?
 2379 |  .cra_flags  = CRYPTO_ALG_TYPE_BLKCIPHER,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                CRYPTO_ALG_TYPE_AKCIPHER
/dev/shm/threefish_512/master/threefish512.c:2383:16: error: ‘crypto_blkcipher_type’ undeclared here (not in a function); did you mean ‘crypto_cipher_tfm’?
 2383 |  .cra_type  = &crypto_blkcipher_type,
      |                ^~~~~~~~~~~~~~~~~~~~~
      |                crypto_cipher_tfm
/dev/shm/threefish_512/master/threefish512.c:2386:4: error: ‘union <anonymous>’ has no member named ‘blkcipher’; did you mean ‘cipher’?
 2386 |   .blkcipher = {
      |    ^~~~~~~~~
      |    cipher
/dev/shm/threefish_512/master/threefish512.c:2387:5: error: ‘struct cipher_alg’ has no member named ‘min_keysize’; did you mean ‘cia_min_keysize’?
 2387 |    .min_keysize = 64,
      |     ^~~~~~~~~~~
      |     cia_min_keysize
/dev/shm/threefish_512/master/threefish512.c:2388:5: error: ‘struct cipher_alg’ has no member named ‘max_keysize’; did you mean ‘cia_max_keysize’?
 2388 |    .max_keysize = 64,
      |     ^~~~~~~~~~~
      |     cia_max_keysize
/dev/shm/threefish_512/master/threefish512.c:2389:5: error: ‘struct cipher_alg’ has no member named ‘ivsize’
 2389 |    .ivsize  = 8,
      |     ^~~~~~
/dev/shm/threefish_512/master/threefish512.c:2389:15: warning: initialization of ‘int (*)(struct crypto_tfm *, const u8 *, unsigned int)’ {aka ‘int (*)(struct crypto_tfm *, const unsigned char *, unsigned int)’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 2389 |    .ivsize  = 8,
      |               ^
/dev/shm/threefish_512/master/threefish512.c:2389:15: note: (near initialization for ‘threefish_algs[0].cra_u.cipher.cia_setkey’)
/dev/shm/threefish_512/master/threefish512.c:2390:5: error: ‘struct cipher_alg’ has no member named ‘setkey’; did you mean ‘cia_setkey’?
 2390 |    .setkey  = cia_threefish512_setkey,
      |     ^~~~~~
      |     cia_setkey
/dev/shm/threefish_512/master/threefish512.c:2390:15: error: initialization of ‘void (*)(struct crypto_tfm *, u8 *, const u8 *)’ {aka ‘void (*)(struct crypto_tfm *, unsigned char *, const unsigned char *)’} from incompatible pointer type ‘int (*)(struct crypto_tfm *, const u8 *, unsigned int)’ {aka ‘int (*)(struct crypto_tfm *, const unsigned char *, unsigned int)’} [-Werror=incompatible-pointer-types]
 2390 |    .setkey  = cia_threefish512_setkey,
      |               ^~~~~~~~~~~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2390:15: note: (near initialization for ‘threefish_algs[0].cra_u.cipher.cia_encrypt’)
/dev/shm/threefish_512/master/threefish512.c:2391:5: error: ‘struct cipher_alg’ has no member named ‘encrypt’; did you mean ‘cia_encrypt’?
 2391 |    .encrypt = cra_threefish512_encrypt,
      |     ^~~~~~~
      |     cia_encrypt
/dev/shm/threefish_512/master/threefish512.c:2391:15: error: initialization of ‘void (*)(struct crypto_tfm *, u8 *, const u8 *)’ {aka ‘void (*)(struct crypto_tfm *, unsigned char *, const unsigned char *)’} from incompatible pointer type ‘int (*)(struct blkcipher_desc *, struct scatterlist *, struct scatterlist *, unsigned int)’ [-Werror=incompatible-pointer-types]
 2391 |    .encrypt = cra_threefish512_encrypt,
      |               ^~~~~~~~~~~~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2391:15: note: (near initialization for ‘threefish_algs[0].cra_u.cipher.cia_decrypt’)
/dev/shm/threefish_512/master/threefish512.c:2392:5: error: ‘struct cipher_alg’ has no member named ‘decrypt’; did you mean ‘cia_decrypt’?
 2392 |    .decrypt = cra_threefish512_decrypt,
      |     ^~~~~~~
      |     cia_decrypt
/dev/shm/threefish_512/master/threefish512.c:2392:15: warning: excess elements in struct initializer
 2392 |    .decrypt = cra_threefish512_decrypt,
      |               ^~~~~~~~~~~~~~~~~~~~~~~~
/dev/shm/threefish_512/master/threefish512.c:2392:15: note: (near initialization for ‘threefish_algs[0].cra_u.cipher’)
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-5.10.0-3-common/scripts/Makefile.build:284: /dev/shm/threefish_512/master/threefish512.o] Error 1
make[2]: *** [/usr/src/linux-headers-5.10.0-3-common/Makefile:1817: /dev/shm/threefish_512/master] Error 2
make[1]: *** [/usr/src/linux-headers-5.10.0-3-common/Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-3-amd64'
make: *** [Makefile:5: all] Error 2

Can you please fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions