xref: /freebsd-src/sys/contrib/openzfs/config/kernel-security-inode-init.m4 (revision e25152834cdf3b353892835a4f3b157e066a8ed4)
1*eda14cbcSMatt Macydnl #
2*eda14cbcSMatt Macydnl # 3.2 API change
3*eda14cbcSMatt Macydnl # The security_inode_init_security() API has been changed to include
4*eda14cbcSMatt Macydnl # a filesystem specific callback to write security extended attributes.
5*eda14cbcSMatt Macydnl # This was done to support the initialization of multiple LSM xattrs
6*eda14cbcSMatt Macydnl # and the EVM xattr.
7*eda14cbcSMatt Macydnl #
8*eda14cbcSMatt MacyAC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_CALLBACK], [
9*eda14cbcSMatt Macy	ZFS_LINUX_TEST_SRC([security_inode_init_security], [
10*eda14cbcSMatt Macy		#include <linux/security.h>
11*eda14cbcSMatt Macy	],[
12*eda14cbcSMatt Macy		struct inode *ip __attribute__ ((unused)) = NULL;
13*eda14cbcSMatt Macy		struct inode *dip __attribute__ ((unused)) = NULL;
14*eda14cbcSMatt Macy		const struct qstr *str __attribute__ ((unused)) = NULL;
15*eda14cbcSMatt Macy		initxattrs func __attribute__ ((unused)) = NULL;
16*eda14cbcSMatt Macy
17*eda14cbcSMatt Macy		security_inode_init_security(ip, dip, str, func, NULL);
18*eda14cbcSMatt Macy	])
19*eda14cbcSMatt Macy])
20*eda14cbcSMatt Macy
21*eda14cbcSMatt MacyAC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_CALLBACK], [
22*eda14cbcSMatt Macy	AC_MSG_CHECKING([whether security_inode_init_security wants callback])
23*eda14cbcSMatt Macy	ZFS_LINUX_TEST_RESULT([security_inode_init_security], [
24*eda14cbcSMatt Macy		AC_MSG_RESULT(yes)
25*eda14cbcSMatt Macy	],[
26*eda14cbcSMatt Macy		ZFS_LINUX_TEST_ERROR([security_inode_init_security callback])
27*eda14cbcSMatt Macy	])
28*eda14cbcSMatt Macy])
29*eda14cbcSMatt Macy
30*eda14cbcSMatt MacyAC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE], [
31*eda14cbcSMatt Macy	ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_CALLBACK
32*eda14cbcSMatt Macy])
33*eda14cbcSMatt Macy
34*eda14cbcSMatt MacyAC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE], [
35*eda14cbcSMatt Macy	ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_CALLBACK
36*eda14cbcSMatt Macy])
37