Skip to content

Commit

Permalink
SMB3: Fix crash in SMB2_open_init due to uninitialized field in compo…
Browse files Browse the repository at this point in the history
…unding 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: fdef665 ("smb3: fix mode passed in on create for modetosid mount option")

Signed-off-by: Steve French <[email protected]>
Acked-by: Ronnie Sahlberg <[email protected]>
Reviewed-by: Pavel Shilovsky <[email protected]>
  • Loading branch information
Steve French committed Dec 13, 2019
1 parent 2813938 commit e0fc5b1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/cifs/smb2inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e0fc5b1

Please sign in to comment.