]> git.baikalelectronics.ru Git - kernel.git/commit
ksmbd: validate share name from share config response
authorAtte Heikkilä <atteh.mailbox@gmail.com>
Sun, 2 Oct 2022 23:09:34 +0000 (02:09 +0300)
committerSteve French <stfrench@microsoft.com>
Wed, 5 Oct 2022 06:15:44 +0000 (01:15 -0500)
commit5b3bea0901aa95dddbbae00fde584830d63ae5ad
tree7dcec37b1ed5813e6bfc437b279cc9caf6b1a58c
parentec936da03967d161fe37f9c937ab4fdc8b630f99
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>
fs/ksmbd/ksmbd_netlink.h
fs/ksmbd/mgmt/share_config.c
fs/ksmbd/mgmt/share_config.h
fs/ksmbd/mgmt/tree_connect.c
fs/ksmbd/misc.c
fs/ksmbd/misc.h