Re: [PATCH 2/2] ksmbd: put the workgroup into the NTLMSSP target info's domain names

From: Namjae Jeon

Date: Sun Oct 18 2026 - 22:00:32 EST


---
fs/smb/server/auth.c | 41 ++++++++++++++++++++++++++++++++++-------
fs/smb/server/smb2pdu.c | 21 +++++++++++++++++++--
2 files changed, 53 insertions(+), 9 deletions(-)

diff --git a/fs/smb/server/auth.c b/fs/smb/server/auth.c
index 9a2a3c6a37..8639997080 100644
--- a/fs/smb/server/auth.c
+++ b/fs/smb/server/auth.c
@@ -376,10 +376,10 @@ ksmbd_build_ntlmssp_challenge_blob(struct challenge_m=
essage *chgblob,
=09=09=09=09 struct ksmbd_conn *conn)
{
=09struct target_info *tinfo;
-=09wchar_t *name;
+=09wchar_t *name, *domain;
=09__u8 *target_name;
=09unsigned int flags, blob_off, blob_len, type, target_info_len =3D 0;
-=09int len, uni_len, conv_len;
+=09int len, uni_len, dom_len, conv_len;
=09int cflags =3D conn->ntlmssp.client_flags;
=20
=09memcpy(chgblob->Signature, NTLMSSP_SIGNATURE, 8);
@@ -426,6 +426,23 @@ ksmbd_build_ntlmssp_challenge_blob(struct challenge_me=
ssage *chgblob,
=20
=09uni_len =3D UNICODE_LEN(conv_len);
=20
+=09len =3D strlen(ksmbd_work_group());
+=09domain =3D kmalloc(2 + UNICODE_LEN(len), KSMBD_DEFAULT_GFP);
+=09if (!domain) {
+=09=09kfree(name);
+=09=09return -ENOMEM;
+=09}

The patch is quoted-printable encoded. Could you send it as plain text
when you submit the next version?