2 dnl # 2.6.39 API change
3 dnl # The security_inode_init_security() function now takes an additional
4 dnl # qstr argument which must be passed in from the dentry if available.
5 dnl # Passing a NULL is safe when no qstr is available the relevant
6 dnl # security checks will just be skipped.
8 AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [
9 AC_MSG_CHECKING([whether security_inode_init_security wants 6 args])
10 tmp_flags="$EXTRA_KCFLAGS"
11 EXTRA_KCFLAGS="-Werror"
12 ZFS_LINUX_TRY_COMPILE([
13 #include <linux/security.h>
15 struct inode *ip __attribute__ ((unused)) = NULL;
16 struct inode *dip __attribute__ ((unused)) = NULL;
17 const struct qstr *str __attribute__ ((unused)) = NULL;
18 char *name __attribute__ ((unused)) = NULL;
19 void *value __attribute__ ((unused)) = NULL;
20 size_t len __attribute__ ((unused)) = 0;
22 security_inode_init_security(ip, dip, str, &name, &value, &len);
25 AC_DEFINE(HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY, 1,
26 [security_inode_init_security wants 6 args])
30 EXTRA_KCFLAGS="$tmp_flags"
35 dnl # The security_inode_init_security() API has been changed to include
36 dnl # a filesystem specific callback to write security extended attributes.
37 dnl # This was done to support the initialization of multiple LSM xattrs
38 dnl # and the EVM xattr.
40 AC_DEFUN([ZFS_AC_KERNEL_CALLBACK_SECURITY_INODE_INIT_SECURITY], [
41 AC_MSG_CHECKING([whether security_inode_init_security wants callback])
42 tmp_flags="$EXTRA_KCFLAGS"
43 EXTRA_KCFLAGS="-Werror"
44 ZFS_LINUX_TRY_COMPILE([
45 #include <linux/security.h>
47 struct inode *ip __attribute__ ((unused)) = NULL;
48 struct inode *dip __attribute__ ((unused)) = NULL;
49 const struct qstr *str __attribute__ ((unused)) = NULL;
50 initxattrs func __attribute__ ((unused)) = NULL;
52 security_inode_init_security(ip, dip, str, func, NULL);
55 AC_DEFINE(HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY, 1,
56 [security_inode_init_security wants callback])
60 EXTRA_KCFLAGS="$tmp_flags"