From: Jiri Slaby <jslaby@suse.cz>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: samuel@sortiz.org, davem@davemloft.net,
gregkh@linuxfoundation.org, alan@linux.intel.com,
levinsasha928@gmail.com, davej@redhat.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net, TTY: initialize tty->driver_data before usage
Date: Fri, 05 Oct 2012 10:09:04 +0200 [thread overview]
Message-ID: <506E95A0.2020903@suse.cz> (raw)
In-Reply-To: <1349395281-12495-1-git-send-email-sasha.levin@oracle.com>
On 10/05/2012 02:01 AM, Sasha Levin wrote:
> Commit 9c650ffc ("TTY: ircomm_tty, add tty install") split _open() to
> _install() and _open(). It also moved the initialization of driver_data
> out of open(), but never added it to install() - causing a NULL ptr
> deref whenever the driver was used.
>
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
> net/irda/ircomm/ircomm_tty.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
> index 95a3a7a..496ce2c 100644
> --- a/net/irda/ircomm/ircomm_tty.c
> +++ b/net/irda/ircomm/ircomm_tty.c
> @@ -421,6 +421,8 @@ static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
> hashbin_insert(ircomm_tty, (irda_queue_t *) self, line, NULL);
> }
>
> + tty->driver_data = self;
> +
> return tty_port_install(&self->port, driver, tty);
Yes, a good catch.
Acked-by: Jiri Slaby <jslaby@suse.cz>
thanks,
--
js
suse labs
next prev parent reply other threads:[~2012-10-05 8:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-05 0:01 [PATCH] net, TTY: initialize tty->driver_data before usage Sasha Levin
2012-10-05 8:09 ` Jiri Slaby [this message]
2012-10-05 16:25 ` Greg KH
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=506E95A0.2020903@suse.cz \
--to=jslaby@suse.cz \
--cc=alan@linux.intel.com \
--cc=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=levinsasha928@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=samuel@sortiz.org \
--cc=sasha.levin@oracle.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;
as well as URLs for NNTP newsgroup(s).