public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: Eric Paris <eparis@redhat.com>
Cc: linux-kernel@vger.kernel.org, sgrubb@redhat.com,
	esandeen@redhat.com, sukadev@us.ibm.com,
	alan@lxorguk.ukuu.org.uk
Subject: Re: tty: tty_open can return to userspace holding tty_mutex
Date: Mon, 26 Jan 2009 13:47:49 -0800	[thread overview]
Message-ID: <20090126214748.GA6876@us.ibm.com> (raw)
In-Reply-To: <1233003761.9850.14.camel@localhost.localdomain>

Eric Paris [eparis@redhat.com] wrote:
| __tty_open could return (to userspace) holding the tty_mutex thanks to a
| regression introduced by 4a2b5fddd53b80efcb3266ee36e23b8de28e761a.  This was
| found by bisecting an fsfuzzer problem.  Admittedly I have no idea how it
| managed to tickle this 100% reliably, but it is clearly a regression and
| when hit leaves the box in a completely unusable state.  This patch lets
| the fsfuzzer test complete every time.

Good catch.


|     
| Signed-off-by: Eric Paris <eparis@redhat.com>

Acked-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>

| 
| ---
|  drivers/char/tty_io.c |    4 +++-
|  1 files changed, 3 insertions(+), 1 deletions(-)
| 
| diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
| index d33e5ab..bc84e12 100644
| --- a/drivers/char/tty_io.c
| +++ b/drivers/char/tty_io.c
| @@ -1817,8 +1817,10 @@ got_driver:
|  		/* check whether we're reopening an existing tty */
|  		tty = tty_driver_lookup_tty(driver, inode, index);
| 
| -		if (IS_ERR(tty))
| +		if (IS_ERR(tty)) {
| +			mutex_unlock(&tty_mutex);
|  			return PTR_ERR(tty);
| +		}
|  	}
| 
|  	if (tty) {
| 

      parent reply	other threads:[~2009-01-26 21:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-26 21:02 tty: tty_open can return to userspace holding tty_mutex Eric Paris
2009-01-26 21:16 ` Alan Cox
2009-01-26 21:19 ` Michael Tokarev
2009-01-26 21:47 ` Sukadev Bhattiprolu [this message]

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=20090126214748.GA6876@us.ibm.com \
    --to=sukadev@linux.vnet.ibm.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=eparis@redhat.com \
    --cc=esandeen@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgrubb@redhat.com \
    --cc=sukadev@us.ibm.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