linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ksmbd not returning errors on unsupported dialects
@ 2023-03-20 18:43 Steve French
  2023-03-20 23:31 ` Namjae Jeon
  0 siblings, 1 reply; 2+ messages in thread
From: Steve French @ 2023-03-20 18:43 UTC (permalink / raw)
  To: Namjae Jeon, CIFS; +Cc: David Howells

David Howells had noticed that ksmbd returned "Input/output error"
when mounting with vers=2.0 to ksmbd.    Looking at this more
carefully, mounting to ksmbd works with 3.1.1 (and 3.0 and 2.1) as
expected, but he is correct it fails with the wrong error for
unsupported dialects like 2.0. ksmbd would be expected to fail with
mounts with vers-2.1 but this error would be confusing to users.

The problem is that ksmbd is returning STATUS_SUCESS on the negprot in
the first part of the SMB1 header, but returning no information in the
NegProt part of the response (e.g. StructureSize, SecurityMode,
Dialect etc.)

Looks like the bug is that you meant to return a status not supported
or similar but left that out (or similar to what you do with vers=1.0,
kill the socket which causes HOST DOWN to be returned by the Linux
client).

MS-SMB2 3.3.5.4 may have the exact error that is best to return in this case

-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ksmbd not returning errors on unsupported dialects
  2023-03-20 18:43 ksmbd not returning errors on unsupported dialects Steve French
@ 2023-03-20 23:31 ` Namjae Jeon
  0 siblings, 0 replies; 2+ messages in thread
From: Namjae Jeon @ 2023-03-20 23:31 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS, David Howells

2023-03-21 3:43 GMT+09:00, Steve French <smfrench@gmail.com>:
> David Howells had noticed that ksmbd returned "Input/output error"
> when mounting with vers=2.0 to ksmbd.    Looking at this more
> carefully, mounting to ksmbd works with 3.1.1 (and 3.0 and 2.1) as
> expected, but he is correct it fails with the wrong error for
> unsupported dialects like 2.0. ksmbd would be expected to fail with
> mounts with vers-2.1 but this error would be confusing to users.
>
> The problem is that ksmbd is returning STATUS_SUCESS on the negprot in
> the first part of the SMB1 header, but returning no information in the
> NegProt part of the response (e.g. StructureSize, SecurityMode,
> Dialect etc.)
>
> Looks like the bug is that you meant to return a status not supported
> or similar but left that out (or similar to what you do with vers=1.0,
> kill the socket which causes HOST DOWN to be returned by the Linux
> client).
>
> MS-SMB2 3.3.5.4 may have the exact error that is best to return in this
> case
I will take a look.
Thanks for report!
>
> --
> Thanks,
>
> Steve
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-20 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 18:43 ksmbd not returning errors on unsupported dialects Steve French
2023-03-20 23:31 ` Namjae Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).