[set_cpus_allowed is exported by the kernel])],
[AC_MSG_RESULT([no])] )])
+# 2.6.32 introduces selinux_is_enabled()
+AC_DEFUN([LC_SELINUX_IS_ENABLED],
+[AC_MSG_CHECKING([if selinux_is_enabled is available])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/selinux.h>
+],[
+ selinux_is_enabled();
+],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_SELINUX_IS_ENABLED, 1,
+ [selinux_is_enabled is defined])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
#
# LC_D_OBTAIN_ALIAS
# starting from 2.6.28 kernel replaces d_alloc_anon() with
LC_SET_CPUS_ALLOWED
LC_EXT4_SINGLEDATA_TRANS_BLOCKS_SB
LC_WALK_SPACE_HAS_DATA_SEM
+ LC_SELINUX_IS_ENABLED
#
if test x$enable_server = xyes ; then
#define HAVE_NODE_TO_CPUMASK
#endif
+#ifndef HAVE_SELINUX_IS_ENABLED
+static inline bool selinux_is_enabled(void)
+{
+ return 0;
+}
+#endif
+
#endif /* __KERNEL__ */
#endif /* _COMPAT25_H */
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp_lock.h>
+#ifdef HAVE_SELINUX_IS_ENABLED
+#include <linux/selinux.h>
+#endif
#define DEBUG_SUBSYSTEM S_LLITE
strcmp(name, "security.capability") == 0))
RETURN(0);
+ /* LU-549: Disable security.selinux when selinux is disabled */
+ if (xattr_type == XATTR_SECURITY_T && !selinux_is_enabled() &&
+ strcmp(name, "security.selinux") == 0)
+ RETURN(-EOPNOTSUPP);
+
#ifdef CONFIG_FS_POSIX_ACL
if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
(xattr_type == XATTR_ACL_ACCESS_T ||