9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: yaroslav <yarikos@gmail.com>
To: 9fans@9fans.net
Subject: [9fans] passwd(1) over ssh fails: race in telnetd
Date: Wed, 26 Jan 2011 17:16:17 +0200	[thread overview]
Message-ID: <1b38321dd9fcb942a015fd7101606737@isd.dp.ua> (raw)

passwd(1), while started on telnetd-simulated /dev/cons (via ssh),
gets killed for writing on closed pipe after "Confirm:" message.  I
think it is because of close()/open() race in
	/sys/src/cmd/ip/telnetd.c:/^conssim/+/open/+/consctl/.
Readln opens and closes consctl, and when two readln calls are made,
next open may be attempted before the daemon reopens of its end of the
simulated consctl.

A fast workaround is injection of sleep(100) between readln calls in
/sys/src/cmd/auth/passwd.c:102.

Suggestions for the proper fix?

- Iaroslav




                 reply	other threads:[~2011-01-26 15:16 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=1b38321dd9fcb942a015fd7101606737@isd.dp.ua \
    --to=yarikos@gmail.com \
    --cc=9fans@9fans.net \
    /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).