summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/kernel-security-inode-init.m424
-rw-r--r--config/kernel.m41
2 files changed, 25 insertions, 0 deletions
diff --git a/config/kernel-security-inode-init.m4 b/config/kernel-security-inode-init.m4
new file mode 100644
index 000000000..a26de9fd6
--- /dev/null
+++ b/config/kernel-security-inode-init.m4
@@ -0,0 +1,24 @@
+dnl #
+dnl # 2.6.39 API change
+dnl # The security_inode_init_security() function now takes an additional
+dnl # qstr argument which must be passed in from the dentry if available.
+dnl # Passing a NULL is safe when no qstr is available the relevant
+dnl # security checks will just be skipped.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [
+ AC_MSG_CHECKING([whether security_inode_init_security wants 6 args])
+ tmp_flags="$EXTRA_KCFLAGS"
+ EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/security.h>
+ ],[
+ security_inode_init_security(NULL,NULL,NULL,NULL,NULL,NULL);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY, 1,
+ [security_inode_init_security wants 6 args])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ EXTRA_KCFLAGS="$tmp_flags"
+])
diff --git a/config/kernel.m4 b/config/kernel.m4
index 67f6bc5d3..8c4b06ac4 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -38,6 +38,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_D_OBTAIN_ALIAS
ZFS_AC_KERNEL_CHECK_DISK_SIZE_CHANGE
ZFS_AC_KERNEL_TRUNCATE_SETSIZE
+ ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY
if test "$LINUX_OBJ" != "$LINUX"; then
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"