]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - config/kernel-mod-param.m4
Vendor import of openzfs master @ 184df27eef0abdc7ab2105b21257f753834b936b
[FreeBSD/FreeBSD.git] / config / kernel-mod-param.m4
1 dnl #
2 dnl # Grsecurity kernel API change
3 dnl # constified parameters of module_param_call() methods
4 dnl #
5 AC_DEFUN([ZFS_AC_KERNEL_SRC_MODULE_PARAM_CALL_CONST], [
6         ZFS_LINUX_TEST_SRC([module_param_call], [
7                 #include <linux/module.h>
8                 #include <linux/moduleparam.h>
9
10                 int param_get(char *b, const struct kernel_param *kp)
11                 {
12                         return (0);
13                 }
14
15                 int param_set(const char *b, const struct kernel_param *kp)
16                 {
17                         return (0);
18                 }
19
20                 module_param_call(p, param_set, param_get, NULL, 0644);
21         ],[])
22 ])
23
24 AC_DEFUN([ZFS_AC_KERNEL_MODULE_PARAM_CALL_CONST], [
25         AC_MSG_CHECKING([whether module_param_call() is hardened])
26         ZFS_LINUX_TEST_RESULT([module_param_call], [
27                 AC_MSG_RESULT(yes)
28                 AC_DEFINE(MODULE_PARAM_CALL_CONST, 1,
29                     [hardened module_param_call])
30         ],[
31                 AC_MSG_RESULT(no)
32         ])
33 ])