From patchwork Tue Feb 4 20:42:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1233546 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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.a=rsa-sha256 header.s=20161025 header.b=ZZaz/qVk; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48BxTQ58nmz9sP7 for ; Wed, 5 Feb 2020 07:42:34 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727446AbgBDUmd (ORCPT ); Tue, 4 Feb 2020 15:42:33 -0500 Received: from mail-il1-f181.google.com ([209.85.166.181]:34791 "EHLO mail-il1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727444AbgBDUmd (ORCPT ); Tue, 4 Feb 2020 15:42:33 -0500 Received: by mail-il1-f181.google.com with SMTP id l4so17141465ilj.1 for ; Tue, 04 Feb 2020 12:42:33 -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=mUIXdFyk3++G++8LPtXJxWo6V4BrxAMF2HVFUuE3Ass=; b=ZZaz/qVkav0pe3mtyw3ADjjd3UOlyFxcDIyJadRx+84m/DDIlmWHSxLF/xDLNeXiVc NJTSz6uukqXjpXFQxvNkTbX2A/+u8mtONigKghZdiIqF3nOaxlpLxZOUQIpTARSfitWD ddhq7pEZo3pwdpyBDK+CyO5Bw/3bNWK7qXeCJpmuF2gMG8quCR/cmIe4Z5IAwBJPak+L lPNx5Ri7PF5cLI+cmomqWNdbDP3jahtQZhnUPw1Q+uTaqdfl8ZOOEaOpwg7nNNzlba3n CUdVmNeu96HWOQO5ChtvqrmPKZXPsxb+Qehzps8/+gMXwqomkYdOcir6ojr9OPr6faw0 MRlw== 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=mUIXdFyk3++G++8LPtXJxWo6V4BrxAMF2HVFUuE3Ass=; b=IBcHjbvwK5x4f6DOXsLrHTdUkbBVdQMYuPo/HMMEIRZVNi9DaMQHMdFetN+jUJBWxe UfFZszGQyPpCLNyGJvsSnjNU9CrOyTbrFT25+XvaZEHptw3urDJVfD92Hs1rJIfbEAu7 eVot9vqEnyQMeZQPuuJmalYlQ4m5QPgTOMnnXTxkqT42k10Zb6xVoWh6ZsTfAXL4fqke QJ08DTyQqoJ5vT/5hv7FFYoP5lFO4fzM/3x66bz/E30ZOvkDpd46cmRUqwcc43Avop4+ yzII9kTvIYzsMmJUwuNYgtIRhvBXd0AXB0D/sQADQnzmBU9+TKAUHwMq0nccw5E/eGtM QjhA== X-Gm-Message-State: APjAAAVBQWFwhEMxfh2n8fglYpYgp5+d/uobCErCfNfOkTL2CAqyex9X jnN8pA1MmDRpKQcTzEz2qA6Ys/rX6I0VzOiYTwdw+B7l X-Google-Smtp-Source: APXvYqwD/VxQqS9yx/yMgF9oKnSRXwt9fRqk9LidfWkekDyJw7YQ54GQqPbHCv13A8rTd671reP3O1+ch3etQQ6oaTI= X-Received: by 2002:a92:7301:: with SMTP id o1mr4162075ilc.272.1580848952536; Tue, 04 Feb 2020 12:42:32 -0800 (PST) MIME-Version: 1.0 From: Steve French Date: Tue, 4 Feb 2020 14:42:21 -0600 Message-ID: Subject: [SMB3][PATCH] Fix oops in cifs_create_options() To: CIFS Cc: Amir Goldstein Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Reviewed-by: Aurelien Aptel From 67299c469b718200ca88bf74ad6106ef2b8ed7b4 Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 4 Feb 2020 13:02:59 -0600 Subject: [PATCH] smb3: fix problem with null cifs super block with previous patch Add check for null cifs_sb to create_options helper Signed-off-by: Steve French CC: Amir Goldstein --- fs/cifs/cifsproto.h | 2 +- fs/cifs/smb2ops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 748bd00cb5f1..89eaaf46d1ca 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h @@ -614,7 +614,7 @@ static inline int get_dfs_path(const unsigned int xid, struct cifs_ses *ses, static inline int cifs_create_options(struct cifs_sb_info *cifs_sb, int options) { - if (backup_cred(cifs_sb)) + if (cifs_sb && (backup_cred(cifs_sb))) return options | CREATE_OPEN_BACKUP_INTENT; else return options; diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 33bb86cae369..ac6628e28b12 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -2407,7 +2407,7 @@ smb2_queryfs(const unsigned int xid, struct cifs_tcon *tcon, FS_FULL_SIZE_INFORMATION, SMB2_O_INFO_FILESYSTEM, sizeof(struct smb2_fs_full_size_info), - &rsp_iov, &buftype, NULL); + &rsp_iov, &buftype, cifs_sb); if (rc) goto qfs_exit; -- 2.20.1