|
@@ -684,6 +684,9 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
|
|
goto mknod_out;
|
|
goto mknod_out;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (!S_ISCHR(mode) && !S_ISBLK(mode))
|
|
|
|
+ goto mknod_out;
|
|
|
|
+
|
|
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL))
|
|
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL))
|
|
goto mknod_out;
|
|
goto mknod_out;
|
|
|
|
|
|
@@ -692,10 +695,8 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
|
|
|
|
|
|
buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
|
|
buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
|
|
if (buf == NULL) {
|
|
if (buf == NULL) {
|
|
- kfree(full_path);
|
|
|
|
rc = -ENOMEM;
|
|
rc = -ENOMEM;
|
|
- free_xid(xid);
|
|
|
|
- return rc;
|
|
|
|
|
|
+ goto mknod_out;
|
|
}
|
|
}
|
|
|
|
|
|
if (backup_cred(cifs_sb))
|
|
if (backup_cred(cifs_sb))
|
|
@@ -742,7 +743,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
|
|
pdev->minor = cpu_to_le64(MINOR(device_number));
|
|
pdev->minor = cpu_to_le64(MINOR(device_number));
|
|
rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
|
|
rc = tcon->ses->server->ops->sync_write(xid, &fid, &io_parms,
|
|
&bytes_written, iov, 1);
|
|
&bytes_written, iov, 1);
|
|
- } /* else if (S_ISFIFO) */
|
|
|
|
|
|
+ }
|
|
tcon->ses->server->ops->close(xid, tcon, &fid);
|
|
tcon->ses->server->ops->close(xid, tcon, &fid);
|
|
d_drop(direntry);
|
|
d_drop(direntry);
|
|
|
|
|