Re: [PATCH 3/5] cifs: Fix validation of SMB2_OP_QUERY_WSL_EA response size

From: Paulo Alcantara
Date: Sun Jun 08 2025 - 19:12:14 EST


Pali Rohár <pali@xxxxxxxxxx> writes:

> On Sunday 08 June 2025 18:49:43 Paulo Alcantara wrote:
>> Pali Rohár <pali@xxxxxxxxxx> writes:
>>
>> If we're querying all those EAs and the file has only $LXMOD, wouldn't
>> the server return empty EAs except for $LXMOD?
>
> We are using FILE_FULL_EA_INFORMATION for querying EAs, which means that
> always all stored EAs are returned. It is not 4 calls (one by one), but
> rather one call to return everything at once.

Yes.

> Windows server in this case returns just one EA in its response: $LXMOD EA.
> And SMB2_WSL_MIN_QUERY_EA_RESP_SIZE specifies that at least 3 EAs must
> be returned, otherwise check_wsl_eas() throws error and do not try to
> parse response.

Can you share a trace of the server returning only a single EA in the
response when we query $LXUID, $LXGID, $LXMOD and $LXDEV?

What I mean is that we query all those EAs when we find reparse points
on non-POSIX mounts, and if the file doesn't have them, the server still
returns the EAs but with a zero smb2_file_full_ea_info::ea_value_len.
check_wsl_eas() skips the EA when is @vlen zero.