summaryrefslogtreecommitdiffstats
path: root/fs/ksmbd/misc.h
diff options
context:
space:
mode:
authorAtte Heikkilä <atteh.mailbox@gmail.com>2022-10-03 01:09:34 +0200
committerSteve French <stfrench@microsoft.com>2022-10-05 08:15:44 +0200
commitf5ba1cdaf5eb380e148183bda06d4844b457d095 (patch)
tree7dcec37b1ed5813e6bfc437b279cc9caf6b1a58c /fs/ksmbd/misc.h
parentksmbd: call ib_drain_qp when disconnected (diff)
downloadlinux-f5ba1cdaf5eb380e148183bda06d4844b457d095.tar.xz
linux-f5ba1cdaf5eb380e148183bda06d4844b457d095.zip
ksmbd: validate share name from share config response
Share config response may contain the share name without casefolding as it is known to the user space daemon. When it is present, casefold and compare it to the share name the share config request was made with. If they differ, we have a share config which is incompatible with the way share config caching is done. This is the case when CONFIG_UNICODE is not set, the share name contains non-ASCII characters, and those non- ASCII characters do not match those in the share name known to user space. In other words, when CONFIG_UNICODE is not set, UTF-8 share names now work but are only case-insensitive in the ASCII range. Signed-off-by: Atte Heikkilä <atteh.mailbox@gmail.com> Acked-by: Tom Talpey <tom@talpey.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to '')
-rw-r--r--fs/ksmbd/misc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ksmbd/misc.h b/fs/ksmbd/misc.h
index cc72f4e6baf2..1facfcd21200 100644
--- a/fs/ksmbd/misc.h
+++ b/fs/ksmbd/misc.h
@@ -20,6 +20,7 @@ int get_nlink(struct kstat *st);
void ksmbd_conv_path_to_unix(char *path);
void ksmbd_strip_last_slash(char *path);
void ksmbd_conv_path_to_windows(char *path);
+char *ksmbd_casefold_sharename(struct unicode_map *um, const char *name);
char *ksmbd_extract_sharename(struct unicode_map *um, const char *treename);
char *convert_to_unix_name(struct ksmbd_share_config *share, const char *name);