Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df2fc4bd authored by Eric Biggers's avatar Eric Biggers Committed by Jaegeuk Kim
Browse files

ext4: wire up FS_IOC_GET_ENCRYPTION_NONCE

This new ioctl retrieves a file's encryption nonce, which is useful for
testing.  See the corresponding fs/crypto/ patch for more details.

Link: https://lore.kernel.org/r/20200314205052.93294-3-ebiggers@kernel.org


Reviewed-by: default avatarTheodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
parent ecf91c96
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1028,6 +1028,11 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
			return -EOPNOTSUPP;
		return fscrypt_ioctl_get_key_status(filp, (void __user *)arg);

	case FS_IOC_GET_ENCRYPTION_NONCE:
		if (!ext4_has_feature_encrypt(sb))
			return -EOPNOTSUPP;
		return fscrypt_ioctl_get_nonce(filp, (void __user *)arg);

	case EXT4_IOC_FSGETXATTR:
	{
		struct fsxattr fa;
@@ -1162,6 +1167,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
	case FS_IOC_REMOVE_ENCRYPTION_KEY:
	case FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS:
	case FS_IOC_GET_ENCRYPTION_KEY_STATUS:
	case FS_IOC_GET_ENCRYPTION_NONCE:
	case EXT4_IOC_SHUTDOWN:
	case FS_IOC_GETFSMAP:
	case FS_IOC_ENABLE_VERITY: