summaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
authorSripathi Kodi <sripathik@in.ibm.com>2010-03-29 18:13:59 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2010-04-05 10:37:37 -0500
commit11e9b49b7fa056bfc00a56de8956d1d5fe8b84ea (patch)
tree6dedb1817bc5de3ce5e19192ee6bcc26faaf92f7 /fs/9p
parent6d96d3ab7aea5f0e75205a0c97f8d1fdf82c5287 (diff)
downloadop-kernel-dev-11e9b49b7fa056bfc00a56de8956d1d5fe8b84ea.zip
op-kernel-dev-11e9b49b7fa056bfc00a56de8956d1d5fe8b84ea.tar.gz
9p: Creating files with names too long should fail with ENAMETOOLONG.
Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/vfs_inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index ae83967..905f664 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -660,6 +660,9 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
P9_DPRINTK(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n",
dir, dentry->d_name.name, dentry, nameidata);
+ if (dentry->d_name.len > NAME_MAX)
+ return ERR_PTR(-ENAMETOOLONG);
+
sb = dir->i_sb;
v9ses = v9fs_inode2v9ses(dir);
dfid = v9fs_fid_lookup(dentry->d_parent);
OpenPOWER on IntegriCloud