[7660] in bugtraq

home help back first fref pref prev next nref lref last post

Linux 2.1.115 devpts bug improved fix

daemon@ATHENA.MIT.EDU (Duncan Simpson)
Thu Aug 13 18:59:49 1998

Date: 	Thu, 13 Aug 1998 20:38:21 +0100
Reply-To: Duncan Simpson <dps@IO.STARGATE.CO.UK>
From: Duncan Simpson <dps@IO.STARGATE.CO.UK>
X-To:         linux-kernel@redhat.com
To: BUGTRAQ@NETSPACE.ORG

After reading more source code here is a better fix to the
linux 2.1.115 devpts bounds checking bug. This version bears
the precious previous by adding a -ve entry in the cache for
next time.


--- linux/fs/devpts/root.c.dist Thu Aug 13 17:54:17 1998
+++ linux/fs/devpts/root.c      Thu Aug 13 20:33:50 1998
@@ -159,10 +159,12 @@
                        entry += (*p++ - '0');
                }
        }
-
-       dentry->d_inode = sbi->inodes[entry];
-       if ( dentry->d_inode )
-               dentry->d_inode->i_count++;
+       if (entry<sbi->max_ptys) /* Check range of number */
+       {
+               dentry->d_inode = sbi->inodes[entry];
+               if ( dentry->d_inode )
+                       dentry->d_inode->i_count++;
+       }

        d_add(dentry, dentry->d_inode);

home help back first fref pref prev next nref lref last post