public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: linux-kernel@vger.kernel.org
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-serial@vger.kernel.org
Subject: Don't cross the (tty) streams
Date: Thu, 20 Sep 2007 15:02:22 -0600	[thread overview]
Message-ID: <20070920210221.GC10625@parisc-linux.org> (raw)


Connect two machines with a serial cable.  On the victim:

willy@rowlf:~$ cat </dev/ttyS1

Now, let's find out which ttyS on the other machine is connected ...

willy@teeth:~$ echo foo >/dev/ttyS1
-bash: echo: write error: Input/output error

Oops, that's not a serial port.  No output on rowlf, as expected.
OK, carrying on ...

willy@teeth:~$ echo bar >/dev/ttyS0

And yet on rowlf, we now see:

foo
bar

Looks like there's an error path that doesn't throw away data on -EIO.

This bug exists on at least these two kernels (because I tested it in
both directions:
Linux rowlf 2.6.19-rc6-g70d6673f #1 SMP Thu Nov 16 20:49:15 EST 2006 ia64 GNU/Linux
Linux teeth 2.6.23-rc3-g68dba7a9-dirty #209 SMP PREEMPT Thu Sep 20 15:57:42 EDT 2007 i686 GNU/Linux

Neither kernel has any modifications to its serial code.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

             reply	other threads:[~2007-09-20 21:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-20 21:02 Matthew Wilcox [this message]
2007-09-20 21:29 ` Don't cross the (tty) streams Andreas Schwab
2007-09-21  3:08   ` Matthew Wilcox

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=20070920210221.GC10625@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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