X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=config%2Fkernel-security-inode-init.m4;h=c21588af75681f8778c15950b10bb796ef7436d5;hb=cac1f230e0537ceddead464dbd140e23a0556be6;hp=a26de9fd6b5d285c5286f3f1a3f6678538d23e14;hpb=5c03efc379693f992ebe39c6a00c7297c4a304ea;p=zfs.git diff --git a/config/kernel-security-inode-init.m4 b/config/kernel-security-inode-init.m4 index a26de9f..c21588a 100644 --- a/config/kernel-security-inode-init.m4 +++ b/config/kernel-security-inode-init.m4 @@ -12,7 +12,14 @@ AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [ ZFS_LINUX_TRY_COMPILE([ #include ],[ - security_inode_init_security(NULL,NULL,NULL,NULL,NULL,NULL); + struct inode *ip __attribute__ ((unused)) = NULL; + struct inode *dip __attribute__ ((unused)) = NULL; + const struct qstr *str __attribute__ ((unused)) = NULL; + char *name __attribute__ ((unused)) = NULL; + void *value __attribute__ ((unused)) = NULL; + size_t len __attribute__ ((unused)) = 0; + + security_inode_init_security(ip, dip, str, &name, &value, &len); ],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY, 1, @@ -22,3 +29,33 @@ AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [ ]) EXTRA_KCFLAGS="$tmp_flags" ]) + +dnl # +dnl # 3.2 API change +dnl # The security_inode_init_security() API has been changed to include +dnl # a filesystem specific callback to write security extended attributes. +dnl # This was done to support the initialization of multiple LSM xattrs +dnl # and the EVM xattr. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_CALLBACK_SECURITY_INODE_INIT_SECURITY], [ + AC_MSG_CHECKING([whether security_inode_init_security wants callback]) + tmp_flags="$EXTRA_KCFLAGS" + EXTRA_KCFLAGS="-Werror" + ZFS_LINUX_TRY_COMPILE([ + #include + ],[ + struct inode *ip __attribute__ ((unused)) = NULL; + struct inode *dip __attribute__ ((unused)) = NULL; + const struct qstr *str __attribute__ ((unused)) = NULL; + initxattrs func __attribute__ ((unused)) = NULL; + + security_inode_init_security(ip, dip, str, func, NULL); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY, 1, + [security_inode_init_security wants callback]) + ],[ + AC_MSG_RESULT(no) + ]) + EXTRA_KCFLAGS="$tmp_flags" +])