summaryrefslogtreecommitdiff
path: root/fs/nfs/getroot.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-09-28 12:27:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-28 15:36:42 -0700
commit54af3bb543c071769141387a42deaaab5074da55 (patch)
treed24e5b23462a51a4e932b14feb5ae943b0dbba1e /fs/nfs/getroot.c
parentbd8936632475665bfd90c1180c9c1301ee838db8 (diff)
downloadlinux-3.10-54af3bb543c071769141387a42deaaab5074da55.tar.gz
linux-3.10-54af3bb543c071769141387a42deaaab5074da55.tar.bz2
linux-3.10-54af3bb543c071769141387a42deaaab5074da55.zip
NFS: Fix an Oops in encode_lookup()
It doesn't look as if the NFS file name limit is being initialised correctly in the struct nfs_server. Make sure that we limit whatever is being set in nfs_probe_fsinfo() and nfs_init_server(). Also ensure that readdirplus and nfs4_path_walk respect our file name limits. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfs/getroot.c')
-rw-r--r--fs/nfs/getroot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index d1cbf0a0fbb..522e5ad4d8a 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -175,6 +175,9 @@ next_component:
path++;
name.len = path - (const char *) name.name;
+ if (name.len > NFS4_MAXNAMLEN)
+ return -ENAMETOOLONG;
+
eat_dot_dir:
while (*path == '/')
path++;