sirlucjan / kernel-patches

Custom Linux kernel patches

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lrng-patches-v2 seems to have a conflict?

SveSop opened this issue · comments

Not sure if this is some sort of configuration error on my part, but updating 5.16.16 source with the newly posted lrng-patches-v2 patchset, and enabling the new "LRNG Implementation with SP800-90A/B/C compliance" config option i get this error when compiling:

drivers/char/lrng/lrng_es_irq.c:767:6: error: conflicting types for ‘add_interrupt_randomness’; have ‘void(int)’
  767 | void add_interrupt_randomness(int irq)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/char/lrng/lrng_es_irq.c:15:
./include/linux/random.h:38:13: note: previous declaration of ‘add_interrupt_randomness’ with type ‘void(int,  int)’
   38 | extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy;
      |             ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/linkage.h:7,
                 from ./include/linux/printk.h:8,
                 from ./include/asm-generic/bug.h:22,
                 from ./arch/x86/include/asm/bug.h:86,
                 from ./include/linux/bug.h:5,
                 from ./include/linux/mmdebug.h:5,
                 from ./include/linux/percpu.h:5,
                 from ./include/asm-generic/irq_regs.h:11,
                 from ./arch/x86/include/generated/asm/irq_regs.h:1,
                 from drivers/char/lrng/lrng_es_irq.c:10:
drivers/char/lrng/lrng_es_irq.c:805:15: error: conflicting types for ‘add_interrupt_randomness’; have ‘void(int)’
  805 | EXPORT_SYMBOL(add_interrupt_randomness);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/export.h:98:28: note: in definition of macro ‘___EXPORT_SYMBOL’
   98 |         extern typeof(sym) sym;                                                 \
      |                            ^~~
./include/linux/export.h:160:41: note: in expansion of macro ‘__EXPORT_SYMBOL’
  160 | #define _EXPORT_SYMBOL(sym, sec)        __EXPORT_SYMBOL(sym, sec, "")
      |                                         ^~~~~~~~~~~~~~~
./include/linux/export.h:163:41: note: in expansion of macro ‘_EXPORT_SYMBOL’
  163 | #define EXPORT_SYMBOL(sym)              _EXPORT_SYMBOL(sym, "")
      |                                         ^~~~~~~~~~~~~~
drivers/char/lrng/lrng_es_irq.c:805:1: note: in expansion of macro ‘EXPORT_SYMBOL’
  805 | EXPORT_SYMBOL(add_interrupt_randomness);
      | ^~~~~~~~~~~~~
In file included from drivers/char/lrng/lrng_es_irq.c:15:
./include/linux/random.h:38:13: note: previous declaration of ‘add_interrupt_randomness’ with type ‘void(int,  int)’
   38 | extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy;
      |             ^~~~~~~~~~~~~~~~~~~~~~~~
make[6]: *** [scripts/Makefile.build:287: drivers/char/lrng/lrng_es_irq.o] Error 1
make[5]: *** [scripts/Makefile.build:549: drivers/char/lrng] Error 2
make[4]: *** [scripts/Makefile.build:549: drivers/char] Error 2

Thoughts?

It looks like these patches will be compatible with 5.17. I will remove them from the 5.16 branch. Thanks for the report.

Or just try lrng-patches-v3. It looks like this commit should solve the problem.

Got a new error with v3:

drivers/char/lrng/lrng_proc.c:93:25: error: static declaration of ‘random_table’ follows non-static declaration
   93 | static struct ctl_table random_table[] = {
      |                         ^~~~~~~~~~~~
In file included from ./include/linux/key.h:17,
                 from ./include/linux/cred.h:13,
                 from ./include/linux/sched/signal.h:10,
                 from ./include/linux/rcuwait.h:6,
                 from ./include/linux/percpu-rwsem.h:7,
                 from ./include/linux/fs.h:33,
                 from ./include/linux/proc_fs.h:10,
                 from drivers/char/lrng/lrng_proc.c:9:
./include/linux/sysctl.h:210:25: note: previous declaration of ‘random_table’ with type ‘struct ctl_table[]’
  210 | extern struct ctl_table random_table[];
      |                         ^~~~~~~~~~~~
drivers/char/lrng/lrng_proc.c: In function ‘random_sysctls_init’:
drivers/char/lrng/lrng_proc.c:200:9: error: implicit declaration of function ‘register_sysctl_init’; did you mean ‘register_sysctl_paths’? [-Werror=implicit-function-declaration]
  200 |         register_sysctl_init("kernel/random", random_table);
      |         ^~~~~~~~~~~~~~~~~~~~
      |         register_sysctl_paths
cc1: some warnings being treated as errors
make[6]: *** [scripts/Makefile.build:287: drivers/char/lrng/lrng_proc.o] Error 1
make[5]: *** [scripts/Makefile.build:549: drivers/char/lrng] Error 2

So we drop lrng-patches-v2 and lrng-v3-patches. Thanks for the feedback.

In theory, this could be solved by porting a few more patches from upstream, but since 5.17 is coming out on Monday, I think it's better to wait. 5.17 contains quite a few changes and for the first time in a long time LRNG is NOT compatible with another kernel version. Frankly, I don't recall anything similar happening to LRNG before.