summaryrefslogtreecommitdiffstats
path: root/config/kernel-mod-param.m4
diff options
context:
space:
mode:
authorGvozden Neskovic <[email protected]>2016-08-21 21:29:49 +0200
committerBrian Behlendorf <[email protected]>2016-08-22 10:05:45 -0700
commit9cc1844a1dab9cb62743f1f31eca73fcc6aaf0c4 (patch)
tree78cb3ecc12c5dc05ac1d522542ab152e989b3d4b /config/kernel-mod-param.m4
parent2bce8049c3d782f4feb72493564754c0595606bf (diff)
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 <[email protected]> Signed-off-by: Jason Zaman <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4997 Closes #5001
Diffstat (limited to 'config/kernel-mod-param.m4')
-rw-r--r--config/kernel-mod-param.m430
1 files changed, 30 insertions, 0 deletions
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 <linux/module.h>
+ #include <linux/moduleparam.h>
+
+ 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)
+ ])
+])