mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: berndj@prism.co.za
To: linux-kernel@vger.kernel.org
Subject: possible pty DoS
Date: Wed, 20 Dec 2000 15:05:56 +0200	[thread overview]
Message-ID: <20001220150556.A29985@prism.co.za> (raw)

hello all

I am not subscribed to linux-kernel*; please CC any follow-ups to
berndj@prism.co.za (I probably won't reply from 2000-12-22 to 2001-01-07)

I am running 2.4.0-test12-pre2

This snippet can prevent progress of any other processes that tries to do
a write to a pty:

============
	#include <sys/fcntl.h>
	#include <unistd.h>

	int main()
	{
		int ptm;
		ptm = open("/dev/ptmx", O_WRONLY);
		while (1)
			write(ptm, "hello, world!\n", 14);
	}
============

With this running, and no process eating up the greetings, I can telnet to
my machine; the banner and login prompt appear.  ps -alx at this point
reveals in.telnetd is in do_select().  As soon as I type even one char of
username, another ps reveals in.telnetd now stuck in __down_interruptible()

Lucky I usually leave a few logged in consoles lying around; xterm also
uses pty's!

Some observations:

2.2.12 behaves fine (telnet logins work fine)

2.2.12-2.4.0 diffs between tty_io.c show changes involving up/down/etc. in
do_tty_write().


Bernd Jendrissek
P.S. apologies to all for my void * arithmetic a few months ago; it was a
moment of eager-beaver weakness.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

             reply	other threads:[~2000-12-20 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-20 13:05 berndj [this message]
2000-12-22 11:13 ` Andrew Morton

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=20001220150556.A29985@prism.co.za \
    --to=berndj@prism.co.za \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome