summaryrefslogtreecommitdiffstats
path: root/fs/ntfs3
diff options
context:
space:
mode:
authorThomas Kühnel <thomas.kuehnel@avm.de>2021-12-07 11:24:53 +0100
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-11-14 17:50:40 +0100
commit90c1cd540cc81023c5826891f3793ea159c4562e (patch)
treef27f479ac2ff3aabfe50a7a351bbeb045f984ed1 /fs/ntfs3
parentfs/ntfs3: Fix slab-out-of-bounds in r_page (diff)
downloadlinux-90c1cd540cc81023c5826891f3793ea159c4562e.tar.xz
linux-90c1cd540cc81023c5826891f3793ea159c4562e.zip
fs/ntfs3: Fix endian conversion in ni_fname_name
ni_fname_name called ntfs_cmp_names_cpu which assumes that the first string is in CPU byte order and the second one in little endian. In this case both strings are little endian so ntfs_cmp_names is the correct function to call. Signed-off-by: Thomas Kühnel <thomas.kuehnel@avm.de> Reviewed-by: Nicolas Schier <n.schier@avm.de> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3')
-rw-r--r--fs/ntfs3/frecord.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 3b309b9a5e29..039247ab5b0b 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -1645,6 +1645,7 @@ struct ATTR_FILE_NAME *ni_fname_name(struct ntfs_inode *ni,
{
struct ATTRIB *attr = NULL;
struct ATTR_FILE_NAME *fname;
+ struct le_str *fns;
if (le)
*le = NULL;
@@ -1668,7 +1669,8 @@ next:
if (uni->len != fname->name_len)
goto next;
- if (ntfs_cmp_names_cpu(uni, (struct le_str *)&fname->name_len, NULL,
+ fns = (struct le_str *)&fname->name_len;
+ if (ntfs_cmp_names(uni->name, uni->len, fns->name, fns->len, NULL,
false))
goto next;