Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext4: skip ext4_init_security() and encryption on ea_inodes

Extended attribute inodes are internal to ext4. Adding encryption/security
related attributes on them would mean dealing with nested calls into ea code.
Since they have no direct exposure to user mode, just avoid creating ea
entries for them.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Tahsin Erdogan and committed by
Theodore Ts'o
ad47f953 2a527d68

+6 -5
+6 -5
fs/ext4/ialloc.c
··· 771 771 772 772 if ((ext4_encrypted_inode(dir) || 773 773 DUMMY_ENCRYPTION_ENABLED(EXT4_SB(dir->i_sb))) && 774 - (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))) { 774 + (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) && 775 + !(i_flags & EXT4_EA_INODE_FL)) { 775 776 err = fscrypt_get_encryption_info(dir); 776 777 if (err) 777 778 return ERR_PTR(err); ··· 1115 1114 err = ext4_init_acl(handle, inode, dir); 1116 1115 if (err) 1117 1116 goto fail_free_drop; 1118 - } 1119 1117 1120 - err = ext4_init_security(handle, inode, dir, qstr); 1121 - if (err) 1122 - goto fail_free_drop; 1118 + err = ext4_init_security(handle, inode, dir, qstr); 1119 + if (err) 1120 + goto fail_free_drop; 1121 + } 1123 1122 1124 1123 if (ext4_has_feature_extents(sb)) { 1125 1124 /* set extent flag only for directory, file and normal symlink*/