segfaults and kernel oops with long filenames

Love lha at stacken.kth.se
Tue Oct 17 20:35:25 CEST 2000


Willi Langenberger <wlang at wu-wien.ac.at> writes:

> Hi arla drinkers!

Hi
 
> We encountered the following arla behaviour (tested with versions 0.32
> - 0.34.4 on redhat/i386 6.0 - 6.2) while working with a somewhat buggy
> htdig. A "stat" call to a non existant filename with more than 255
> charcters gives a segfault and a kernel oops. 255 characters work as
> expected:

The patch below will fix your problem.

A proper fix that will all bugs (for all os) kill will be out in a couple
of hours with 0.34.5.

Love



Index: xfs_inodeops.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/linux/xfs_inodeops.c,v
retrieving revision 1.138.2.2
diff -u -w -u -w -r1.138.2.2 xfs_inodeops.c
--- xfs/linux/xfs_inodeops.c	2000/10/17 00:09:13	1.138.2.2
+++ xfs/linux/xfs_inodeops.c	2000/10/17 18:31:31
@@ -455,6 +455,9 @@
 		       dentry, (int)dentry->d_name.len, dentry->d_name.name,
 		       dir));
 
+    if (dentry->d_name.len > 255)
+	return -ENAMETOOLONG;
+
     xfsp = XFS_FROM_VNODE(dir);
     d = VNODE_TO_XNODE(dir);
     if (d == NULL || xfsp == NULL) {





More information about the Arla-drinkers mailing list