summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/ubifs.h
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2016-09-08 20:36:39 +0200
committerTheodore Ts'o <tytso@mit.edu>2016-09-10 05:38:12 +0200
commit002ced4be6429918800ce3e41d5cbc2d7c01822c (patch)
tree2a25e775ca7ae0a8af8426267cd4f832e0fac0f6 /fs/ubifs/ubifs.h
parentfscrypto: add authorization check for setting encryption policy (diff)
downloadlinux-002ced4be6429918800ce3e41d5cbc2d7c01822c.tar.xz
linux-002ced4be6429918800ce3e41d5cbc2d7c01822c.zip
fscrypto: only allow setting encryption policy on directories
The FS_IOC_SET_ENCRYPTION_POLICY ioctl allowed setting an encryption policy on nondirectory files. This was unintentional, and in the case of nonempty regular files did not behave as expected because existing data was not actually encrypted by the ioctl. In the case of ext4, the user could also trigger filesystem errors in ->empty_dir(), e.g. due to mismatched "directory" checksums when the kernel incorrectly tried to interpret a regular file as a directory. This bug affected ext4 with kernels v4.8-rc1 or later and f2fs with kernels v4.6 and later. It appears that older kernels only permitted directories and that the check was accidentally lost during the refactoring to share the file encryption code between ext4 and f2fs. This patch restores the !S_ISDIR() check that was present in older kernels. Signed-off-by: Eric Biggers <ebiggers@google.com> Cc: stable@vger.kernel.org Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ubifs/ubifs.h')
0 files changed, 0 insertions, 0 deletions