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

Permission checking is missing when setfacl

Details

    • 3
    • 12939

    Description

      Setxattr does not check the permission when setting ACL xattrs. This
      will cause security problem because any user can walk around permission
      checking by changing ACL rules.

      Following script will reproduce this problem.
      #!/bin/bash
      DIR=/mnt/lustre/dir

      1. we can got this from Lustre/test
        RUNAS=./runas
        rmdir $DIR
        if [ -e $DIR ]; then
        echo "Please remove $DIR"
        exit 1
        fi

      mkdir $DIR
      if [ ! -d $DIR ]; then
      echo "Faled to mkdir $DIR"
      exit 1
      fi

      chmod 700 $DIR

      $RUNAS -u test ls $DIR
      if [ $? -eq 0 ]; then
      echo "Permission error"
      exit 1
      fi

      $RUNAS -u test setfacl -m u:test:rwx $DIR
      if [ $? -ne 0 ]; then
      echo "Probelm not reproduced because setfacl failed"
      exit 1
      fi

      echo "Probelm reproduced!!"

      $RUNAS -u test ls $DIR
      if [ $? -ne 0 ]; then
      echo "ACL does not work!"
      exit 1
      fi

      echo "Security problem!!"

      Attachments

        Issue Links

          Activity

            [LU-4704] Permission checking is missing when setfacl
            utopiabound Nathaniel Clark added a comment - backport sanity/103 ( http://review.whamcloud.com/9541 ) tests to b2_5: http://review.whamcloud.com/10512
            bogl Bob Glossman (Inactive) added a comment - backport to b2_4: http://review.whamcloud.com/9559
            emoly.liu Emoly Liu added a comment -

            The patch to enable acl/974.test and acl/2561.test is here: http://review.whamcloud.com/9541

            emoly.liu Emoly Liu added a comment - The patch to enable acl/974.test and acl/2561.test is here: http://review.whamcloud.com/9541
            bogl Bob Glossman (Inactive) added a comment - backport to b2_5: http://review.whamcloud.com/9514

            Emoly, I also see that acl/974.test and acl/2561.test are not included in the lustre/tests/Makefile.am nobase_noinst_DATA list, and those tests are being skipped. Could you please make a separate patch to add them to the list so they are in the RPM, and fix the test to fail if the test scripts are missing.

            adilger Andreas Dilger added a comment - Emoly, I also see that acl/974.test and acl/2561.test are not included in the lustre/tests/Makefile.am nobase_noinst_DATA list, and those tests are being skipped. Could you please make a separate patch to add them to the list so they are in the RPM, and fix the test to fail if the test scripts are missing.
            pjones Peter Jones added a comment -

            Emoly

            Could you please look after this patch?

            Thanks

            Peter

            pjones Peter Jones added a comment - Emoly Could you please look after this patch? Thanks Peter
            lixi Li Xi (Inactive) added a comment - - edited

            Please check this patch.
            http://review.whamcloud.com/#/c/9473/

            (This one is for ll_setxattr_common().)

            lixi Li Xi (Inactive) added a comment - - edited Please check this patch. http://review.whamcloud.com/#/c/9473/ (This one is for ll_setxattr_common().)

            People

              emoly.liu Emoly Liu
              lixi Li Xi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: