1 ext4: fix an endianness bug in ext4_encrypted_follow_link()
3 From: Al Viro <viro@ZenIV.linux.org.uk>
5 applying le32_to_cpu() to 16bit value is a bad idea...
7 Cc: stable@vger.kernel.org # v4.1+
8 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c
13 index abe2401..e8e7af6 100644
14 --- a/fs/ext4/symlink.c
15 +++ b/fs/ext4/symlink.c
16 @@ -52,7 +52,7 @@ static const char *ext4_encrypted_follow_link(struct dentry *dentry, void **cook
17 /* Symlink is encrypted */
18 sd = (struct ext4_encrypted_symlink_data *)caddr;
19 cstr.name = sd->encrypted_path;
20 - cstr.len = le32_to_cpu(sd->len);
21 + cstr.len = le16_to_cpu(sd->len);
23 sizeof(struct ext4_encrypted_symlink_data) - 1) >