aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-05-15 19:26:10 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2016-03-18 00:19:33 -0400
commit0b81d0779072696371822e5ed9e7c6292e547024 (patch)
treec75412a642ee596fd33a392f0f353c4c1185f7f5 /include/uapi
parent59692b7c71e4271b62bddce5bfd50b9e805a4a02 (diff)
fs crypto: move per-file encryption from f2fs tree to fs/crypto
This patch adds the renamed functions moved from the f2fs crypto files. 1. definitions for per-file encryption used by ext4 and f2fs. 2. crypto.c for encrypt/decrypt functions a. IO preparation: - fscrypt_get_ctx / fscrypt_release_ctx b. before IOs: - fscrypt_encrypt_page - fscrypt_decrypt_page - fscrypt_zeroout_range c. after IOs: - fscrypt_decrypt_bio_pages - fscrypt_pullback_bio_page - fscrypt_restore_control_page 3. policy.c supporting context management. a. For ioctls: - fscrypt_process_policy - fscrypt_get_policy b. For context permission - fscrypt_has_permitted_context - fscrypt_inherit_context 4. keyinfo.c to handle permissions - fscrypt_get_encryption_info - fscrypt_free_encryption_info 5. fname.c to support filename encryption a. general wrapper functions - fscrypt_fname_disk_to_usr - fscrypt_fname_usr_to_disk - fscrypt_setup_filename - fscrypt_free_filename b. specific filename handling functions - fscrypt_fname_alloc_buffer - fscrypt_fname_free_buffer 6. Makefile and Kconfig Cc: Al Viro <viro@ftp.linux.org.uk> Signed-off-by: Michael Halcrow <mhalcrow@google.com> Signed-off-by: Ildar Muslukhov <ildarm@google.com> Signed-off-by: Uday Savagaonkar <savagaon@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/fs.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
index 149bec83a907..cec100b6dfa9 100644
--- a/include/uapi/linux/fs.h
+++ b/include/uapi/linux/fs.h
@@ -247,6 +247,24 @@ struct fsxattr {
247#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr) 247#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr)
248 248
249/* 249/*
250 * File system encryption support
251 */
252/* Policy provided via an ioctl on the topmost directory */
253#define FS_KEY_DESCRIPTOR_SIZE 8
254
255struct fscrypt_policy {
256 __u8 version;
257 __u8 contents_encryption_mode;
258 __u8 filenames_encryption_mode;
259 __u8 flags;
260 __u8 master_key_descriptor[FS_KEY_DESCRIPTOR_SIZE];
261} __packed;
262
263#define FS_IOC_SET_ENCRYPTION_POLICY _IOR('f', 19, struct fscrypt_policy)
264#define FS_IOC_GET_ENCRYPTION_PWSALT _IOW('f', 20, __u8[16])
265#define FS_IOC_GET_ENCRYPTION_POLICY _IOW('f', 21, struct fscrypt_policy)
266
267/*
250 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) 268 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
251 * 269 *
252 * Note: for historical reasons, these flags were originally used and 270 * Note: for historical reasons, these flags were originally used and