1. 03 12月, 2014 1 次提交
    • E
      mnt: Update unprivileged remount test · 4a44a19b
      Eric W. Biederman 提交于
      - MNT_NODEV should be irrelevant except when reading back mount flags,
        no longer specify MNT_NODEV on remount.
      
      - Test MNT_NODEV on devpts where it is meaningful even for unprivileged mounts.
      
      - Add a test to verify that remount of a prexisting mount with the same flags
        is allowed and does not change those flags.
      
      - Cleanup up the definitions of MS_REC, MS_RELATIME, MS_STRICTATIME that are used
        when the code is built in an environment without them.
      
      - Correct the test error messages when tests fail.  There were not 5 tests
        that tested MS_RELATIME.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      4a44a19b
  2. 01 8月, 2014 1 次提交
    • E
      mnt: Add tests for unprivileged remount cases that have found to be faulty · db181ce0
      Eric W. Biederman 提交于
      Kenton Varda <kenton@sandstorm.io> discovered that by remounting a
      read-only bind mount read-only in a user namespace the
      MNT_LOCK_READONLY bit would be cleared, allowing an unprivileged user
      to the remount a read-only mount read-write.
      
      Upon review of the code in remount it was discovered that the code allowed
      nosuid, noexec, and nodev to be cleared.  It was also discovered that
      the code was allowing the per mount atime flags to be changed.
      
      The first naive patch to fix these issues contained the flaw that using
      default atime settings when remounting a filesystem could be disallowed.
      
      To avoid this problems in the future add tests to ensure unprivileged
      remounts are succeeding and failing at the appropriate times.
      
      Cc: stable@vger.kernel.org
      Acked-by: NSerge E. Hallyn <serge.hallyn@ubuntu.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      db181ce0