Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to share /tmp and /etc directories from linux to windows using ksmbd-tool #326

Open
vishnumotghare-eaton opened this issue Jan 28, 2025 · 6 comments

Comments

@vishnumotghare-eaton
Copy link

vishnumotghare-eaton commented Jan 28, 2025

Hello All,

I’m encountering an issue while trying to share the /etc or /tmp directories from my Linux system and access them from Windows. Despite following the steps outlined in the ksmbd-tools usage guide, I am unable to successfully share these directories. Interestingly, I can share subdirectories like '/etc/settings' or '/tmp/settings', but not the main '/etc' or '/tmp' directory itself.

Here is my current configuration:

[global]
        ; global parameters
        log file = /var/log/ksmbd.log
        server string = ksmbd Server
        workgroup = WORKGROUP

[MyShare]
        ; share parameters
        force group = root
        force user = root
        path = /etc
        read only = no

Error message from windows:

Image

Has anyone else faced a similar issue or have any suggestions on how to resolve this? Any help would be greatly appreciated!

@namjaejeon
Copy link
Member

@vishnumotghare-eaton Is this issue also coming with the latest ksmbd? What is the Windows version?

@vishnumotghare-eaton
Copy link
Author

@namjaejeon This issue is also present with the latest ksmbd. I have tested it on both Windows 11 and Windows 10, and the problem persists on both versions. When I try to open the shared location from File Explorer, I receive a more detailed error message with better information. I'm using 5.15.163 kernel version

Image

Ksmbd kernel log messages:

