From patchwork Sat Dec 7 23:46:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 11278077 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50E42930 for ; Sat, 7 Dec 2019 23:47:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 20BD124670 for ; Sat, 7 Dec 2019 23:47:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="trp1O79M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726378AbfLGXrL (ORCPT ); Sat, 7 Dec 2019 18:47:11 -0500 Received: from mail-il1-f179.google.com ([209.85.166.179]:45382 "EHLO mail-il1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbfLGXrL (ORCPT ); Sat, 7 Dec 2019 18:47:11 -0500 Received: by mail-il1-f179.google.com with SMTP id p8so9484962iln.12 for ; Sat, 07 Dec 2019 15:47:10 -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; bh=Nqk0dUDHpPmCt/fAzM/abgagXMdxTXpWbAkdZRwn9OA=; b=trp1O79MBxCR89vLE7X5cVuZtW+bIN/PiRDoM37lmigPyQ+fPpBia/H1bg880x2/kN 3KTa5rIpl+cr11MYj67J6VpRYgef8G6sPbDcADcoDK3uVe+PcQ50R2CfmcynWITYhv/c qmyU4TJALO7NMxPoHd7hYarRfq5Vc7zr7SomEPKca3kF4sAKwuzWl1+jz/d/Pw99MPW3 /iNBdjH29Ai0wcZBYZA41okxALcQaqBQzSZ/OZQG4z3OF+z594GN+Z8vaGgt/YUiWXtZ 6OZs5znwOESw9wcdn3vAPxQHqp/NlcI+EaCCHwuEzApa/Tz5gjr6AabLKcFKuC9YPuCx i5NQ== 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; bh=Nqk0dUDHpPmCt/fAzM/abgagXMdxTXpWbAkdZRwn9OA=; b=kpOGltrFkOtNNmckx6NLKAxqQjbX9P6cgFcCW4YVj2wg5d5RMBFBnASLWTv8qiAoF0 0zscqk9RKZbRfuB0CnccyA3nPqi5wNDOcfA34Yg0CzOyh7yekJr6B3xPxWorkY2+HYOl pPqqzVauA+Hs9yVFXalS+ZHGuioErDnJeKvPs4TeGAeMn+8jjQuVoWCWMoEuJsLW2IWC AlRz/eH73ykhx61fGodiGY8Blo7qfAiBO14buM38bbfHtybctEeBnXc+ogclx5pDGjQj pDLeJ7INfQ+rIlBZ+KLntOh+yYdET/NVjcbOLdkJlhH/ZysjuJk0eMCqtiIo7+0AYVX+ 1J9g== X-Gm-Message-State: APjAAAW7D9z+ZelPVUaCcU313ailUJh8IuK9Cn9DMrLOMZhDwUaGkMC2 HZn8/5X34z/Gf63LrYchq2Zgtv6vir+45DnqyqDYItFO X-Google-Smtp-Source: APXvYqyfJkRO7RTXQVhhpqrPTFi7Efrh8+IrGhz6TPf5YYyfft0/I3u6MOmPNRSLQlKAp/Bj/a69eRiiordi057ai94= X-Received: by 2002:a92:6802:: with SMTP id d2mr21725775ilc.173.1575762430139; Sat, 07 Dec 2019 15:47:10 -0800 (PST) MIME-Version: 1.0 From: Steve French Date: Sat, 7 Dec 2019 17:46:59 -0600 Message-ID: Subject: [PATCH][SMB3] Improve check for when we send security descriptor context on open To: CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org We had cases in the modetosid patch where we were sending the security descriptor context on SMB3 open (file create) in cases when we hadn't mounted with with "modefromsid" mount option. Add check for that mount flag before calling ad_sd_context in open init. From 231e2a0ba56733c95cb77d8920e76502b2134e72 Mon Sep 17 00:00:00 2001 From: Steve French Date: Sat, 7 Dec 2019 17:38:22 -0600 Subject: [PATCH] smb3: improve check for when we send the security descriptor context on create We had cases in the previous patch where we were sending the security descriptor context on SMB3 open (file create) in cases when we hadn't mounted with with "modefromsid" mount option. Add check for that mount flag before calling ad_sd_context in open init. Signed-off-by: Steve French Reviewed-by: Pavel Shilovsky --- fs/cifs/smb2pdu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index b77643e02157..0ab6b1200288 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2630,6 +2630,8 @@ SMB2_open_init(struct cifs_tcon *tcon, struct smb_rqst *rqst, __u8 *oplock, } if ((oparms->disposition != FILE_OPEN) && + (oparms->cifs_sb) && + (oparms->cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MODE_FROM_SID) && (oparms->mode != ACL_NO_MODE)) { if (n_iov > 2) { struct create_context *ccontext = -- 2.23.0