linux/fs/smb/server/mgmt
Shuhao Fu a74668eb2c ksmbd: fail share config requests when path allocation fails
Non-pipe shares must have a duplicated backing path before they can be
published. share_config_request() currently calls kstrndup() for that
path, but if the allocation fails it leaves ret unchanged. If veto list
parsing succeeds and share->name exists, the partially built share is
still inserted into the global share table with share->path left NULL.

A later share-root SMB2 create uses tree_conn->share_conf->path as the
lookup root. If the share was published with path == NULL, that request
passes a NULL pathname into do_getname_kernel()/strlen() and can crash
the ksmbd worker.

Set ret = -ENOMEM when path duplication fails so the incomplete share is
destroyed before publication.

Fixes: e2f34481b2 ("cifsd: add server-side procedures for SMB3")
Signed-off-by: Shuhao Fu <sfual@cse.ust.hk>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2026-05-01 21:49:35 -05:00
..
ksmbd_ida.c ksmbd: use __GFP_RETRY_MAYFAIL 2024-11-25 18:58:02 -06:00
ksmbd_ida.h
share_config.c ksmbd: fail share config requests when path allocation fails 2026-05-01 21:49:35 -05:00
share_config.h ksmbd: override fsids for share path check 2024-08-08 22:54:09 -05:00
tree_connect.c ksmbd: fix share_conf UAF in tree_conn disconnect 2026-03-17 21:45:29 -05:00
tree_connect.h ksmbd: fix use-after-free in ksmbd_tree_connect_put under concurrency 2025-11-30 21:11:45 -06:00
user_config.c ksmbd: validate response sizes in ipc_validate_msg() 2026-04-18 12:19:59 -05:00
user_config.h ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
user_session.c ksmbd: scope conn->binding slowpath to bound sessions only 2026-04-22 08:11:23 -05:00
user_session.h ksmbd: convert tree_conns_lock to rw_semaphore 2026-02-09 17:48:53 -06:00