From patchwork Mon Feb 25 00:01:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1047545 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CFoD/48/"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4472D84vfjz9s9L for ; Mon, 25 Feb 2019 11:01:28 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726168AbfBYAB0 (ORCPT ); Sun, 24 Feb 2019 19:01:26 -0500 Received: from mail-pl1-f172.google.com ([209.85.214.172]:41569 "EHLO mail-pl1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbfBYABZ (ORCPT ); Sun, 24 Feb 2019 19:01:25 -0500 Received: by mail-pl1-f172.google.com with SMTP id y5so3597014plk.8 for ; Sun, 24 Feb 2019 16:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=UFH4CZna5VEcnT0jn035Clm5KqtF1n9BuzudZFBnGWc=; b=CFoD/48/yv9s7y7tLYxoTxoJTY10OS7RKg/lhgvMYMMuEgzNe0OhEMn+lfgkkb8jPw PU5l9DQInb5APySWOxqGbS+6v0JpUEuvqmh+AH91zLwYXXM+2ld0uXhPFs0vswoz0ftC EJTjiIjPGlKo74qjjb2TIPnfYXPkiV9RMVLa+cCruija1rXTOphe8jpnbQD0RJC6kajr AjOwhQkE+9hwzyyNkhzyKNs7fWckg9QA3B9lQcl+bpfY9jOisRrFSD83b4idGZfQMAwy krgQuGMf4gt0sOIhuoAU5qGjb4gI/Cxvj7FYXYqfXkK7l0kDvsCJTqYhbSJxlqsUlf64 k4PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=UFH4CZna5VEcnT0jn035Clm5KqtF1n9BuzudZFBnGWc=; b=pG46hXf8yttIfcj8rwOo5EYFHMUqKTOMa1No/Xbam4yzAg8fI3MRfosOC4lxz8gTrd arJV74XbLkCIyg45tGln9P8VqfMgFk5ParmtullbHn1dDW9EVsQsY4Btsyv97tt25Eao 7LgeQUZtbBR2RXGoq8RO8HHHccwzZZc/bvmj1jn4nKzMcOXZynLdGewDB/TKBOEK91ZV pksYFHXLr1lX+FwirhayOZjPccZGIJzsuA2vYOhaSqwGG2csgQ9zDMtcgUc/GX0eTyd+ 7hEAJZ8FZJkyk5u7FepUJHNorqdiLkg/OOjU8E7yHC2/OL6kkUxSf6cZC0eWbJpcckwj hwxA== X-Gm-Message-State: AHQUAuaZYudbFlPndvkgaSHAtnd7RPoauMHB5FP6FZZfNEwxn2Aqs0Yh iTOz6zGSNF20LOinuJ+jSCQ2biKcBgpBR/CMdL8= X-Google-Smtp-Source: AHgI3IYI68ttMU/g8n73K0xIBSOgmF/QXwYpWlEUh4sZDhVmj2TiXMH7aqG9/35xA4oUDItNdLXr60WTvIiA8TBZzx4= X-Received: by 2002:a17:902:e090:: with SMTP id cb16mr16403013plb.32.1551052884726; Sun, 24 Feb 2019 16:01:24 -0800 (PST) MIME-Version: 1.0 From: Steve French Date: Sun, 24 Feb 2019 18:01:12 -0600 Message-ID: Subject: Update POSIX negotiate context during negprot to include GUID To: Jeremy Allison Cc: CIFS , samba-technical Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org As requested - updated the POSIX negotiate context to include the GUID of the only supported POSIX open/create context. Let me know if any objections.. Tested with JRAs tree and worked fine, other than unrelated problem (appears to be in server code) where the world writeable bit is always masked off on mkdir (could be user error but smb.conf looked ok to me and worked with his older tree for all modes). Other modes (other than setuid/setgid/sticky) work fine on directory create. From 56b32521d538eb1f4ad9aab15e10552cab19bdca Mon Sep 17 00:00:00 2001 From: Steve French Date: Sun, 24 Feb 2019 17:56:33 -0600 Subject: [PATCH] smb3: Update POSIX negotiate context with POSIX ctxt GUID POSIX negotiate context now includes the GUID specifying which POSIX open context we support. Signed-off-by: Steve French --- fs/cifs/smb2pdu.c | 17 +++++++++++++++++ fs/cifs/smb2pdu.h | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 49c2843b1bcf..64e172633bc4 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -490,6 +490,23 @@ build_posix_ctxt(struct smb2_posix_neg_context *pneg_ctxt) { pneg_ctxt->ContextType = SMB2_POSIX_EXTENSIONS_AVAILABLE; pneg_ctxt->DataLength = cpu_to_le16(POSIX_CTXT_DATA_LEN); + /* SMB2_CREATE_TAG_POSIX is "0x93AD25509CB411E7B42383DE968BCD7C" */ + pneg_ctxt->Name[0] = 0x93; + pneg_ctxt->Name[1] = 0xAD; + pneg_ctxt->Name[2] = 0x25; + pneg_ctxt->Name[3] = 0x50; + pneg_ctxt->Name[4] = 0x9C; + pneg_ctxt->Name[5] = 0xB4; + pneg_ctxt->Name[6] = 0x11; + pneg_ctxt->Name[7] = 0xE7; + pneg_ctxt->Name[8] = 0xB4; + pneg_ctxt->Name[9] = 0x23; + pneg_ctxt->Name[10] = 0x83; + pneg_ctxt->Name[11] = 0xDE; + pneg_ctxt->Name[12] = 0x96; + pneg_ctxt->Name[13] = 0x8B; + pneg_ctxt->Name[14] = 0xCD; + pneg_ctxt->Name[15] = 0x7C; } static void diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 538e2299805f..29f974f86f28 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -288,12 +288,12 @@ struct smb2_encryption_neg_context { __le16 Ciphers[1]; /* Ciphers[0] since only one used now */ } __packed; -#define POSIX_CTXT_DATA_LEN 8 +#define POSIX_CTXT_DATA_LEN 16 struct smb2_posix_neg_context { __le16 ContextType; /* 0x100 */ __le16 DataLength; __le32 Reserved; - __le64 Reserved1; /* In case needed for future (eg version or caps) */ + __u8 Name[16]; /* POSIX cntxt GUID 93AD25509CB411E7B42383DE968BCD7C */ } __packed; struct smb2_negotiate_rsp { -- 2.17.1