Does linux smb2 client supports DFS capability?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Does linux smb2 client supports DFS capability?

Hemanth Thummala-2
Hello All,

I am trying to connect to a DFS enabled share from a linux(RHEL6) smb2 client. And I could see that, client just stops connecting the share as soon as it sees PATH NOT COVERED error. Then I have observed that its actually not negotiating the DFS capability at all.

It is mentioned in the following guide(by Steve French) that DFS support is not yet available.
https://pserver.samba.org/samba/ftp/cifs-cvs/linux-cifs-client-guide.pdf

I would like to know if there any recent work done to support the same.

Thanks,
Hemanth.
Reply | Threaded
Open this post in threaded view
|

Re: Does linux smb2 client supports DFS capability?

Aurélien Aptel-2
Hi Hemanth,

Hemanth Thummala <[hidden email]> writes:
> I would like to know if there any recent work done to support the same.

I have worked on adding DFS support in SMB2,3+. I have a WIP patch
available here [1]. It is functional but not ready to be merged yet:

- has to be cleaned up a bit to avoid code deduplication (requires some
  refactoring)
- but mainly it creates a good opportunity to improve the plumbing for
  DFS in general. We want to keep a cache of DFS resolve results in
  memory so that we can try several servers in case of server
  failure+reconnection, instead of just trying to reconnect to the same
  server that just failed.

So in short, yes it's in the works.

1: http://marc.info/?l=linux-cifs&m=147862283412953

--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

Reply | Threaded
Open this post in threaded view
|

Re: Does linux smb2 client supports DFS capability?

Hemanth Thummala-2
Hi Aurélien,

Sorry for the delayed response. Good to know that you have the patch for DFS support.
May I know approximate timeline of when these changes can be available in official release.

Also I have another question on SMB2 client wrt unix extensions. We observe that SMB1 client is able to fetch the UID and GID information in FIND_FIRST2 response. Hence we could see the proper UID and GID information on the linux SMB1 mount. Whereas in SMB2, we don’t see any response sharing the UID or GID details to client. Infact, I don’t see any INFO level for query directory which can request these details. “Unix extentions” is enabled on our stack. Are we missing any other config? Please suggest.

Thanks,
Hemanth.






On 1/9/17, 5:20 AM, "Aurélien Aptel" <[hidden email]> wrote:

>Hi Hemanth,
>
>Hemanth Thummala <[hidden email]> writes:
>> I would like to know if there any recent work done to support the same.
>
>I have worked on adding DFS support in SMB2,3+. I have a WIP patch
>available here [1]. It is functional but not ready to be merged yet:
>
>- has to be cleaned up a bit to avoid code deduplication (requires some
>  refactoring)
>- but mainly it creates a good opportunity to improve the plumbing for
>  DFS in general. We want to keep a cache of DFS resolve results in
>  memory so that we can try several servers in case of server
>  failure+reconnection, instead of just trying to reconnect to the same
>  server that just failed.
>
>So in short, yes it's in the works.
>
>1: http://marc.info/?l=linux-cifs&m=147862283412953
>
>--
>Aurélien Aptel / SUSE Labs Samba Team
>GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
>SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
>GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
Reply | Threaded
Open this post in threaded view
|

Re: Does linux smb2 client supports DFS capability?

Aurélien Aptel-2
Hi Hemanth,

Hemanth Thummala <[hidden email]> writes:
> Sorry for the delayed response. Good to know that you have the patch
> for DFS support.  May I know approximate timeline of when these
> changes can be available in official release.

Between the design, implemention and the reviewing/editing loop I can't
really say for sure but sometime in the next 3 months seems like a
reasonable estimate for the patch to land in master.

> Also I have another question on SMB2 client wrt unix extensions. We
> observe that SMB1 client is able to fetch the UID and GID information
> in FIND_FIRST2 response. Hence we could see the proper UID and GID
> information on the linux SMB1 mount. Whereas in SMB2, we don’t see any
> response sharing the UID or GID details to client. Infact, I don’t see
> any INFO level for query directory which can request these
> details. “Unix extentions” is enabled on our stack. Are we missing any
> other config? Please suggest.

You're not missing anything, the unix extension was designed for SMB1
only. For newer versions of the protocol well it's still at the design
phase I'm afraid. There are some wiki pages on this [1], [2].

However with the recent security annoucements [3] that recommends
disabling SMB1 altogether we can expect to see more work on this soon.

1: https://wiki.samba.org/index.php/SMB3-Linux
2: https://wiki.samba.org/index.php/UNIX_Extensions
3: https://www.us-cert.gov/ncas/current-activity/2017/01/16/SMB-Security-Best-Practices

Cheers,

--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

Reply | Threaded
Open this post in threaded view
|

Re: Does linux smb2 client supports DFS capability?

Samba - samba-technical mailing list
In reply to this post by Aurélien Aptel-2
If you are checking if the SMB3 DFS enablement has been added to your
kernel (if your kernel is older than version 4.11), you could look to
see if the equivalent of this patch (it is part of a small series of
DFS related patches, but would be one of the more visible ones in the
series)

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/cifs?id=9d49640a21bffd730a6ebf2a0032e022f7caf84a


On Wed, Oct 11, 2017 at 6:47 AM, Aurélien Aptel <[hidden email]> wrote:

