Linux compat 2.6.39: security_inode_init_security()
The security_inode_init_security() function now takes an additional qstr argument which must be passed in from the dentry if available. Passing a NULL is safe when no qstr is available the relevant security checks will just be skipped. Closes #246 Closes #217 Closes #187
This commit is contained in:
parent
bd2f5ac97f
commit
5c03efc379
|
@ -79,6 +79,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -64,6 +64,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -67,6 +67,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -67,6 +67,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -67,6 +67,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -67,6 +67,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -67,6 +67,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -67,6 +67,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -67,6 +67,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -67,6 +67,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
dnl #
|
||||
dnl # 2.6.39 API change
|
||||
dnl # The security_inode_init_security() function now takes an additional
|
||||
dnl # qstr argument which must be passed in from the dentry if available.
|
||||
dnl # Passing a NULL is safe when no qstr is available the relevant
|
||||
dnl # security checks will just be skipped.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [
|
||||
AC_MSG_CHECKING([whether security_inode_init_security wants 6 args])
|
||||
tmp_flags="$EXTRA_KCFLAGS"
|
||||
EXTRA_KCFLAGS="-Werror"
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/security.h>
|
||||
],[
|
||||
security_inode_init_security(NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY, 1,
|
||||
[security_inode_init_security wants 6 args])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
EXTRA_KCFLAGS="$tmp_flags"
|
||||
])
|
|
@ -38,6 +38,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
|||
ZFS_AC_KERNEL_D_OBTAIN_ALIAS
|
||||
ZFS_AC_KERNEL_CHECK_DISK_SIZE_CHANGE
|
||||
ZFS_AC_KERNEL_TRUNCATE_SETSIZE
|
||||
ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY
|
||||
|
||||
if test "$LINUX_OBJ" != "$LINUX"; then
|
||||
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
|
||||
|
|
|
@ -14567,6 +14567,74 @@ _ACEOF
|
|||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:$LINENO: checking whether security_inode_init_security wants 6 args" >&5
|
||||
$as_echo_n "checking whether security_inode_init_security wants 6 args... " >&6; }
|
||||
tmp_flags="$EXTRA_KCFLAGS"
|
||||
EXTRA_KCFLAGS="-Werror"
|
||||
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.c
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
|
||||
#include <linux/security.h>
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
||||
security_inode_init_security(NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_ACEOF
|
||||
|
||||
|
||||
rm -Rf build && mkdir -p build
|
||||
echo "obj-m := conftest.o" >build/Makefile
|
||||
if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
|
||||
{ $as_echo "$as_me:$LINENO: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY 1
|
||||
_ACEOF
|
||||
|
||||
|
||||
else
|
||||
$as_echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
{ $as_echo "$as_me:$LINENO: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
rm -Rf build
|
||||
|
||||
|
||||
EXTRA_KCFLAGS="$tmp_flags"
|
||||
|
||||
|
||||
if test "$LINUX_OBJ" != "$LINUX"; then
|
||||
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
|
||||
fi
|
||||
|
@ -18733,6 +18801,74 @@ _ACEOF
|
|||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:$LINENO: checking whether security_inode_init_security wants 6 args" >&5
|
||||
$as_echo_n "checking whether security_inode_init_security wants 6 args... " >&6; }
|
||||
tmp_flags="$EXTRA_KCFLAGS"
|
||||
EXTRA_KCFLAGS="-Werror"
|
||||
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.c
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
|
||||
#include <linux/security.h>
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
||||
security_inode_init_security(NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_ACEOF
|
||||
|
||||
|
||||
rm -Rf build && mkdir -p build
|
||||
echo "obj-m := conftest.o" >build/Makefile
|
||||
if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
|
||||
{ $as_echo "$as_me:$LINENO: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY 1
|
||||
_ACEOF
|
||||
|
||||
|
||||
else
|
||||
$as_echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
{ $as_echo "$as_me:$LINENO: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
rm -Rf build
|
||||
|
||||
|
||||
EXTRA_KCFLAGS="$tmp_flags"
|
||||
|
||||
|
||||
if test "$LINUX_OBJ" != "$LINUX"; then
|
||||
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
|
||||
fi
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -64,6 +64,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -64,6 +64,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -64,6 +64,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -64,6 +64,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -65,6 +65,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -65,6 +65,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -84,4 +84,12 @@ fn(struct inode *ip, const char *name, const void *buffer, \
|
|||
}
|
||||
#endif /* HAVE_DENTRY_XATTR_SET */
|
||||
|
||||
#ifdef HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY
|
||||
#define zpl_security_inode_init_security(ip, dip, qstr, nm, val, len) \
|
||||
security_inode_init_security(ip, dip, qstr, nm, val, len)
|
||||
#else
|
||||
#define zpl_security_inode_init_security(ip, dip, qstr, nm, val, len) \
|
||||
security_inode_init_security(ip, dip, nm, val, len)
|
||||
#endif /* HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY */
|
||||
|
||||
#endif /* _ZFS_XATTR_H */
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -60,7 +60,8 @@ extern struct file_system_type zpl_fs_type;
|
|||
|
||||
/* zpl_xattr.c */
|
||||
extern ssize_t zpl_xattr_list(struct dentry *dentry, char *buf, size_t size);
|
||||
extern int zpl_xattr_security_init(struct inode *ip, struct inode *dip);
|
||||
extern int zpl_xattr_security_init(struct inode *ip, struct inode *dip,
|
||||
const struct qstr *qstr);
|
||||
|
||||
extern xattr_handler_t *zpl_xattr_handlers[];
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -65,6 +65,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -64,6 +64,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -66,6 +66,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -64,6 +64,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -64,6 +64,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -327,7 +327,7 @@ zfs_inode_set_ops(zfs_sb_t *zsb, struct inode *ip)
|
|||
static znode_t *
|
||||
zfs_znode_alloc(zfs_sb_t *zsb, dmu_buf_t *db, int blksz,
|
||||
dmu_object_type_t obj_type, uint64_t obj, sa_handle_t *hdl,
|
||||
struct dentry *dentry)
|
||||
struct dentry *dentry, struct inode *dip)
|
||||
{
|
||||
znode_t *zp;
|
||||
struct inode *ip;
|
||||
|
@ -383,8 +383,12 @@ zfs_znode_alloc(zfs_sb_t *zsb, dmu_buf_t *db, int blksz,
|
|||
if (insert_inode_locked(ip))
|
||||
goto error;
|
||||
|
||||
if (dentry)
|
||||
if (dentry) {
|
||||
if (zpl_xattr_security_init(ip, dip, &dentry->d_name))
|
||||
goto error;
|
||||
|
||||
d_instantiate(dentry, ip);
|
||||
}
|
||||
|
||||
mutex_enter(&zsb->z_znodes_lock);
|
||||
list_insert_tail(&zsb->z_all_znodes, zp);
|
||||
|
@ -681,11 +685,9 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr,
|
|||
|
||||
if (!(flag & IS_ROOT_NODE)) {
|
||||
*zpp = zfs_znode_alloc(zsb, db, 0, obj_type, obj, sa_hdl,
|
||||
vap->va_dentry);
|
||||
vap->va_dentry, ZTOI(dzp));
|
||||
ASSERT(*zpp != NULL);
|
||||
ASSERT(dzp != NULL);
|
||||
err = zpl_xattr_security_init(ZTOI(*zpp), ZTOI(dzp));
|
||||
ASSERT3S(err, ==, 0);
|
||||
} else {
|
||||
/*
|
||||
* If we are creating the root node, the "parent" we
|
||||
|
@ -894,7 +896,7 @@ again:
|
|||
* bonus buffer.
|
||||
*/
|
||||
zp = zfs_znode_alloc(zsb, db, doi.doi_data_block_size,
|
||||
doi.doi_bonus_type, obj_num, NULL, NULL);
|
||||
doi.doi_bonus_type, obj_num, NULL, NULL, NULL);
|
||||
if (zp == NULL) {
|
||||
err = ENOENT;
|
||||
} else {
|
||||
|
|
|
@ -404,14 +404,16 @@ __zpl_xattr_security_set(struct inode *ip, const char *name,
|
|||
ZPL_XATTR_SET_WRAPPER(zpl_xattr_security_set);
|
||||
|
||||
int
|
||||
zpl_xattr_security_init(struct inode *ip, struct inode *dip)
|
||||
zpl_xattr_security_init(struct inode *ip, struct inode *dip,
|
||||
const struct qstr *qstr)
|
||||
{
|
||||
int error;
|
||||
size_t len;
|
||||
void *value;
|
||||
char *name;
|
||||
|
||||
error = security_inode_init_security(ip, dip, &name, &value, &len);
|
||||
error = zpl_security_inode_init_security(ip, dip, qstr,
|
||||
&name, &value, &len);
|
||||
if (error) {
|
||||
if (error == -EOPNOTSUPP)
|
||||
return 0;
|
||||
|
|
|
@ -65,6 +65,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -65,6 +65,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -65,6 +65,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -65,6 +65,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -65,6 +65,7 @@ am__aclocal_m4_deps = \
|
|||
$(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-for-each_segment.m4 \
|
||||
$(top_srcdir)/config/kernel-rq-is_sync.m4 \
|
||||
$(top_srcdir)/config/kernel-security-inode-init.m4 \
|
||||
$(top_srcdir)/config/kernel-truncate-setsize.m4 \
|
||||
$(top_srcdir)/config/kernel-xattr-handler.m4 \
|
||||
$(top_srcdir)/config/kernel.m4 \
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
/* fops->fsync() want 2 args */
|
||||
#undef HAVE_2ARGS_FSYNC
|
||||
|
||||
/* security_inode_init_security wants 6 args */
|
||||
#undef HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY
|
||||
|
||||
/* struct block_device_operations use bdevs */
|
||||
#undef HAVE_BDEV_BLOCK_DEVICE_OPERATIONS
|
||||
|
||||
|
|
Loading…
Reference in New Issue