Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-23616

Sticky bit changed behavior when opening files owned by different user in the same group

    • Yes
    • Important
    • Regression, TestCaseProvided
    • rhel-sst-filesystems
    • ssg_filesystems_storage_and_HA
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      The behavior of open() on a file in a directory with the sticky bit set has changed when opening a file owned by a different user, but having the same group ownership.

      Removing the sticky bit allows the open to succeed.

       

      RHEL 7 and RHEL 8 succeeded with sticky bit set.

      Please provide the package NVR for which bug is seen:

      kernel 5.14.0-364.el9 (likely most/all RHEL 9 kernels)

      How reproducible:

      easy

      Steps to reproduce

      create group and two users with same group membership:

      # groupadd -g 2000 group2000
      # useradd -g 2000 -u 2000 user2000
      # useradd -g 2000 -u 2001 user2001

      create a test directory + file, set mode & ownership:

      # cd /tmp
      # mkdir -m 01777 testdir
      # touch testdir/testfile2000
      # chmod 664 testdir/testfile2000
      # chown user2000:group2000 testdir/testfile2000

      su to user2001, try to write file

      # su user2001
      # vi testdir/testfile2000
      :w 

       

      all-in-one reproducer will be attached

      Expected results

      Since the group ownership matches the user's group membership, the write is expected to succeed.

      Actual results

      The write fails with EACCES

              fs-maint FS Maint
              rhn-support-fsorenso Frank Sorenson
              FS Maint FS Maint
              Zirong Lang Zirong Lang
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: