From 9cc1844a1dab9cb62743f1f31eca73fcc6aaf0c4 Mon Sep 17 00:00:00 2001 From: Gvozden Neskovic Date: Sun, 21 Aug 2016 21:29:49 +0200 Subject: Linux compat: Grsecurity kernel API Change: Module parameter set/get methods take const parameter in Grsecurity kernel v4.7.1 Signed-off-by: Gvozden Neskovic Signed-off-by: Jason Zaman Signed-off-by: Brian Behlendorf Closes #4997 Closes #5001 --- config/kernel-mod-param.m4 | 30 ++++++++++++++++++++++++++++++ config/kernel.m4 | 1 + 2 files changed, 31 insertions(+) create mode 100644 config/kernel-mod-param.m4 (limited to 'config') diff --git a/config/kernel-mod-param.m4 b/config/kernel-mod-param.m4 new file mode 100644 index 000000000..b72be684a --- /dev/null +++ b/config/kernel-mod-param.m4 @@ -0,0 +1,30 @@ +dnl # +dnl # Grsecurity kernel API change +dnl # constified parameters of module_param_call() methods +dnl # +AC_DEFUN([ZFS_AC_KERNEL_MODULE_PARAM_CALL_CONST], [ + AC_MSG_CHECKING([whether module_param_call() is hardened]) + ZFS_LINUX_TRY_COMPILE([ + #include + #include + + int param_get(char *b, const struct kernel_param *kp) + { + return (0); + } + + int param_set(const char *b, const struct kernel_param *kp) + { + return (0); + } + + module_param_call(p, param_set, param_get, NULL, 0644); + ],[ + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(MODULE_PARAM_CALL_CONST, 1, + [hardened module_param_call]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index d8964a7e1..798f3511b 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -101,6 +101,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_GENERIC_IO_ACCT ZFS_AC_KERNEL_FPU ZFS_AC_KERNEL_KUID_HELPERS + ZFS_AC_KERNEL_MODULE_PARAM_CALL_CONST AS_IF([test "$LINUX_OBJ" != "$LINUX"], [ KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" -- cgit v1.2.3