Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-13679

security.selinux xattr handling when SELinux is disabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • Lustre 2.12.5
    • None
    • 3
    • 9223372036854775807

    Description

      When SELinux is disabled, "security.selinux" does not have any special meaning.

      However,

      1) security.selinux is filtered out from the xattr cache even when SELinux is disabled

                      } else if (!strcmp(xdata, "security.selinux")) {
                              /* Filter out security.selinux, it is cached in slab */
                              CDEBUG(D_CACHE, "not caching security.selinux\n");
                              rc = 0;
                      } else {
      

      Lustre listxattr, as opposed to other Linux filesystems such as XFS, will not list "security.selinux", getxattr will not return its value.

      2) security.selinux is not allowed to be modified or removed when SELinux is disabled

              /* 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);
      

      This looks like a very old optimization of a case which is not completely clear to me. Under what circumstances would anyone modify security.selinux without SELinux enabled? Is it some sort of untar? If so, then is it correct to return EOPNOTSUPP instead of applying the xattr?

      Either way, without SELinux enabled, XFS allows security.selinux removal.

      Attachments

        Activity

          People

            wc-triage WC Triage
            panda Andrew Perepechko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: