Re: [PATCH] ksmbd: require NUL-terminated EA names

From: Namjae Jeon

Date: Mon Nov 02 2026 - 18:34:15 EST


> @@ -3419,6 +3419,11 @@ static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
> if (!eabuf->EaNameLength)
> goto next;
>
> + if (eabuf->name[eabuf->EaNameLength]) {
> + rc = -EINVAL;
The NULL-termination check looks correct, but returning -EINVAL here
causes smb2_set_info() to return STATUS_INVALID_PARAMETER. MS-SMB2
section 3.3.5.21.1 describes STATUS_EA_LIST_INCONSISTENT as the error
response for a malformed EA buffer. Please return -EBADMSG for this EA
format error and map it to STATUS_EA_LIST_INCONSISTENT in
smb2_set_info(). Since smb2_set_ea() is also called from SMB2 CREATE,
you need to update the error handling for that caller as well. Also,
the patch was sent with quoted-printable encoding. Please send it as
plain text, preferably using git send-email.
Thanks!