linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: CIFS <linux-cifs@vger.kernel.org>
Subject: SMB3: Fix crash in SMB2_open_init due to uninitialized field in compounding path
Date: Mon, 9 Dec 2019 22:47:02 -0600	[thread overview]
Message-ID: <CAH2r5mtYvagfPDfZB3ru5X9O6vve9JGjuiwDKvxU6rN-iuo3-g@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

    Ran into an intermittent crash in
            SMB2_open_init+0x2f6/0x970
    due to oparms.cifs_sb not being initialized when called from:
            smb2_compound_op+0x45d/0x1690
    Zero the whole oparms struct in the compounding path before setting up the
    oparms so we don't risk any uninitialized fields.

    Fixes: fdef665ba44a ("smb3: fix mode passed in on create for
modetosid mount option")


-- 
Thanks,

Steve

[-- Attachment #2: 0001-SMB3-Fix-crash-in-SMB2_open_init-due-to-uninitialize.patch --]
[-- Type: text/x-patch, Size: 1216 bytes --]

From d94a88c365cb53aee560c0de71948a258beefd5c Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Mon, 9 Dec 2019 22:34:10 -0600
Subject: [PATCH 2/2] SMB3: Fix crash in SMB2_open_init due to uninitialized
 field in compounding path

Ran into an intermittent crash in
	SMB2_open_init+0x2f6/0x970
due to oparms.cifs_sb not being initialized when called from:
	smb2_compound_op+0x45d/0x1690
Zero the whole oparms struct in the compounding path before setting up the
oparms so we don't risk any uninitialized fields.

Fixes: fdef665ba44a ("smb3: fix mode passed in on create for modetosid mount option")

Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/smb2inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
index 18c7a33adceb..5ef5e97a6d13 100644
--- a/fs/cifs/smb2inode.c
+++ b/fs/cifs/smb2inode.c
@@ -95,6 +95,7 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
 		goto finished;
 	}
 
+	memset(&oparms, 0, sizeof(struct cifs_open_parms));
 	oparms.tcon = tcon;
 	oparms.desired_access = desired_access;
 	oparms.disposition = create_disposition;
-- 
2.23.0


                 reply	other threads:[~2019-12-10  4:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH2r5mtYvagfPDfZB3ru5X9O6vve9JGjuiwDKvxU6rN-iuo3-g@mail.gmail.com \
    --to=smfrench@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).