]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: require encryption feature for EXT4_IOC_SET_ENCRYPTION_POLICY
authorRichard Weinberger <richard@nod.at>
Fri, 2 Mar 2018 22:21:11 +0000 (14:21 -0800)
committerSasha Levin <alexander.levin@microsoft.com>
Sun, 4 Mar 2018 15:28:35 +0000 (10:28 -0500)
commited6923107e5d09dfe1e79bf8f3cdb6815994d216
treeb99f703c607473921e79ac1b117a445eed3c8aac
parent6e493d18d70209a60b091f706876d54e6ea5ce2b
ext4: require encryption feature for EXT4_IOC_SET_ENCRYPTION_POLICY

commit 9a200d075e5d05be1fcad4547a0f8aee4e2f9a04 upstream.

...otherwise an user can enable encryption for certain files even
when the filesystem is unable to support it.
Such a case would be a filesystem created by mkfs.ext4's default
settings, 1KiB block size. Ext4 supports encyption only when block size
is equal to PAGE_SIZE.
But this constraint is only checked when the encryption feature flag
is set.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
fs/ext4/ioctl.c