[11063.019677] ksmbd: RFC1002 header 114 bytes
[11063.019744] ksmbd: skip to check tree connect request
[11063.019752] ksmbd: SMB2 data length 42 offset 72
[11063.019758] ksmbd: SMB2 len 114
[11063.019807] ksmbd: tree connect request for tree ipc$ treename \\192.168.119.248\IPC$
[11063.030445] ksmbd: IPC share path request
[11063.030475] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.034697] ksmbd: RFC1002 header 176 bytes
[11063.034787] ksmbd: SMB2 data length 48 offset 128
[11063.034797] ksmbd: SMB2 len 176
[11063.034858] ksmbd: get query maximal access context
[11063.035003] ksmbd: Error response: c000000d
[11063.035014] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.038330] ksmbd: RFC1002 header 132 bytes
[11063.038427] ksmbd: SMB2 data length 12 offset 120
[11063.038439] ksmbd: SMB2 len 132
[11063.038492] ksmbd: IPC pipe create request
[11063.040999] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.043806] ksmbd: RFC1002 header 104 bytes
[11063.043878] ksmbd: SMB2 data length 0 offset 104
[11063.043887] ksmbd: SMB2 len 105
[11063.043925] ksmbd: GOT query info request
[11063.043930] ksmbd: GOT SMB2_O_INFO_FILE
[11063.043934] ksmbd: FileInfoClass 5, FileId 0x0
[11063.043941] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.046607] ksmbd: RFC1002 header 104 bytes
[11063.046675] ksmbd: SMB2 data length 0 offset 104
[11063.046683] ksmbd: SMB2 len 105
[11063.046722] ksmbd: GOT query info request
[11063.046726] ksmbd: GOT SMB2_O_INFO_FILE
[11063.046730] ksmbd: FileInfoClass 24, FileId 0x0
[11063.046736] ksmbd: smb2_info_file_pipe for 24 not supported
[11063.046741] ksmbd: error while processing smb2 query rc = -95
[11063.046746] ksmbd: Failed to process 16 [-95]
[11063.046751] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.051169] ksmbd: RFC1002 header 272 bytes
[11063.051238] ksmbd: SMB2 data length 160 offset 112
[11063.051247] ksmbd: SMB2 len 272
[11063.051294] ksmbd: IPC pipe write request
[11063.051622] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.054447] ksmbd: RFC1002 header 113 bytes
[11063.054511] ksmbd: SMB2 data length 0 offset 0
[11063.054518] ksmbd: SMB2 len 113
[11063.054557] ksmbd: IPC pipe read request
[11063.055234] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.066697] ksmbd: RFC1002 header 224 bytes
[11063.071478] ksmbd: SMB2 data length 104 offset 120
[11063.071506] ksmbd: SMB2 len 224
[11063.072305] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.079385] ksmbd: RFC1002 header 88 bytes
[11063.079452] ksmbd: SMB2 len 88
[11063.079494] ksmbd: IPC pipe close request
[11063.079857] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.098347] ksmbd: RFC1002 header 232 bytes
[11063.098578] ksmbd: SMB2 data length 104 offset 128
[11063.098590] ksmbd: SMB2 len 232
[11063.098642] ksmbd: get query maximal access context
[11063.098678] ksmbd: Error response: c000000d
[11063.098687] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.106313] ksmbd: RFC1002 header 232 bytes
[11063.106791] ksmbd: RFC1002 header 248 bytes
[11063.107053] ksmbd: SMB2 data length 104 offset 128
[11063.107064] ksmbd: SMB2 len 232
[11063.107112] ksmbd: get query maximal access context
[11063.107148] ksmbd: Error response: c000000d
[11063.107156] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.107278] ksmbd: SMB2 data length 104 offset 144
[11063.107288] ksmbd: SMB2 len 248
[11063.107324] ksmbd: converted name = desktop.ini
[11063.107332] ksmbd: get query maximal access context
[11063.107639] ksmbd: can not get linux path for desktop.ini, rc = -2
[11063.107653] ksmbd: Error response: c0000034
[11063.107659] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.111104] ksmbd: RFC1002 header 232 bytes
[11063.111239] ksmbd: SMB2 data length 104 offset 128
[11063.111248] ksmbd: SMB2 len 232
[11063.111300] ksmbd: get query maximal access context
[11063.111334] ksmbd: Error response: c000000d
[11063.111342] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.115727] ksmbd: RFC1002 header 232 bytes
[11063.115795] ksmbd: SMB2 data length 104 offset 128
[11063.115803] ksmbd: SMB2 len 232
[11063.115854] ksmbd: get query maximal access context
[11063.115885] ksmbd: Error response: c000000d
[11063.115892] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.121771] ksmbd: RFC1002 header 232 bytes
[11063.121841] ksmbd: SMB2 data length 104 offset 128
[11063.121849] ksmbd: SMB2 len 232
[11063.121975] ksmbd: get query maximal access context
[11063.122011] ksmbd: Error response: c000000d
[11063.122021] ksmbd: credits: requested[1] granted[1] total_granted[107]
[11063.124361] ksmbd: RFC1002 header 176 bytes
[11063.124407] ksmbd: SMB2 data length 48 offset 128
[11063.124414] ksmbd: SMB2 len 176
[11063.124445] ksmbd: get query maximal access context
[11063.124471] ksmbd: Error response: c000000d
[11063.124477] ksmbd: credits: requested[1] granted[1] total_granted[107]

@vishnumotghare-eaton
Copy link
Author

@namjaejeon I misunderstood your comment and tested with the latest ksmd-tools instead of ksmbd. After checking with the latest ksmbd code, I was able to mount /etc and other directories successfully. Thank you for your support

@namjaejeon
Copy link
Member

@vishnumotghare-eaton Can you tell what is the latest ksmbd code ? It is in linux-5.15.177 ? or github ksmbd master branch ?

@vishnumotghare-eaton
Copy link
Author

@namjaejeon It worked with the GitHub ksmbd master branch (commit 64073dd44d8abe4baeff2278010f18231f583ed1). I also tested it with the linux-5.15.177 kernel source, it did not work.

@vishnumotghare-eaton
Copy link
Author

@namjaejeon Will this fix be available for the 5.15.x version? I’m not sure which commits from the master branch address the issue, but I can find them. Is it okay if I backport the fix to the 5.15.x kernel and create a PR for it?”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants