public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Bolle <pebolle@tiscali.nl>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, LKML <linux-kernel@vger.kernel.org>,
	Peter Hurley <peter@hurleysoftware.com>,
	One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
	J Freyensee <james_p_freyensee@linux.intel.com>,
	Alexander Potapenko <glider@google.com>,
	Kostya Serebryany <kcc@google.com>,
	Sasha Levin <sasha.levin@oracle.com>,
	syzkaller <syzkaller@googlegroups.com>
Subject: Re: tty: memory leak in tty_register_driver
Date: Thu, 18 Feb 2016 23:45:49 +0100	[thread overview]
Message-ID: <1455835549.2379.31.camel@tiscali.nl> (raw)
In-Reply-To: <CACT4Y+bZticikTpnc0djxRBLCWhj=2DqQk=KRf5zDvrLdHzEbQ@mail.gmail.com>

Dmitry,

On ma, 2016-02-15 at 11:42 +0100, Dmitry Vyukov wrote:
> When I am running the following program in a parallel loop, kmemleak
> starts reporting memory leaks of objects allocated in
> tty_register_driver during boot.

Because these tty drivers are built in?

>  These leaks start popping up
> chaotically and as you can see they originate in different drivers
> (synclinkmp_init, isdn_init, chr_dev_init, sysfs_init).
> 
> On commit 388f7b1d6e8ca06762e2454d28d6c3c55ad0fe95 (4.5-rc3).
> 
> // autogenerated by syzkaller (http://github.com/google/syzkaller)
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <sys/ioctl.h>

If you (or syzkaller) add
	#include <linux/tty.h>

here...

> int main()
> {
>   int fd, val;
> 
>   fd = open("/dev/ptmx", O_RDWR);
>   val = 21;

you can use
	val = N_GSM0710;

here. That is probably much clearer for the readers of this report. (No
one bothers to remember these values. No one sane, at least.)

>   ioctl(fd, TIOCSETD, &val);
>   return 0;
> }

Fascinating issue. Makes zero sense to me. sysfs_init? Anyhow, since the
people actually familiar with this code have stayed silent until now, I
have some obvious questions:
- does this only trigger with line discipline N_GSM0710?
- is this a new issue or do older trees also trigger it (in other
  words: have you tried bisecting this)?

Thanks,


Paul Bolle

  reply	other threads:[~2016-02-18 22:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15 10:42 tty: memory leak in tty_register_driver Dmitry Vyukov
2016-02-18 22:45 ` Paul Bolle [this message]
2016-02-22  9:53   ` Dmitry Vyukov
2016-02-27 21:20     ` Paul Bolle
2016-02-28 16:42 ` Dmitry Vyukov
2016-02-28 23:47   ` Catalin Marinas
2016-02-29 10:22     ` Dmitry Vyukov
2016-02-29 10:24       ` Dmitry Vyukov
2016-02-29 11:34       ` Catalin Marinas
2016-03-01 15:27         ` Dmitry Vyukov
2016-03-01 15:55           ` Catalin Marinas

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=1455835549.2379.31.camel@tiscali.nl \
    --to=pebolle@tiscali.nl \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=james_p_freyensee@linux.intel.com \
    --cc=jslaby@suse.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=sasha.levin@oracle.com \
    --cc=syzkaller@googlegroups.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