]> git.proxmox.com Git - mirror_zfs-debian.git/blame - config/kernel-security-inode-init.m4
Move partition scanning from userspace to module.
[mirror_zfs-debian.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 #
8AC_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>
14 ],[
166dd49d
BB
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;
21
22 security_inode_init_security(ip, dip, str, &name, &value, &len);
5c03efc3
BB
23 ],[
24 AC_MSG_RESULT(yes)
25 AC_DEFINE(HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY, 1,
26 [security_inode_init_security wants 6 args])
27 ],[
28 AC_MSG_RESULT(no)
29 ])
30 EXTRA_KCFLAGS="$tmp_flags"
31])
166dd49d
BB
32
33dnl #
34dnl # 3.2 API change
35dnl # The security_inode_init_security() API has been changed to include
36dnl # a filesystem specific callback to write security extended attributes.
37dnl # This was done to support the initialization of multiple LSM xattrs
38dnl # and the EVM xattr.
39dnl #
40AC_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>
46 ],[
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;
51
52 security_inode_init_security(ip, dip, str, func, NULL);
53 ],[
54 AC_MSG_RESULT(yes)
55 AC_DEFINE(HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY, 1,
56 [security_inode_init_security wants callback])
57 ],[
58 AC_MSG_RESULT(no)
59 ])
60 EXTRA_KCFLAGS="$tmp_flags"
61])