From: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
To: Gaurav Kohli <gkohli@codeaurora.org>
Cc: jslaby@suse.com, gregkh@linuxfoundation.org, mikey@neuling.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
stable@kernel.org
Subject: Re: [PATCH V1] tty: fix data race between tty_init_dev and flush of buf
Date: Sat, 20 Jan 2018 18:48:52 +0000 [thread overview]
Message-ID: <20180120184852.456d92ad@alans-desktop> (raw)
In-Reply-To: <1516195459-1080-1-git-send-email-gkohli@codeaurora.org>
On Wed, 17 Jan 2018 18:54:19 +0530
Gaurav Kohli <gkohli@codeaurora.org> wrote:
> There can be a race, if receive_buf call comes before
> tty initialization completes in n_tty_open and tty->disc_data
> may be NULL.
>
> CPU0 CPU1
> ---- ----
> 000|n_tty_receive_buf_common() n_tty_open()
> -001|n_tty_receive_buf2() tty_ldisc_open.isra.3()
> -002|tty_ldisc_receive_buf(inline) tty_ldisc_setup()
>
> Using ldisc semaphore lock in tty_init_dev till disc_data
> initializes completely.
>
> Signed-off-by: Gaurav Kohli <gkohli@codeaurora.org>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Alan
prev parent reply other threads:[~2018-01-20 18:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-17 13:24 [PATCH V1] tty: fix data race between tty_init_dev and flush of buf Gaurav Kohli
2018-01-20 18:48 ` Alan Cox [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=20180120184852.456d92ad@alans-desktop \
--to=gnomes@lxorguk.ukuu.org.uk \
--cc=gkohli@codeaurora.org \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikey@neuling.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.