]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ext4: reserve code points for the project quota feature
authorTheodore Ts'o <tytso@mit.edu>
Sat, 17 Oct 2015 20:15:18 +0000 (16:15 -0400)
committerDhaval Giani <dhaval.giani@oracle.com>
Mon, 29 May 2017 21:02:40 +0000 (17:02 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 8b4953e13f4c5d9a3c869f5fca7d51e1700e7db0)

Orabug: 25802481
CVE-2016-10208

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
fs/ext4/ext4.h
include/uapi/linux/fs.h

index 74973f7a16b4cd8568062d43f0fc54642aa4c17f..23b6523a705a95a97abdcecbb3171c106f1b746e 100644 (file)
@@ -378,6 +378,7 @@ struct flex_groups {
 #define EXT4_EA_INODE_FL               0x00200000 /* Inode used for large EA */
 #define EXT4_EOFBLOCKS_FL              0x00400000 /* Blocks allocated beyond EOF */
 #define EXT4_INLINE_DATA_FL            0x10000000 /* Inode has inline data. */
+#define EXT4_PROJINHERIT_FL            0x20000000 /* Create with parents projid */
 #define EXT4_RESERVED_FL               0x80000000 /* reserved for ext4 lib */
 
 #define EXT4_FL_USER_VISIBLE           0x004BDFFF /* User visible flags */
@@ -435,6 +436,7 @@ enum {
        EXT4_INODE_EA_INODE     = 21,   /* Inode used for large EA */
        EXT4_INODE_EOFBLOCKS    = 22,   /* Blocks allocated beyond EOF */
        EXT4_INODE_INLINE_DATA  = 28,   /* Data in inode. */
+       EXT4_INODE_PROJINHERIT  = 29,   /* Create with parents projid */
        EXT4_INODE_RESERVED     = 31,   /* reserved for ext4 lib */
 };
 
@@ -479,6 +481,7 @@ static inline void ext4_check_flag_values(void)
        CHECK_FLAG_VALUE(EA_INODE);
        CHECK_FLAG_VALUE(EOFBLOCKS);
        CHECK_FLAG_VALUE(INLINE_DATA);
+       CHECK_FLAG_VALUE(PROJINHERIT);
        CHECK_FLAG_VALUE(RESERVED);
 }
 
@@ -696,6 +699,7 @@ struct ext4_inode {
        __le32  i_crtime;       /* File Creation time */
        __le32  i_crtime_extra; /* extra FileCreationtime (nsec << 2 | epoch) */
        __le32  i_version_hi;   /* high 32 bits for 64-bit version */
+       __le32  i_projid;       /* Project ID */
 };
 
 struct move_extent {
@@ -1216,7 +1220,8 @@ struct ext4_super_block {
        __u8    s_encrypt_algos[4];     /* Encryption algorithms in use  */
        __u8    s_encrypt_pw_salt[16];  /* Salt used for string2key algorithm */
        __le32  s_lpf_ino;              /* Location of the lost+found inode */
-       __le32  s_reserved[100];        /* Padding to the end of the block */
+       __le32  s_prj_quota_inum;       /* inode for tracking project quota */
+       __le32  s_reserved[99];         /* Padding to the end of the block */
        __le32  s_checksum;             /* crc32c(superblock) */
 };
 
@@ -1601,6 +1606,7 @@ static inline int ext4_encrypted_inode(struct inode *inode)
  */
 #define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM   0x0400
 #define EXT4_FEATURE_RO_COMPAT_READONLY                0x1000
+#define EXT4_FEATURE_RO_COMPAT_PROJECT         0x2000
 
 #define EXT4_FEATURE_INCOMPAT_COMPRESSION      0x0001
 #define EXT4_FEATURE_INCOMPAT_FILETYPE         0x0002
index 9b964a5920afbaca68d2e3976e883b4fba54f4ba..f15d980249b502e4638e6125f04e595f0f52035e 100644 (file)
@@ -197,6 +197,7 @@ struct inodes_stat_t {
 #define FS_EXTENT_FL                   0x00080000 /* Extents */
 #define FS_DIRECTIO_FL                 0x00100000 /* Use direct i/o */
 #define FS_NOCOW_FL                    0x00800000 /* Do not cow file */
+#define FS_PROJINHERIT_FL              0x20000000 /* Create with parents projid */
 #define FS_RESERVED_FL                 0x80000000 /* reserved for ext2 lib */
 
 #define FS_FL_USER_VISIBLE             0x0003DFFF /* User visible flags */