mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: Jiri Slaby <jslaby@suse.cz>,
	alan@linux.intel.com, linux-kernel@vger.kernel.org,
	jirislaby@gmail.com, Dave Jones <davej@redhat.com>
Subject: Re: [PATCH 21/21] TTY: move tty buffers to tty_port
Date: Thu, 25 Oct 2012 11:08:01 -0700	[thread overview]
Message-ID: <20121025180801.GA22642@kroah.com> (raw)
In-Reply-To: <50897E98.5080502@gmail.com>

On Thu, Oct 25, 2012 at 02:02:00PM -0400, Sasha Levin wrote:
> Hi guys,
> 
> On 10/18/2012 04:26 PM, Jiri Slaby wrote:
> > So this is it. The big step why we did all the work over the past
> > kernel releases. Now everything is prepared, so nothing protects us
> > from doing that big step.
> > 
> >            |  |            \  \ nnnn/^l      |  |
> >            |  |             \  /     /       |  |
> >            |  '-,.__   =>    \/   ,-`    =>  |  '-,.__
> >            | O __.´´)        (  .`           | O __.´´)
> >             ~~~   ~~          ``              ~~~   ~~
> > The buffers are now in the tty_port structure and we can start
> > teaching the buffer helpers (insert char/string, flip etc.) to use
> > tty_port instead of tty_struct all around.
> > 
> > Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> > ---
> 
> Fuzzing with trinity inside a KVM tools (lkvm) guest with -next kernel
> uncovered the following warning:
> 
> [ 1339.448706] ------------[ cut here ]------------
> [ 1339.451224] WARNING: at drivers/tty/tty_buffer.c:476 flush_to_ldisc+0x60/0x200()
> [ 1339.454272] tty is NULLPid: 7147, comm: kworker/4:0 Tainted: G        W    3.7.0-rc2-next-20121025-sasha-00001-g673f98e-dirty #75
> [ 1339.458693] Call Trace:
> [ 1339.459410]  [<ffffffff81bb1ea0>] ? flush_to_ldisc+0x60/0x200
> [ 1339.461289]  [<ffffffff81109b86>] warn_slowpath_common+0x86/0xb0
> [ 1339.462992]  [<ffffffff81109c11>] warn_slowpath_fmt+0x41/0x50
> [ 1339.464772]  [<ffffffff81bb1ea0>] flush_to_ldisc+0x60/0x200
> [ 1339.467076]  [<ffffffff8112d5a9>] process_one_work+0x3b9/0x770
> [ 1339.469501]  [<ffffffff8112d458>] ? process_one_work+0x268/0x770
> [ 1339.472053]  [<ffffffff8112dcc1>] ? worker_thread+0x51/0x3f0
> [ 1339.473831]  [<ffffffff81bb1e40>] ? __tty_buffer_request_room+0x180/0x180
> [ 1339.475834]  [<ffffffff8112df2a>] worker_thread+0x2ba/0x3f0
> [ 1339.478027]  [<ffffffff8112dc70>] ? rescuer_thread+0x2d0/0x2d0
> [ 1339.480431]  [<ffffffff81138c33>] kthread+0xe3/0xf0
> [ 1339.482383]  [<ffffffff8117d7be>] ? put_lock_stats.isra.16+0xe/0x40
> [ 1339.484171]  [<ffffffff81138b50>] ? insert_kthread_work+0x90/0x90
> [ 1339.485886]  [<ffffffff83aedebc>] ret_from_fork+0x7c/0xb0
> [ 1339.487943]  [<ffffffff81138b50>] ? insert_kthread_work+0x90/0x90
> [ 1339.490435] ---[ end trace e01a8b0af77894c4 ]---
> 
> I'm guessing it happens because we never cancel the scheduled work when we
> free the buffer, so the scheduled work may run even after we freed the buffer.
> 
> Besides the warning itself, I think that 'tty is NULL' would need a newline
> after it. Greg, should I send a patch for that?

Yes, please do.

thanks,

greg k-h

  reply	other threads:[~2012-10-25 18:08 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18 20:26 [PATCH 00/21] TTY buffer in tty_port and other stuff Jiri Slaby
2012-10-18 20:26 ` [PATCH 01/21] TTY: devpts, don't care about TTY in devpts_get_tty Jiri Slaby
2012-10-18 20:26 ` [PATCH 02/21] TTY: devpts, return created inode from devpts_pty_new Jiri Slaby
2012-10-18 20:26 ` [PATCH 03/21] TTY: devpts, do not set driver_data Jiri Slaby
2012-10-18 20:26 ` [PATCH 04/21] TTY: devpts, document devpts inode operations Jiri Slaby
2012-10-18 20:26 ` [PATCH 05/21] TTY: move devpts kill to pty Jiri Slaby
2012-10-18 20:26 ` [PATCH 06/21] TTY: vt, fix paste_selection ldisc handling Jiri Slaby
2012-10-18 20:26 ` [PATCH 07/21] TTY: ldisc, wait for idle ldisc in release Jiri Slaby
2012-10-18 20:26 ` [PATCH 08/21] TTY: hci_ldisc, remove invalid check in open Jiri Slaby
2012-10-18 20:47   ` Marcel Holtmann
2012-10-18 20:26 ` [PATCH 09/21] TTY: n_tty, simplify read_buf+echo_buf allocation Jiri Slaby
2012-10-18 20:26 ` [PATCH 10/21] TTY: n_tty, remove bogus checks Jiri Slaby
2012-10-18 20:26 ` [PATCH 11/21] TTY: audit, stop accessing tty->icount Jiri Slaby
2012-10-18 20:26 ` [PATCH 12/21] TTY: n_tty, add ldisc data to n_tty Jiri Slaby
2012-10-18 20:26 ` [PATCH 13/21] TTY: move ldisc data from tty_struct: simple members Jiri Slaby
2012-10-18 20:26 ` [PATCH 14/21] TTY: move ldisc data from tty_struct: bitmaps Jiri Slaby
2012-10-18 20:26 ` [PATCH 15/21] TTY: move ldisc data from tty_struct: read_* and echo_* and canon_* stuff Jiri Slaby
2012-10-18 20:26 ` [PATCH 16/21] TTY: move ldisc data from tty_struct: locks Jiri Slaby
2012-10-18 20:26 ` [PATCH 17/21] TTY: n_tty, propagate n_tty_data Jiri Slaby
2012-10-18 20:26 ` [PATCH 18/21] TTY: move TTY_FLUSH* flags to tty_port Jiri Slaby
2012-10-18 20:26 ` [PATCH 19/21] TTY: tty_buffer, cache pointer to tty->buf Jiri Slaby
2012-10-18 20:26 ` [PATCH 20/21] TTY: add port -> tty link Jiri Slaby
2012-10-18 20:26 ` [PATCH 21/21] TTY: move tty buffers to tty_port Jiri Slaby
2012-10-25 18:02   ` Sasha Levin
2012-10-25 18:08     ` Greg KH [this message]
2012-10-31 12:53     ` Jiri Slaby
2012-10-31 15:30       ` Sasha Levin
2012-10-31 15:32         ` Jiri Slaby
2012-10-31 15:59           ` Sasha Levin
2012-11-02 15:51             ` Jiri Slaby
2012-11-02 16:07               ` Sasha Levin
2012-11-02 16:18                 ` Jiri Slaby
2012-11-02 16:23                   ` Sasha Levin
2012-11-03  2:03                   ` Sasha Levin
2012-11-03 15:55                     ` Jiri Slaby
2012-11-03 23:06                       ` Sasha Levin
2012-11-04  0:53                         ` Sasha Levin
2012-11-27 19:57                           ` Peter Hurley
2012-11-30 23:52                             ` Sasha Levin
2012-12-01 14:59                               ` flush_to_ldisc accesses tty after free (was: [PATCH 21/21] TTY: move tty buffers to tty_port) Peter Hurley
2012-12-01 20:06                                 ` Peter Hurley
2012-12-02 19:57                                   ` Peter Hurley
2012-12-04 19:21                                 ` Ilya Zykov
2012-10-31 20:10           ` [PATCH 21/21] TTY: move tty buffers to tty_port Sasha Levin
2012-10-18 21:12 ` [PATCH 00/21] TTY buffer in tty_port and other stuff Greg KH
2012-10-22 14:57 ` Alan Cox
2012-10-22 23:59 ` 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=20121025180801.GA22642@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alan@linux.intel.com \
    --cc=davej@redhat.com \
    --cc=jirislaby@gmail.com \
    --cc=jslaby@suse.cz \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome