From: Sripathi Kodi Date: Mon, 29 Mar 2010 23:13:59 +0000 (-0500) Subject: 9p: Creating files with names too long should fail with ENAMETOOLONG. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=11e9b49b7fa056bfc00a56de8956d1d5fe8b84ea;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 9p: Creating files with names too long should fail with ENAMETOOLONG. Signed-off-by: Sripathi Kodi Signed-off-by: Eric Van Hensbergen --- diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index ae8396707707..905f664b8bc6 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);