Closed Kenny0793 closed 2 years ago
My config file: root@mygateway:/tmp/log# cat /etc/cifs/smb.conf [global] netbios name = mygateway workgroup = SC-LVG server min protocol = SMB2_02 server string = mygateway Sharing Files [TEAM2] comment = Share TEAM2 directory path = /mnt/sda1 browsable = yes available = yes valid users = admin read only = yes write list = admin I also changed the shared path to a directory on the disk instead of the U disk, the problem is the same.
Can you provide wireshark dump or tcpdump to us ?
Hi namjaejeon,
I upload the wireshark dump. I explain my test cases in README.txt. Could you help check and give your suggestion? Thanks.
BR Kenny
correct one point for case2, delete file ttttt.txt and pc hangs.
Thanks for your help, Let me check it.
Can you share what windows version(10, 10 pro? enterprise?) is used for test ?
Windows 10 enterprise. We also reproduce it in Windows7
For the same PC, I access samba(smbd) in linux, all are ok. Do you know why? We used the package is not the newest. If we upgrade to the newest cifsd, Can it fix the issue? thanks.
Okay, What ksmbd(cifsd) version are you using ?
root@mygateway:~# cifsd -h cifsd-tools version : 2.0.0 Usage: cifsd --p=NUM | --port=NUM TCP port NUM --c=smb.conf | --config=smb.conf config file --u=pwd.db | --users=pwd.db Users DB --n | --nodetach Don't detach --s | --systemd Service mode --uid Set process UID --gid Set process GID
I can download the newest package cifsd-tools-2019-11-27-06fd4153. The version is 2.0.2. So is it the newest?
Oh.. too old version. Please. Can you check the latest version ?
we rename cifsd to ksmbd. so utils name and directory name should be changed to ksmbd.(e.g. /etc/ksmbd/smb.conf) Please check them..
Hi namjaejeon ,
I know that ksmbd module was compiled via ksmbd: https://github.com/cifsd-team/ksmbd/releases/tag/3.4.1. But I want to test if it work well in Debian GNU/Linux 10. Do you know how to compile it in Debian? Thanks.
I also want to install cifsd in Debian, but it failed: g562046@shz-p5620460vl:~$ sudo modprobe kcifsd [sudo] password for g562046: modprobe: FATAL: Module kcifsd not found in directory /lib/modules/4.19.98arg g562046@shz-p5620460vl:~$ g562046@shz-p5620460vl:~$ g562046@shz-p5620460vl:~$ sudo cifsd -n [cifsd-worker/13918]: ERROR: Cannot resolve netlink family
I think that it may be caused by missing kernel module kcifsd, Could you tell me how to install it? thanks in advance.
Have you try a step in REAME of ksmbd ? See: https://github.com/cifsd-team/ksmbd-tools/blob/master/README
If you installed ksmbd well, you should command modprobe ksmbd, not kcifsd. and should run ksmbd.mountd instead of cifsd.
yes, i am trying the steps in readme. i want to install cifsd and ksmbd in linux host. and compare new tool ksmbd if can fix the issue. my issue is how to compile kernel module kcifsd and ksmbd. in my linux host, no such kernel modules by default. do you a wiki?
How did you install cifsd.ko before ? It is same with before. you can just command "make" and "make install" and modprobe ksmbd.
i run it in router before. now i want to test in kinux host, need to compile and generate kernel module separately. may be a little difference
Good morning, I loaded the module cifs.ko. g562046@shz-p5620460vl:~$ lsmod |grep cifs
cifs.ko is different with cifisd. you should insmod cifsd.ko or ksmbd.ko to run cifsd -n.
Can you tell me where is the source code for module cifsd.ko?
You can download source code as per old cifsd version. See: https://github.com/cifsd-team/ksmbd/releases
I got it, thanks very much.
Hi, I can't compile the module ksmd. Does it need more higher kernel version support? My kernel is 4.19.98 or 4.9.198.
g562046@shz-p5620460vl:/usr/src/linux/fs/ksmbd$ sudo make
[sudo] password for g562046:
make -C /lib/modules/4.19.98arg/build M=/usr/src/linux-headers-4.19.98arg/fs/ksmbd modules
make[1]: Entering directory '/usr/src/linux-headers-4.19.98arg'
CC [M] /usr/src/linux-headers-4.19.98arg/fs/ksmbd/auth.o
In file included from /usr/src/linux-headers-4.19.98arg/fs/ksmbd/auth.c:28:
/usr/src/linux-headers-4.19.98arg/fs/ksmbd/mgmt/user_session.h:57:18: error: field ‘tree_conns’ has incomplete type
struct xarray tree_conns;
^~~~~~
/usr/src/linux-headers-4.19.98arg/fs/ksmbd/auth.c: In function ‘smbhash’:
/usr/src/linux-headers-4.19.98arg/fs/ksmbd/auth.c:92:17: error: storage size of ‘ctx’ isn’t known
struct des_ctx ctx;
^~~
/usr/src/linux-headers-4.19.98arg/fs/ksmbd/auth.c:100:2: error: implicit declaration of function ‘des_expand_key’; did you mean ‘des_ekey’? [-Werror=implicit-function-declaration]
des_expand_key(&ctx, key2, DES_KEY_SIZE);
^~~~~~
des_ekey
/usr/src/linux-headers-4.19.98arg/fs/ksmbd/auth.c:101:2: error: implicit declaration of function ‘des_encrypt’; did you mean ‘des_ekey’? [-Werror=implicit-function-declaration]
des_encrypt(&ctx, out, in);
^~~
Which ksmbd package can match with my kernel version 4.19.98 or 4.9.198? I can't upgrade my kernel version. Looking forward to you reply. thanks.
ksmbd: release 3.3.1 version is ok. I will try it.
Hi namjaejeon, Good morning, I tested the ksmbd-tools 3.3.7, the issue still exist. I uploaded the wireshark dump. Could you help check and give you suggestion? Is it possible to fix it? thanks in advance.
ksmbd-tools version : 3.3.7
#lsmod |grep -i ksmb
ksmbd 282624 0
#ps -aux |grep -i ksmbd
root 14302 0.0 0.0 8356 2100 ? Ss 10:10 0:00 ksmbd.mountd
root 14303 0.0 0.0 18132 3784 ? S 10:10 0:00 ksmbd.mountd
root 14304 0.0 0.0 0 0 ? S 10:10 0:00 [ksmbd-lo]
root 14305 0.0 0.0 0 0 ? S 10:10 0:00 [ksmbd-eth0]
#cat /etc/ksmbd/smb.conf
[global]
netbios name = SMBD
[TEAM2]
comment = content server share
path = /home/g562046
browsable = yes
available = yes
valid users = g562046
read only = yes
write list = g562046
BR Kenny
Change read only = yes to no, issue is the same. If accessing samba only with IP: \192.168.0.4, are all ok. cat /etc/ksmbd/smb.conf [global] netbios name = SMBD
[TEAM2] comment = content server share path = /home/g562046 browsable = yes available = yes valid users = g562046 read only = no write list = g562046
Hm.. strange.. no clue in dump. Can you reproduce it on samba server & win 10 enterprise ? and provide me dump file while reproducing by doing same step. I want to compare dump file between samba and ksmbd.
I do same steps using samba server & win 10 enterprise, are all ok. Please help check it, thanks.
[sudo] password for g562046:
tcp 0 0 0.0.0.0:445 0.0.0.0: LISTEN 2043/smbd
tcp6 0 0 :::445 ::: LISTEN 2043/smbd
[TEAM2] path = /home/g562046 valid users = g562046 available = yes browseable = yes writable = yes public = no
Acutally I don't know what is difference. So I need to request you some test. because I can not reproduce this issue. Can you add "share:fake_fscaps = 0" in [global] section and try to reproduce again ?
[global] share:fake_fscaps = 0
It seems to be ok. I will do more test. Can you tell me what this option does? Does it have similar options for cifsd (2.0.0.0)? Thanks
This option is set to flags for sparse file. and this option is not in cifsd 2.0.
Conversely, can you set below parameter in Samba's smb.conf and check if there is same problem on samba?
[global] share:fake_fscaps = 64
Hi namjaejeon,
Sorry, after I changed to another PC (win10 Enterprise), the issue still exist. After rebooting my PC, I also can reproduce it. I don't know why it is ok before, may be I tested SMB server. I upload the packets, could you help check it? If need more test, I will do it now. thanks.
tcp6 0 0 :::445 ::: LISTEN -
tcp6 0 0 :::445 ::: LISTEN -
[global] netbios name = SMBD share:fake_fscaps = 0
[TEAM2] comment = content server share path = /home/g562046 browsable = yes available = yes valid users = g562046 read only = no write list = g562046
BR Kenny
Conversely, can you set below parameter in Samba's smb.conf and check if there is same problem on samba? [global] share:fake_fscaps = 64
Yes, I test it on samba, it is ok.
because I can not reproduce this issue.
I think that it is easy to reproduce with win10 when accessing samba with full path \IP\sharename. if only use \IP, it is ok.
I think that it is easy to reproduce with win10 when accessing samba with full path \IP\sharename. if only use \IP, it is ok.
stranged.. If you use network drive connection ?
I try to reproduce it with \IP\sharename address as you share, It work fine on my setup(can't reproduce). and don't use writable = yes in smb.conf. Please use "read only = no" or "writeable =yes"
stranged.. If you use network drive connection ?
Sorry, I don't understand it well. When accessing samba, I will open explorer.exe each time and enter \IP\sharename. I don't map it to local network driver. Writable=yes is included in the config file of samba. For /etc/ksmbd/smb.conf, I only use the "read only = no".
Is it possible to redirect to \IP even if user access with full path \IP\sharename? I checked the packets, when accessing with full path, windows first call NetShareEnumAll, and then all are ok.
not possible. Have you tried to map network drive in windows ?
No,I did not map network drive in windows. During using, we also do not map it. If not possibile to redirect it. Do you have any good suggestion to fix it?
I really want to fix it. but If I can't reproduce it, there are some limitations to fix it. I suggest two options.
when accessing samba with full path, all windows we are using, win10 & win7,can reproduce the issue. our user also can reproduce it. okay, i will try to do it.
What is meaning our user ? Can I ask what your product is using ksmbd ?
when accessing samba with full path
samba means ksmbd ? ksmbd is kernel server and samba is userspace smb server. they are different. just curious.
router
Hi All,
BR Kenny