[PATCH] vfs: ignore shared VHDX create context by default

Tom Talpey ttalpey at microsoft.com
Thu Feb 25 18:09:38 UTC 2016


FYI, the document update is visible in the "Errata" page since it was corrected last November. You can see the changes here:

https://msdn.microsoft.com/en-us/library/dn785067.aspx

Sorry for the reformat and silly link rewriting in my reply quote below - my mail server seems to insist on this.

-----Original Message-----
From: samba-technical [mailto:samba-technical-bounces at lists.samba.org] On Behalf Of Jeremy Allison
Sent: Thursday, February 25, 2016 9:58 AM
To: Uri Simchoni <uri at samba.org>
Cc: samba-technical <samba-technical at lists.samba.org>
Subject: Re: [PATCH] vfs: ignore shared VHDX create context by default

On Thu, Feb 25, 2016 at 07:32:03AM +0200, Uri Simchoni wrote:
> Hi,
> 
> Attached is a fix for 
> https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fbugzi
> lla.samba.org%2fshow_bug.cgi%3fid%3d11753.&data=01%7c01%7cttalpey%40mi
> crosoft.com%7ce6bea9b5b68f4b1482c608d33e0de472%7c72f988bf86f141af91ab2
> d7cd011db47%7c1&sdata=h%2bP1XDnHD2vSJu9NwUKoMQojC96E2bQFx1ZDIbWFMmk%3d
> 
> This patch causes smbd to ignore SVHDX_OPEN_DEVICE_CONTEXT or
> SVHDX_OPEN_DEVICE_CONTEXT_V2 create contexts by default.
> 
> The default can be overriden by a VFS module if this module adds 
> support for RSVD protocol (not sure all the pieces are in there).
> 
> This fixes Windows backup against Samba 4.3.x series.
> 
> [MS-SMB2] rev 48.0 states (3.3.5.9.14) that the open should fail if 
> this create context is specified and the server does not support RSVD 
> (a.k.a. SCSI tunneling) protocol. However, according to discussions 
> with dochelp at microsoft.com, the context should be ignored in this 
> case.
> 
> Review/push appreciated.

LGTM (I've been following along on Dochelp :-). Pushed.

> From 77b91468158754908224dd3623e7ac8f2574e104 Mon Sep 17 00:00:00 2001
> From: Uri Simchoni <uri at samba.org>
> Date: Thu, 25 Feb 2016 07:08:06 +0200
> Subject: [PATCH] smbd: ignore SVHDX create context
> 
> According to discussions with dochelp at microsoft.com, an SMB server 
> should ignore an SVHDX_OPEN_DEVICE_CONTEXT or
> SVHDX_OPEN_DEVICE_CONTEXT_V2 create context if it does not support the 
> RSVD protocol. This is contrary to [MS-SMB2] rev 48.0 which states 
> (3.3.5.9.14) that the open should fail in this case.
> 
> Failing the create fails Windows backup if the SMB dialect is
> SMB3.0.2 or higher.
> 
> Hopefully a new revision of MS-SMB2 will clear this up in the future.
> 
> Meanwhile, this patch modifies smbd to ignore the 
> SVHDX_OPEN_DEVICE_CONTEXT by default. This can be overriden by a VFS 
> module if a VFS module adds support for RSVD.
> 
> BUG: 
> https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fbugzi
> lla.samba.org%2fshow_bug.cgi%3fid%3d11753&data=01%7c01%7cttalpey%40mic
> rosoft.com%7ce6bea9b5b68f4b1482c608d33e0de472%7c72f988bf86f141af91ab2d
> 7cd011db47%7c1&sdata=N4NwkL5daUT%2by55GDEyXGkSrokq0N7xtbFtCzLWJW6U%3d
> 
> Signed-off-by: Uri Simchoni <uri at samba.org>
> ---
>  source3/modules/vfs_default.c | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/source3/modules/vfs_default.c 
> b/source3/modules/vfs_default.c index 28f0257..10dcf30 100644
> --- a/source3/modules/vfs_default.c
> +++ b/source3/modules/vfs_default.c
> @@ -570,22 +570,6 @@ static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle,
>  				    const struct smb2_create_blobs *in_context_blobs,
>  				    struct smb2_create_blobs *out_context_blobs)  {
> -	struct smb2_create_blob *svhdx = NULL;
> -
> -	/*
> -	 * It might be empty ... and smb2_create_blob_find does not handle that
> -	 */
> -	if (in_context_blobs) {
> -		svhdx = smb2_create_blob_find(in_context_blobs,
> -					      SVHDX_OPEN_DEVICE_CONTEXT);
> -	}
> -
> -	if (svhdx != NULL) {
> -		/* SharedVHD is not yet supported */
> -		DEBUG(10, ("Shared VHD not yet supported, INVALID_DEVICE_REQUEST\n"));
> -		return NT_STATUS_INVALID_DEVICE_REQUEST;
> -	}
> -
>  	return create_file_default(handle->conn, req, root_dir_fid, smb_fname,
>  				   access_mask, share_access,
>  				   create_disposition, create_options,
> --
> 2.5.0
> 





More information about the samba-technical mailing list