diff -urpN --exclude-from=/home/davej/.exclude bk-linus/fs/intermezzo/journal.c linux-2.5/fs/intermezzo/journal.c --- bk-linus/fs/intermezzo/journal.c 2002-11-21 02:20:11.000000000 +0000 +++ linux-2.5/fs/intermezzo/journal.c 2002-11-21 18:02:14.000000000 +0000 @@ -409,9 +409,8 @@ static inline char *journal_log_suffix(c /* XXX needs to be done after reservation, disable ths until version 1.2 */ if ( dentry ) { - s.prevrec = cpu_to_le32(rec->offset - - presto_d2d(dentry)->dd_kml_offset); - presto_d2d(dentry)->dd_kml_offset = rec->offset; + s.prevrec = cpu_to_le32(rec->offset - dentry->d_time); + dentry->d_time = (unsigned long) rec->offset; } else { s.prevrec = -1; } diff -urpN --exclude-from=/home/davej/.exclude bk-linus/fs/intermezzo/kml.c linux-2.5/fs/intermezzo/kml.c --- bk-linus/fs/intermezzo/kml.c 2002-11-21 02:20:12.000000000 +0000 +++ linux-2.5/fs/intermezzo/kml.c 2002-11-21 18:02:14.000000000 +0000 @@ -20,9 +20,9 @@ int begin_kml_reint (struct file *file, { struct { char *volname; - int namelen; + unsigned int namelen; char *recbuf; - int reclen; /* int newpos; */ + unsigned int reclen; /* int newpos; */ } input; struct kml_fsdata *kml_fsdata = NULL; struct presto_file_set *fset = NULL; @@ -36,6 +36,12 @@ int begin_kml_reint (struct file *file, return -EFAULT; } + if (input.namelen > PATH_MAX) + { + EXIT; + return -EINVAL; + } + if (input.reclen > kml_fsdata->kml_maxsize) return -ENOMEM; /* we'll find solution to this in the future */ @@ -75,9 +81,9 @@ int do_kml_reint (struct file *file, uns { struct { char *volname; - int namelen; + unsigned int namelen; char *path; - int pathlen; + unsigned int pathlen; int recno; int offset; int len; @@ -95,6 +101,13 @@ int do_kml_reint (struct file *file, uns EXIT; return -EFAULT; } + + if(input.namelen > PATH_MAX || input.pathlen > PATH_MAX) + { + EXIT; + return -EFAULT; + } + PRESTO_ALLOC(path, char *, input.namelen + 1); if ( !path ) { EXIT; @@ -145,7 +158,7 @@ int end_kml_reint (struct file *file, un /* Free KML buffer and related volume info */ struct { char *volname; - int namelen; + unsigned int namelen; #if 0 int count; int newpos; @@ -162,6 +175,12 @@ int end_kml_reint (struct file *file, un return -EFAULT; } + if (input.namelen > PATH_MAX) + { + EXIT; + return -EFAULT; + } + PRESTO_ALLOC(path, char *, input.namelen + 1); if ( !path ) { EXIT;