Skip to content

Commit 7ec9f3b

Browse files
committed
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/[email protected] Reviewed-by: Theodore Ts'o <[email protected]> Signed-off-by: Eric Biggers <[email protected]>
1 parent e98ad46 commit 7ec9f3b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/ext4/ioctl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,11 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
12101210
return -EOPNOTSUPP;
12111211
return fscrypt_ioctl_get_key_status(filp, (void __user *)arg);
12121212

1213+
case FS_IOC_GET_ENCRYPTION_NONCE:
1214+
if (!ext4_has_feature_encrypt(sb))
1215+
return -EOPNOTSUPP;
1216+
return fscrypt_ioctl_get_nonce(filp, (void __user *)arg);
1217+
12131218
case EXT4_IOC_CLEAR_ES_CACHE:
12141219
{
12151220
if (!inode_owner_or_capable(inode))
@@ -1370,6 +1375,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
13701375
case FS_IOC_REMOVE_ENCRYPTION_KEY:
13711376
case FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS:
13721377
case FS_IOC_GET_ENCRYPTION_KEY_STATUS:
1378+
case FS_IOC_GET_ENCRYPTION_NONCE:
13731379
case EXT4_IOC_SHUTDOWN:
13741380
case FS_IOC_GETFSMAP:
13751381
case FS_IOC_ENABLE_VERITY:

0 commit comments

Comments
 (0)