cifsd-team / ksmbd

ksmbd kernel server(SMB/CIFS server)
152 stars 23 forks source link

Sonos SMB1 #428

Closed bosim closed 3 years ago

bosim commented 4 years ago

I am running the latest DDWRT build (43845), with syslog showing Linux kernel CIFS/SMB SERVER 3.2.3 by Namjae Jeon <linkinjeon@kernel.org>.

I am trying to get my Sonos devices using the share on the DDWRT router, however it fails. The App loads for a while and then say it cannot connect.

I then ran echo "all" > /sys/class/ksmbd-control/debug to get the debug log which gave me:

Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_conn_handler_loop:314: RFC1002 header 69 bytes
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: check_smb1_hdr:32: got SMB
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: smb1_calc_size:195: SMB2 byte count 34, struct size : 0
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: smb1_calc_size:199: SMB1 len 69
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLM1.2X002
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLANMAN2.1
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BNT LM 0.12
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLM1.2X002
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLANMAN2.1
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BNT LM 0.12
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLM1.2X002
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLANMAN2.1
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BNT LM 0.12
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLM1.2X002
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLANMAN2.1
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BNT LM 0.12
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLM1.2X002
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLANMAN2.1
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BNT LM 0.12
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLM1.2X002
Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLANMAN2.1
Jul 21 20:33:50 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BNT LM 0.12
Jul 21 20:33:50 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLM1.2X002
Jul 21 20:33:50 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLANMAN2.1
Jul 21 20:33:50 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BNT LM 0.12
Jul 21 20:33:50 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:220: selected NT1 dialect
Jul 21 20:33:50 gateway kern.info kernel: ksmbd: ksmbd_smb_negotiate_common:475: conn->dialect 0x2

And then it stops. I tried with NT_1 as both min and max server version, same result.

namjaejeon commented 4 years ago

Okay, Can you give me a tcpdump that captured the packets on problem ? and your client can connect with samba server ? If yes, please give me a tcpdump that captured packets between sonos SMB1 and samba.

sergey-senozhatsky commented 4 years ago

On (20/07/21 11:42), Bo Simonsen wrote:

Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLM1.2X002 Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLANMAN2.1 Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BNT LM 0.12 Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLM1.2X002 Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLANMAN2.1 Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BNT LM 0.12 Jul 21 20:33:49 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:216: client requested dialect ^BLM1.2X002

Hmm. I this off-by-one error? Those ^B don't look right in the %s dialect output.

-ss
namjaejeon commented 4 years ago

Jul 21 20:33:50 gateway kern.info kernel: ksmbd: ksmbd_lookup_dialect_by_name:220: selected NT1 dialect Jul 21 20:33:50 gateway kern.info kernel: ksmbd: ksmbd_smb_negotiate_common:475: conn->dialect 0x2

Yep, But I can see a print that SMB1 dialect is selected, and there are no more logs after that.

bosim commented 3 years ago

See comment in #430

Neustradamus commented 3 years ago

@bosim: Any news? Have you looked all https://github.com/cifsd-team/cifsd/issues/430 comments?