mirror of https://github.com/OpenIPC/firmware.git
64 lines
2.1 KiB
Diff
64 lines
2.1 KiB
Diff
diff -drupN a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
|
|
--- a/include/uapi/linux/fs.h 2018-08-06 17:23:04.000000000 +0300
|
|
+++ b/include/uapi/linux/fs.h 2022-06-12 05:28:14.000000000 +0300
|
|
@@ -237,6 +237,8 @@ struct fsxattr {
|
|
#define FICLONERANGE _IOW(0x94, 13, struct file_clone_range)
|
|
#define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range)
|
|
|
|
+#define FIDTRIM _IOWR('f', 128, struct fstrim_range) /* Deep discard trim */
|
|
+
|
|
#define FS_IOC_GETFLAGS _IOR('f', 1, long)
|
|
#define FS_IOC_SETFLAGS _IOW('f', 2, long)
|
|
#define FS_IOC_GETVERSION _IOR('v', 1, long)
|
|
@@ -255,18 +257,49 @@ struct fsxattr {
|
|
/* Policy provided via an ioctl on the topmost directory */
|
|
#define FS_KEY_DESCRIPTOR_SIZE 8
|
|
|
|
+#define FS_POLICY_FLAGS_PAD_4 0x00
|
|
+#define FS_POLICY_FLAGS_PAD_8 0x01
|
|
+#define FS_POLICY_FLAGS_PAD_16 0x02
|
|
+#define FS_POLICY_FLAGS_PAD_32 0x03
|
|
+#define FS_POLICY_FLAGS_PAD_MASK 0x03
|
|
+#define FS_POLICY_FLAGS_VALID 0x03
|
|
+
|
|
+/* Encryption algorithms */
|
|
+#define FS_ENCRYPTION_MODE_INVALID 0
|
|
+#define FS_ENCRYPTION_MODE_AES_256_XTS 1
|
|
+#define FS_ENCRYPTION_MODE_AES_256_GCM 2
|
|
+#define FS_ENCRYPTION_MODE_AES_256_CBC 3
|
|
+#define FS_ENCRYPTION_MODE_AES_256_CTS 4
|
|
+#define FS_ENCRYPTION_MODE_AES_128_CBC 5
|
|
+#define FS_ENCRYPTION_MODE_AES_128_CTS 6
|
|
+#define FS_ENCRYPTION_MODE_SPECK128_256_XTS 7
|
|
+#define FS_ENCRYPTION_MODE_SPECK128_256_CTS 8
|
|
+
|
|
struct fscrypt_policy {
|
|
__u8 version;
|
|
__u8 contents_encryption_mode;
|
|
__u8 filenames_encryption_mode;
|
|
__u8 flags;
|
|
__u8 master_key_descriptor[FS_KEY_DESCRIPTOR_SIZE];
|
|
-} __packed;
|
|
+};
|
|
|
|
#define FS_IOC_SET_ENCRYPTION_POLICY _IOR('f', 19, struct fscrypt_policy)
|
|
#define FS_IOC_GET_ENCRYPTION_PWSALT _IOW('f', 20, __u8[16])
|
|
#define FS_IOC_GET_ENCRYPTION_POLICY _IOW('f', 21, struct fscrypt_policy)
|
|
|
|
+/* Parameters for passing an encryption key into the kernel keyring */
|
|
+#define FS_KEY_DESC_PREFIX "fscrypt:"
|
|
+#define FS_KEY_DESC_PREFIX_SIZE 8
|
|
+
|
|
+/* Structure that userspace passes to the kernel keyring */
|
|
+#define FS_MAX_KEY_SIZE 64
|
|
+
|
|
+struct fscrypt_key {
|
|
+ __u32 mode;
|
|
+ __u8 raw[FS_MAX_KEY_SIZE];
|
|
+ __u32 size;
|
|
+};
|
|
+
|
|
/*
|
|
* Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
|
|
*
|