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_SRC_SECURITY_INODE_INIT_SECURITY_6ARGS], [
9 ZFS_LINUX_TEST_SRC([security_inode_init_security_6args], [
10 #include <linux/security.h>
12 struct inode *ip __attribute__ ((unused)) = NULL;
13 struct inode *dip __attribute__ ((unused)) = NULL;
14 const struct qstr *str __attribute__ ((unused)) = NULL;
15 char *name __attribute__ ((unused)) = NULL;
16 void *value __attribute__ ((unused)) = NULL;
17 size_t len __attribute__ ((unused)) = 0;
19 security_inode_init_security(ip, dip, str, &name, &value, &len);
23 AC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_6ARGS], [
24 AC_MSG_CHECKING([whether security_inode_init_security wants 6 args])
25 ZFS_LINUX_TEST_RESULT([security_inode_init_security_6args], [
27 AC_DEFINE(HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY, 1,
28 [security_inode_init_security wants 6 args])
36 dnl # The security_inode_init_security() API has been changed to include
37 dnl # a filesystem specific callback to write security extended attributes.
38 dnl # This was done to support the initialization of multiple LSM xattrs
39 dnl # and the EVM xattr.
41 AC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_CALLBACK], [
42 ZFS_LINUX_TEST_SRC([security_inode_init_security], [
43 #include <linux/security.h>
45 struct inode *ip __attribute__ ((unused)) = NULL;
46 struct inode *dip __attribute__ ((unused)) = NULL;
47 const struct qstr *str __attribute__ ((unused)) = NULL;
48 initxattrs func __attribute__ ((unused)) = NULL;
50 security_inode_init_security(ip, dip, str, func, NULL);
54 AC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_CALLBACK], [
55 AC_MSG_CHECKING([whether security_inode_init_security wants callback])
56 ZFS_LINUX_TEST_RESULT([security_inode_init_security], [
58 AC_DEFINE(HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY, 1,
59 [security_inode_init_security wants callback])
65 AC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE], [
66 ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_6ARGS
67 ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_CALLBACK
70 AC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE], [
71 ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_6ARGS
72 ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_CALLBACK