From: Jamie Lokier <lkd@tantalophile.demon.co.uk>
To: linux-kernel@vger.rutgers.edu
Cc: torvalds@transmeta.com
Subject: [PATCH] Buffer overflow in fs/devpts/root.c
Date: Wed, 30 Sep 1998 15:43:03 +0100 [thread overview]
Message-ID: <19980930154303.A14398@tantalophile.demon.co.uk> (raw)
I haven't tested this, but it should be self explanatory.
I don't even use devpts, I just spotted this while reading.
If you look up a name like /dev/pts/9999 it'd get messy.
If you look up /dev/pts/4294967296, it'd be accepted and a dentry
kept for it. That's silly.
-- Jamie
--- /usr/src/linux/fs/devpts/root.c Wed Aug 26 19:18:54 1998
+++ /tmp/root.c Wed Sep 30 15:39:35 1998
@@ -152,12 +152,16 @@
if ( *p < '1' || *p > '9' )
return 0;
entry = *p++ - '0';
+ if ( entry >= sbi->max_ptys )
+ return 0;
for ( i = dentry->d_name.len-1 ; i ; i-- ) {
if ( *p < '0' || *p > '9' )
return 0;
entry *= 10;
entry += (*p++ - '0');
+ if ( entry >= sbi->max_ptys )
+ return 0;
}
}
----- end of patch -----
-
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/
reply other threads:[~1998-09-30 10:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19980930154303.A14398@tantalophile.demon.co.uk \
--to=lkd@tantalophile.demon.co.uk \
--cc=linux-kernel@vger.rutgers.edu \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).