Re: devpts bug fix (2.1.121 is still affected)

H. Peter Anvin (hpa@transmeta.com)
14 Sep 1998 21:12:03 GMT


Followup to: <199809141758.SAA00405@io.stargate.co.uk>
By author: Duncan Simpson <dps@io.stargate.co.uk>
In newsgroup: linux.dev.kernel
>
> --- 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);
>

This bug is not quite right; it should signal ENOENT for any
out-of-range lookups. I'll make a patch and send to Linus.

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/