From: "H. Peter Anvin" <hpa@zytor.com>
To: Aristeu Sergio Rozanski Filho <aristeu.sergio@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tty_io: fix race in master pty close/slave pty close path
Date: Thu, 22 Feb 2007 10:10:51 -0800 [thread overview]
Message-ID: <45DDDCAB.1000703@zytor.com> (raw)
In-Reply-To: <20070222173744.GB6938@cathedrallabs.org>
Aristeu Sergio Rozanski Filho wrote:
>
> This normally would only issue a warning on idr_remove() but in case of a
> customer's critical application, it's never too simple:
>
> thread1: opens master, gets index X
> thread1: begin closing master
> thread2: begin opening slave with index X
> thread1: finishes closing master, index X released
> thread3: opens master, gets index X, just released
> thread2: fails opening slave, releases index X <----
> thread4: opens master, gets index X, init_dev() then find an already in use
> and healthy tty and fails
>
OK, that's fiendishly subtle, as most races are, of course. I'll try to
walk through the codepaths to make sure the proposed patch doesn't
introduce a leak, but the concept sounds good.
-hpa
next prev parent reply other threads:[~2007-02-22 18:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-22 17:37 [PATCH] tty_io: fix race in master pty close/slave pty close path Aristeu Sergio Rozanski Filho
2007-02-22 18:10 ` H. Peter Anvin [this message]
2007-02-22 19:00 ` Chuck Ebbert
2007-02-22 20:00 ` Aristeu Sergio Rozanski Filho
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=45DDDCAB.1000703@zytor.com \
--to=hpa@zytor.com \
--cc=aristeu.sergio@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.