1. 18 7月, 2017 2 次提交
    • E
      reiserfs: preserve i_mode if __reiserfs_set_acl() fails · fcea8aed
      Ernesto A. Fernández 提交于
      When changing a file's acl mask, reiserfs_set_acl() will first set the
      group bits of i_mode to the value of the mask, and only then set the
      actual extended attribute representing the new acl.
      
      If the second part fails (due to lack of space, for example) and the
      file had no acl attribute to begin with, the system will from now on
      assume that the mask permission bits are actual group permission bits,
      potentially granting access to the wrong users.
      
      Prevent this by only changing the inode mode after the acl has been set.
      Signed-off-by: NErnesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      fcea8aed
    • E
      ext2: preserve i_mode if ext2_set_acl() fails · fe26569e
      Ernesto A. Fernández 提交于
      When changing a file's acl mask, ext2_set_acl() will first set the group
      bits of i_mode to the value of the mask, and only then set the actual
      extended attribute representing the new acl.
      
      If the second part fails (due to lack of space, for example) and the file
      had no acl attribute to begin with, the system will from now on assume
      that the mask permission bits are actual group permission bits, potentially
      granting access to the wrong users.
      
      Prevent this by only changing the inode mode after the acl has been set.
      
      [JK: Rebased on top of "ext2: Don't clear SGID when inheriting ACLs"]
      Signed-off-by: NErnesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      fe26569e
  2. 17 7月, 2017 3 次提交
    • J
      ext2: Don't clear SGID when inheriting ACLs · a992f2d3
      Jan Kara 提交于
      When new directory 'DIR1' is created in a directory 'DIR0' with SGID bit
      set, DIR1 is expected to have SGID bit set (and owning group equal to
      the owning group of 'DIR0'). However when 'DIR0' also has some default
      ACLs that 'DIR1' inherits, setting these ACLs will result in SGID bit on
      'DIR1' to get cleared if user is not member of the owning group.
      
      Fix the problem by creating __ext2_set_acl() function that does not call
      posix_acl_update_mode() and use it when inheriting ACLs. That prevents
      SGID bit clearing and the mode has been properly set by
      posix_acl_create() anyway.
      
      Fixes: 07393101
      CC: stable@vger.kernel.org
      CC: linux-ext4@vger.kernel.org
      Signed-off-by: NJan Kara <jack@suse.cz>
      a992f2d3
    • J
      reiserfs: Don't clear SGID when inheriting ACLs · 6883cd7f
      Jan Kara 提交于
      When new directory 'DIR1' is created in a directory 'DIR0' with SGID bit
      set, DIR1 is expected to have SGID bit set (and owning group equal to
      the owning group of 'DIR0'). However when 'DIR0' also has some default
      ACLs that 'DIR1' inherits, setting these ACLs will result in SGID bit on
      'DIR1' to get cleared if user is not member of the owning group.
      
      Fix the problem by moving posix_acl_update_mode() out of
      __reiserfs_set_acl() into reiserfs_set_acl(). That way the function will
      not be called when inheriting ACLs which is what we want as it prevents
      SGID bit clearing and the mode has been properly set by
      posix_acl_create() anyway.
      
      Fixes: 07393101
      CC: stable@vger.kernel.org
      CC: reiserfs-devel@vger.kernel.org
      Signed-off-by: NJan Kara <jack@suse.cz>
      6883cd7f
    • G
      binfmt_flat: Use %u to format u32 · a8605423
      Geert Uytterhoeven 提交于
      Several variables had their types changed from unsigned long to u32, but
      the printk()-style format to print them wasn't updated, leading to:
      
          fs/binfmt_flat.c: In function ‘load_flat_file’:
          fs/binfmt_flat.c:577: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘u32’
      
      Fixes: 468138d7 ("binfmt_flat: flat_{get,put}_addr_from_rp() should be able to fail")
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a8605423
  3. 15 7月, 2017 26 次提交
  4. 14 7月, 2017 9 次提交