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

append_context_for_mount() must quote the value of the context option

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • Lustre 2.5.0, Lustre 2.7.0, Lustre 2.8.0
    • 3
    • 9223372036854775807

    Description

      In append_context_for_mount() the SELinux context of the temporary directory is appended to the mount options by

      strcat(mop->mo_ldd.ldd_mount_opts, ",context=");
      strcat(mop->mo_ldd.ldd_mount_opts, fcontext);
      

      This is incorrect since as mount.8 notes

      Warning: the context value might contain commas, in which case the  value
      has to be properly quoted, otherwise mount(8) will interpret the comma as
      a separator between mount options.  Don't forget that  the  shell  strips
      off quotes and thus double quoting is required.  For example:
      
          mount -t tmpfs none /mnt -o 'context="system_u:object_r:tmp_t:s0:c127,c456",noexec'
      
      For more details, see selinux(8).
      

      Attachments

        Activity

          [LU-7003] append_context_for_mount() must quote the value of the context option
          mdiep Minh Diep made changes -
          Link Original: This issue is related to LDEV-341 [ LDEV-341 ]
          mdiep Minh Diep made changes -
          Link New: This issue is related to LDEV-342 [ LDEV-342 ]
          mdiep Minh Diep made changes -
          Link Original: This issue is related to JFC-17 [ JFC-17 ]
          mdiep Minh Diep made changes -
          Link New: This issue is related to JFC-20 [ JFC-20 ]
          mdiep Minh Diep made changes -
          Link New: This issue is related to LDEV-373 [ LDEV-373 ]
          mdiep Minh Diep made changes -
          Link New: This issue is related to LDEV-368 [ LDEV-368 ]
          mdiep Minh Diep made changes -
          Link Original: This issue is related to LDEV-367 [ LDEV-367 ]
          mdiep Minh Diep made changes -
          Link New: This issue is related to LDEV-341 [ LDEV-341 ]
          pjones Peter Jones made changes -
          Link Original: This issue is related to LDEV-370 [ LDEV-370 ]
          pjones Peter Jones made changes -
          Link New: This issue is related to LDEV-367 [ LDEV-367 ]

          People

            jhammond John Hammond
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: