Skip to content
Commit 8d9535b6 authored by Sachin Prabhu's avatar Sachin Prabhu Committed by Steve French
Browse files

cifs: Check for existing directory when opening file with O_CREAT



When opening a file with O_CREAT flag, check to see if the file opened
is an existing directory.

This prevents the directory from being opened which subsequently causes
a crash when the close function for directories cifs_closedir() is called
which frees up the file->private_data memory while the file is still
listed on the open file list for the tcon.

Signed-off-by: default avatarSachin Prabhu <sprabhu@redhat.com>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
CC: Stable <stable@vger.kernel.org>
Reported-by: default avatarXiaoli Feng <xifeng@redhat.com>
parent 5b23c97d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment