patch-2.0.37 linux/fs/autofs/root.c

Next file: linux/fs/ext2/fsync.c
Previous file: linux/fs/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.36/linux/fs/autofs/root.c linux/fs/autofs/root.c
@@ -108,6 +108,10 @@
 	*result = NULL;
 	if (!dir)
 		return -ENOENT;
+		
+	if (len > NAME_MAX)
+		return -ENOENT;
+		
 	if (!S_ISDIR(dir->i_mode)) {
 		iput(dir);
 		return -ENOTDIR;
@@ -194,6 +198,9 @@
 		iput(dir);
 		return -EPERM;
 	}
+	if ( len > NAME_MAX)
+		return -ENAMETOOLONG;
+		
 	if ( autofs_hash_lookup(dh,hash,name,len) ) {
 		iput(dir);
 		return -EEXIST;
@@ -252,6 +259,9 @@
 
 	if ( !autofs_oz_mode(sbi) )
 		return -EPERM;
+		
+	if(len > NAME_MAX)
+		return -ENAMETOOLONG;
 
 	ent = autofs_hash_lookup(dh,hash,name,len);
 	if ( !ent )

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov