]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-security-inode-init.m4
Perform KABI checks in parallel
[mirror_zfs.git] / config / kernel-security-inode-init.m4
CommitLineData
5c03efc3
BB
1dnl #
2dnl # 2.6.39 API change
3dnl # The security_inode_init_security() function now takes an additional
4dnl # qstr argument which must be passed in from the dentry if available.
5dnl # Passing a NULL is safe when no qstr is available the relevant
6dnl # security checks will just be skipped.
7dnl #
608f8749
BB
8AC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_6ARGS], [
9 ZFS_LINUX_TEST_SRC([security_inode_init_security_6args], [
5c03efc3
BB
10 #include <linux/security.h>
11 ],[
166dd49d
BB
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;
18
19 security_inode_init_security(ip, dip, str, &name, &value, &len);
608f8749
BB
20 ])
21])
22
23AC_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], [
5c03efc3
BB
26 AC_MSG_RESULT(yes)
27 AC_DEFINE(HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY, 1,
608f8749 28 [security_inode_init_security wants 6 args])
5c03efc3
BB
29 ],[
30 AC_MSG_RESULT(no)
31 ])
5c03efc3 32])
166dd49d
BB
33
34dnl #
35dnl # 3.2 API change
36dnl # The security_inode_init_security() API has been changed to include
37dnl # a filesystem specific callback to write security extended attributes.
38dnl # This was done to support the initialization of multiple LSM xattrs
39dnl # and the EVM xattr.
40dnl #
608f8749
BB
41AC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_CALLBACK], [
42 ZFS_LINUX_TEST_SRC([security_inode_init_security], [
166dd49d
BB
43 #include <linux/security.h>
44 ],[
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;
49
50 security_inode_init_security(ip, dip, str, func, NULL);
608f8749
BB
51 ])
52])
53
54AC_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], [
166dd49d
BB
57 AC_MSG_RESULT(yes)
58 AC_DEFINE(HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY, 1,
608f8749 59 [security_inode_init_security wants callback])
166dd49d
BB
60 ],[
61 AC_MSG_RESULT(no)
62 ])
166dd49d 63])
608f8749
BB
64
65AC_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
68])
69
70AC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE], [
71 ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_6ARGS
72 ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_CALLBACK
73])