]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ext4 crypto: reserve codepoints used by the ext4 encryption feature
authorTheodore Ts'o <tytso@mit.edu>
Wed, 8 Apr 2015 04:19:22 +0000 (00:19 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 8 Apr 2015 04:19:22 +0000 (00:19 -0400)
Change-Id: I5f01f62e75426150c32c22188ae8ad3192da95e6
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h

index f7f3f5871796d9c44ec689a74518ae46eeb77215..0fafd2123a61583b3c9a35afec19b0f92f019f5d 100644 (file)
@@ -422,7 +422,7 @@ enum {
        EXT4_INODE_DIRTY        = 8,
        EXT4_INODE_COMPRBLK     = 9,    /* One or more compressed clusters */
        EXT4_INODE_NOCOMPR      = 10,   /* Don't compress */
-       EXT4_INODE_ENCRYPT      = 11,   /* Compression error */
+       EXT4_INODE_ENCRYPT      = 11,   /* Encrypted */
 /* End compression flags --- maybe not all used */
        EXT4_INODE_INDEX        = 12,   /* hash-indexed directory */
        EXT4_INODE_IMAGIC       = 13,   /* AFS directory */
@@ -582,6 +582,13 @@ enum {
 #define EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER  0x0010
 #define EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER   0x0020
 
+/* Encryption algorithms */
+#define EXT4_ENCRYPTION_MODE_INVALID           0
+#define EXT4_ENCRYPTION_MODE_AES_256_XTS       1
+#define EXT4_ENCRYPTION_MODE_AES_256_GCM       2
+#define EXT4_ENCRYPTION_MODE_AES_256_CBC       3
+#define EXT4_ENCRYPTION_MODE_AES_256_CTS       4
+
 /*
  * ioctl commands
  */
@@ -1049,12 +1056,6 @@ extern void ext4_set_bits(void *bm, int cur, int len);
 /* Metadata checksum algorithm codes */
 #define EXT4_CRC32C_CHKSUM             1
 
-/* Encryption algorithms */
-#define EXT4_ENCRYPTION_MODE_INVALID           0
-#define EXT4_ENCRYPTION_MODE_AES_256_XTS       1
-#define EXT4_ENCRYPTION_MODE_AES_256_GCM       2
-#define EXT4_ENCRYPTION_MODE_AES_256_CBC       3
-
 /*
  * Structure of the super block
  */
@@ -1169,7 +1170,9 @@ struct ext4_super_block {
        __le32  s_overhead_clusters;    /* overhead blocks/clusters in fs */
        __le32  s_backup_bgs[2];        /* groups with sparse_super2 SBs */
        __u8    s_encrypt_algos[4];     /* Encryption algorithms in use  */
-       __le32  s_reserved[105];        /* Padding to the end of the block */
+       __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_checksum;             /* crc32c(superblock) */
 };