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

Uri Simchoni uri at samba.org
Thu Feb 25 05:32:03 UTC 2016


Hi,

Attached is a fix for https://bugzilla.samba.org/show_bug.cgi?id=11753.

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.

Thanks,
Uri.
-------------- next part --------------
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://bugzilla.samba.org/show_bug.cgi?id=11753

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