Re: CIFS regression mounting vers=1.0 NTLMSSP when hostname is too long

From: Paulo Alcantara
Date: Tue May 17 2022 - 16:37:44 EST


Hi Byron,

Byron Stanoszek <gandalf@xxxxxxxxx> writes:

> I would like to report a regression in the CIFS fs. Sometime between Linux 4.14
> and 5.16, mounting CIFS with option vers=1.0 (and
> CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y set appropriately) with security type
> NTLMSSP stopped working for me. The server side is a Windows 2003 Server.
>
> I found that this behavior depends on the length of the Linux client's
> host+domain name (e.g. utsname()->nodename), where the mount works as long as
> the name is 16 characters or less. Anything 17 or above returns -EIO, per the
> following example:
>
> /etc/fstab entry:
>
> //10.0.0.12/xxxxxxxxx /ext0 cifs vers=1.0,user=xxxxx,pass=xxxxxxxxxxx,dom=xxxxxxxxxxx,dir_mode=0755,file_mode=0644,noauto 0 0
>
> # hostname 12345678901234567;mount /ext0
> mount error(5): Input/output error
> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
> # hostname 1234567890123456;mount /ext0
> #

Could you please try below patch?

Let me know if I missed something else. Thanks.