aboutsummaryrefslogtreecommitdiff
path: root/fs/ksmbd/connection.h
diff options
context:
space:
mode:
authorGravatar Atte Heikkilä <atteh.mailbox@gmail.com> 2022-09-15 22:49:11 +0900
committerGravatar Steve French <stfrench@microsoft.com> 2022-10-05 01:15:37 -0500
commit16b5f54e30c1ddec36bdf946a299b3254aace477 (patch)
treedf57c1e9c146006b13183ba9e8a117accdfc02c7 /fs/ksmbd/connection.h
parentksmbd: port to vfs{g,u}id_t and associated helpers (diff)
downloadlinux-16b5f54e30c1ddec36bdf946a299b3254aace477.tar.gz
linux-16b5f54e30c1ddec36bdf946a299b3254aace477.tar.bz2
linux-16b5f54e30c1ddec36bdf946a299b3254aace477.zip
ksmbd: casefold utf-8 share names and fix ascii lowercase conversion
strtolower() corrupts all UTF-8 share names that have a byte in the C0 (À ISO8859-1) to DE (Þ ISO8859-1) range, since the non-ASCII part of ISO8859-1 is incompatible with UTF-8. Prevent this by checking that a byte is in the ASCII range with isascii(), before the conversion to lowercase with tolower(). Properly handle case-insensitivity of UTF-8 share names by casefolding them, but fallback to ASCII lowercase conversion on failure or if CONFIG_UNICODE is not set. Refactor to move the share name casefolding immediately after the share name extraction. Also, make the associated constness corrections. Signed-off-by: Atte Heikkilä <atteh.mailbox@gmail.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/connection.h')
-rw-r--r--fs/ksmbd/connection.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ksmbd/connection.h b/fs/ksmbd/connection.h
index e7f7d5707951..41d96f5cef06 100644
--- a/fs/ksmbd/connection.h
+++ b/fs/ksmbd/connection.h
@@ -46,6 +46,7 @@ struct ksmbd_conn {
char *request_buf;
struct ksmbd_transport *transport;
struct nls_table *local_nls;
+ struct unicode_map *um;
struct list_head conns_list;
/* smb session 1 per user */
struct xarray sessions;