> Hi,
>
> Hemanth Thummala <[hidden email]> writes:
>> If so, Can you please let me know (or point me a link) the version of cifs-utils in which support is available.
>> I have tested with cifs-util-6.2 version. This doesn’t have the DFS support.
>
> cifs-util only contains the source code of the the mount.cifs program,
> which doesn't do much. The SMB client code lives in the cifs kernel
> module. To use DFS with SMB2 you need to use linux kernel v4.11 or
> newer.
>
> Cheers,
>
> --
> Aurélien Aptel / SUSE Labs Samba Team
> GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
> SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
> GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)



--
Thanks,

Steve

Reply | Threaded
Open this post in threaded view
|

Re: Does linux smb2 client supports DFS capability?

Samba - samba-technical mailing list
On Wed, Oct 11, 2017 at 7:25 AM, Steve French <[hidden email]> wrote:

> If you are checking if the SMB3 DFS enablement has been added to your
> kernel (if your kernel is older than version 4.11), you could look to
> see if the equivalent of this patch (it is part of a small series of
> DFS related patches, but would be one of the more visible ones in the
> series)
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/cifs?id=9d49640a21bffd730a6ebf2a0032e022f7caf84a
>
>
> On Wed, Oct 11, 2017 at 6:47 AM, Aurélien Aptel <[hidden email]> wrote:
>> Hi,
>>
>> Hemanth Thummala <[hidden email]> writes:
>>> If so, Can you please let me know (or point me a link) the version of cifs-utils in which support is available.
>>> I have tested with cifs-util-6.2 version. This doesn’t have the DFS support.
>>
>> cifs-util only contains the source code of the the mount.cifs program,
>> which doesn't do much. The SMB client code lives in the cifs kernel
>> module. To use DFS with SMB2 you need to use linux kernel v4.11 or
>> newer.
>>
>> Cheers,

I think their real interest is in the CIFS FS getting DFS referrals if
STATUS_PATH_NOT_COVERED is returned on a CREATE.

When I last looked the client could not do that.

--
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)

Reply | Threaded
Open this post in threaded view
|

Re: Does linux smb2 client supports DFS capability?

Samba - samba-technical mailing list
Thanks Aurélien and Steve for letting me the correct version in which DFS support is added.

We have actually checked the linux CIFS Kernel wiki page<https://wiki.samba.org/index.php/LinuxCIFSKernel>. It has only updates till version 4.9.
Not sure if this wiki is active. If not, please share the page where we can check the latest updates.

As Richard mentioned, we are looking for DFS support for both Share(root referral) and
Objects(link referrals) Inside the share for linux clients. Please confirm if the support
Is added for both type of referrals.

Thanks,
Hemanth.

On 11/10/17, 9:42 AM, "Richard Sharpe" <[hidden email]<mailto:[hidden email]>> wrote:

On Wed, Oct 11, 2017 at 7:25 AM, Steve French <[hidden email]<mailto:[hidden email]>> wrote:
If you are checking if the SMB3 DFS enablement has been added to your
kernel (if your kernel is older than version 4.11), you could look to
see if the equivalent of this patch (it is part of a small series of
DFS related patches, but would be one of the more visible ones in the
series)

https://urldefense.proofpoint.com/v2/url?u=https-3A__git.kernel.org_pub_scm_linux_kernel_git_torvalds_linux.git_commit_fs_cifs-3Fid-3D9d49640a21bffd730a6ebf2a0032e022f7caf84a&d=DwIFaQ&c=s883GpUCOChKOHiocYtGcg&r=upHhZKvLG1wGJVQsvdamubutehC8co9bx_lsVXPKCKw&m=tyJQY4YD9WF1-yndr4GHusIbLTsVxrev2RhubPuMHHk&s=lpstSB8C2nmjNZg_IMmODglHRbRMrFISB1nIlwyVLas&e=


On Wed, Oct 11, 2017 at 6:47 AM, Aurélien Aptel <[hidden email]<mailto:[hidden email]>> wrote:
Hi,

Hemanth Thummala <[hidden email]<mailto:[hidden email]>> writes:
If so, Can you please let me know (or point me a link) the version of cifs-utils in which support is available.
I have tested with cifs-util-6.2 version. This doesn’t have the DFS support.

cifs-util only contains the source code of the the mount.cifs program,
which doesn't do much. The SMB client code lives in the cifs kernel
module. To use DFS with SMB2 you need to use linux kernel v4.11 or
newer.

Cheers,

I think their real interest is in the CIFS FS getting DFS referrals if
STATUS_PATH_NOT_COVERED is returned on a CREATE.

When I last looked the client could not do that.

--
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)

Reply | Threaded
Open this post in threaded view
|

Re: Does linux smb2 client supports DFS capability?

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
Richard Sharpe <[hidden email]> writes:
> I think their real interest is in the CIFS FS getting DFS referrals if
> STATUS_PATH_NOT_COVERED is returned on a CREATE.
>
> When I last looked the client could not do that.

cifs.ko should be able to traverse a DFS link on the FS, after the DFS
mounted. My testing setup when I worked on this was the following:

//A/root
       |
       +- link -> //B/target
       +- sublink -> //B/target/sub

//B/target
       |
       + sub/
          |
          + dir/
              |
              + files..

And I had a script
- mounting //A/root and running cd&ls in /, /link, /link/sub,
  /link/sub/dir, /sublink, /sublink/dir
- mounting //A/root/link and running cd&ls in /, /sub, /sub/dir
- mounting //A/root/link/sub and running cd&ls in /, /dir
- mounting //A/root/sublink and running cd&ls in /, /dir
- mounting //A/root/sublink/dir and running cd&ls in /

And all worked for vers={1.0,3.0}, A being {samba, Windows Server 2016},
B being {samba, Windows Server 2012 R2} when I submitted the patches.

--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)