Skip to contentSkip to conversation

Patch "ext4: do not advertise encryption support when disabled" has been added to the 4.8-stable tree

PATCH [email protected] 1 participant 1 message Oct 26, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ext4: do not advertise encryption support when disabled

to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ext4-do-not-advertise-encryption-support-when-disabled.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From c4704a4fbe834eee4109ca064131d440941f6235 Mon Sep 17 00:00:00 2001

From: Eric Biggers <[email protected]>
Date: Wed, 12 Oct 2016 23:24:51 -0400
Subject: ext4: do not advertise encryption support when disabled

From: Eric Biggers <[email protected]>

commit c4704a4fbe834eee4109ca064131d440941f6235 upstream.

The sysfs file /sys/fs/ext4/features/encryption was present on kernels compiled with CONFIG_EXT4_FS_ENCRYPTION=n. This was misleading because such kernels do not actually support ext4 encryption. Therefore, only provide this file on kernels compiled with CONFIG_EXT4_FS_ENCRYPTION=y.

Note: since the ext4 feature files are all hardcoded to have a contents of "supported", it really is the presence or absence of the file that is significant, not the contents (and this change reflects that).

---
 fs/ext4/sysfs.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/ext4/sysfs.c +4 -0
@@ -223,14 +223,18 @@ static struct attribute *ext4_attrs[] =
 EXT4_ATTR_FEATURE(lazy_itable_init);
 EXT4_ATTR_FEATURE(batched_discard);
 EXT4_ATTR_FEATURE(meta_bg_resize);
+#ifdef CONFIG_EXT4_FS_ENCRYPTION
 EXT4_ATTR_FEATURE(encryption);
+#endif
 EXT4_ATTR_FEATURE(metadata_csum_seed);
 
 static struct attribute *ext4_feat_attrs[] = {
 	ATTR_LIST(lazy_itable_init),
 	ATTR_LIST(batched_discard),
 	ATTR_LIST(meta_bg_resize),
+#ifdef CONFIG_EXT4_FS_ENCRYPTION
 	ATTR_LIST(encryption),
+#endif
 	ATTR_LIST(metadata_csum_seed),
 	NULL,
 };

Patches currently in stable-queue which might be from [email protected] are

queue-4.8/fscrypto-lock-inode-while-setting-encryption-policy.patch queue-4.8/ext4-do-not-advertise-encryption-support-when-disabled.patch queue-4.8/fscrypto-make-xts-tweak-initialization-endian-independent.patch