Change fake_fips for linux 6.4 changes

Closes #27345

Signed-off-by: rmartinc <rmartinc@redhat.com>
This commit is contained in:
rmartinc 2024-02-28 12:45:19 +01:00 committed by Alexander Schwartz
parent 941e7cc3a5
commit a3f91ef95b

View file

@ -22,6 +22,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/sysctl.h> #include <linux/sysctl.h>
#include <linux/version.h>
int fips_enabled = 1; int fips_enabled = 1;
@ -39,7 +40,9 @@ static struct ctl_table crypto_dir_table[] = {
{ {
.procname = "crypto", .procname = "crypto",
.mode = 0555, .mode = 0555,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
.child = crypto_sysctl_table .child = crypto_sysctl_table
#endif
}, },
{} {}
}; };
@ -48,7 +51,11 @@ static struct ctl_table_header *crypto_sysctls;
static void crypto_proc_fips_init(void) static void crypto_proc_fips_init(void)
{ {
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
crypto_sysctls = register_sysctl_table(crypto_dir_table); crypto_sysctls = register_sysctl_table(crypto_dir_table);
#else
crypto_sysctls = register_sysctl(crypto_dir_table->procname, crypto_sysctl_table);
#endif
} }
static void crypto_proc_fips_exit(void) static void crypto_proc_fips_exit(void)