Patchwork skip posix open if nameidata is null

mail settings
Submitter Shirish Pargaonkar
Date April 2, 2010, 5:33 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/49319/
State New
Headers show


Shirish Pargaonkar - April 2, 2010, 5:33 p.m.
While creating a file on a server which supports unix extensions
such as Samba, if a file is being created which does not supply
nameidata (i.e. nd is null), cifs client can oops when calling

The simplest solution is, do not open a file using posix semantics
if nameidata parameter is NULL even if server supports posix semantics.

I do not see a way to reach vfsmount (structure) field if nameidata
is not supplied to call posix open (cifs_posix_open).

Signed-off-by: Shirish Pargaonkar <>
Reported-by: Eugene Teo <>


diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index e9f7ecc..eef8d83 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -317,7 +317,7 @@  cifs_create(struct inode *inode, struct dentry *direntry, int mode,
 		oflags = FMODE_READ;
-	if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) &&
+	if (nd && tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) &&
 			le64_to_cpu(tcon->fsUnixInfo.Capability))) {
 		rc = cifs_posix_open(full_path, &newinode, nd->path.mnt,