Re: [RFC PATCH 3/6] ksmbd: pass the domain of an NTLM login to user space

From: Ian Bridges

Date: Wed Nov 11 2026 - 11:05:48 EST


Hi Jan,

On Tue, Nov 10, 2026 at 09:02:41AM +0000, Jan Koester wrote:
> + if (domain && domain[0] &&
> + strlen(domain) < KSMBD_REQ_MAX_DOMAIN_NAME_SZ) {
> + req->flags |= KSMBD_LOGIN_REQ_DOMAIN;
> + strscpy(req->domain, domain, KSMBD_REQ_MAX_DOMAIN_NAME_SZ);
> + }

Is a domain of 48 bytes or more meant to be left out here? User space
would then pick the account by its name alone, which is the ambiguity
this patch removes. NTLM puts no such limit on DomainName.
session_user() also seems to drop the domain when its bounds fall
outside the buffer or it cannot be decoded. Would it be safer to fail
the login in those cases rather than fall back to the account name
alone?

Thanks,
Ian