Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1618470
| From | Al Viro <viro@ZenIV.linux.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] tty: Fix crash with flush_to_ldisc() |
| Date | 2017-04-07 06:20 +0200 |
| Message-ID | <tttxn-29E-7@gated-at.bofh.it> (permalink) |
| References | <ttte1-1M3-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Apr 07, 2017 at 01:50:53PM +1000, Michael Neuling wrote:
> diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
> index bdf0e6e899..a2a9832a42 100644
> --- a/drivers/tty/n_tty.c
> +++ b/drivers/tty/n_tty.c
> @@ -1668,11 +1668,17 @@ static int
> n_tty_receive_buf_common(struct tty_struct *tty, const unsigned char *cp,
> char *fp, int count, int flow)
> {
> - struct n_tty_data *ldata = tty->disc_data;
> + struct n_tty_data *ldata;
> int room, n, rcvd = 0, overflow;
>
> down_read(&tty->termios_rwsem);
>
> + ldata = tty->disc_data;
> + if (!ldata) {
> + up_read(&tty->termios_rwsem);
I very much doubt that it's correct. It shouldn't have been called after
the n_tty_close(); apparently it has been. ->termios_rwsem won't serialize
against it, and something apparently has gone wrong with the exclusion there.
At the very least I would like to see what's to prevent n_tty_close() from
overlapping the exection of this function - if *that* is what broke, your
patch will only paper over the problem.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] tty: Fix crash with flush_to_ldisc() Michael Neuling <mikey@neuling.org> - 2017-04-07 06:00 +0200
Re: [PATCH] tty: Fix crash with flush_to_ldisc() Al Viro <viro@ZenIV.linux.org.uk> - 2017-04-07 06:20 +0200
Re: [PATCH] tty: Fix crash with flush_to_ldisc() Michael Neuling <mikey@neuling.org> - 2017-04-07 07:00 +0200
csiph-web