From: Arnd Bergmann <arnd@arndb.de>
To: Jiri Slaby <jslaby@suse.cz>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
jirislaby@gmail.com, stable@kernel.org,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH 3/4] TTY: pty, release tty in all ptmx_open fail paths
Date: Wed, 12 Oct 2011 15:23:05 +0200 [thread overview]
Message-ID: <201110121523.05567.arnd@arndb.de> (raw)
In-Reply-To: <1318411965-23917-3-git-send-email-jslaby@suse.cz>
On Wednesday 12 October 2011, Jiri Slaby wrote:
> Mistakenly, commit 64ba3dc3143d (tty: never hold BTM while getting
> tty_mutex) switched one fail path in ptmx_open to not free the newly
> allocated tty.
>
> Fix that by jumping to the appropriate place. And rename the labels so
> that it's clear what is going on there.
>
> Introduced-in: v2.6.36-rc2
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: stable@kernel.org
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
Ok, I have checked that this patch returns the code into the state
before my broken patch, that looks good.
I think I made the same mistake trying to understand your patch
that I made originally when I introduced the bug, which was to
confuse the lifetime of the pty master with the lifetime of the
slave device, so I thought that tty_release should not be called
if we never called ptm_driver->ops->open(), but that's actually
a different device.
Arnd
next prev parent reply other threads:[~2011-10-12 13:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-04 20:05 NULL dereference in tty_open() Dan Carpenter
2011-10-05 14:22 ` NULL dereference in tty_open() [and other bugs there] Jiri Slaby
2011-10-12 9:32 ` [PATCH 1/4] TTY: drop driver reference in tty_open fail path Jiri Slaby
2011-10-12 9:32 ` [PATCH 2/4] TTY: make tty_add_file non-failing Jiri Slaby
2011-10-12 9:32 ` [PATCH 3/4] TTY: pty, release tty in all ptmx_open fail paths Jiri Slaby
2011-10-12 13:23 ` Arnd Bergmann [this message]
2011-10-12 9:32 ` [PATCH 4/4] TTY: call tty_driver_lookup_tty unconditionally Jiri Slaby
2011-10-12 20:59 ` Jiri Slaby
2011-10-16 19:20 ` Sukadev Bhattiprolu
2011-10-16 19:37 ` Jiri Slaby
2011-10-16 18:28 ` [PATCH 1/4] TTY: drop driver reference in tty_open fail path Sukadev Bhattiprolu
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=201110121523.05567.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=jirislaby@gmail.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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.