From: Dmitry Vyukov <dvyukov@google.com>
To: "David S. Miller" <davem@davemloft.net>,
linux-x25@vger.kernel.org, netdev <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
Peter Hurley <peter@hurleysoftware.com>
Cc: syzkaller <syzkaller@googlegroups.com>,
Kostya Serebryany <kcc@google.com>,
Alexander Potapenko <glider@google.com>,
Sasha Levin <sasha.levin@oracle.com>
Subject: net: memory leak in lapb_register
Date: Mon, 22 Feb 2016 11:09:29 +0100 [thread overview]
Message-ID: <CACT4Y+ZtVp-vsZ8ey6W2i3QU2TP3vFJGdmQ6pxpcEDQg4oSVDg@mail.gmail.com> (raw)
Hello,
The following program causes a memory leak of an object allocated in
lapb_register:
// autogenerated by syzkaller (http://github.com/google/syzkaller)
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include <linux/tty.h>
int main(int argc, char **argv)
{
int fd, val;
fd = open("/dev/ptmx", O_RDWR);
val = N_X25;
ioctl(fd, TIOCSETD, &val);
return 0;
}
unreferenced object 0xffff880034b943d8 (size 512):
comm "softirq", pid 0, jiffies 4294896736 (age 10.460s)
hex dump (first 32 bytes):
00 01 00 00 00 00 ad de 00 02 00 00 00 00 ad de ................
c0 a3 d3 35 00 88 ff ff 00 00 00 00 00 00 00 00 ...5............
backtrace:
[<ffffffff86680923>] kmemleak_alloc+0x63/0xa0 mm/kmemleak.c:916
[< inline >] kmemleak_alloc_recursive include/linux/kmemleak.h:47
[< inline >] slab_post_alloc_hook mm/slub.c:1337
[< inline >] slab_alloc_node mm/slub.c:2596
[< inline >] slab_alloc mm/slub.c:2604
[<ffffffff8176ae6e>] kmem_cache_alloc_trace+0x1ee/0x350 mm/slub.c:2621
[< inline >] kzalloc include/linux/slab.h:463
[< inline >] lapb_create_cb net/lapb/lapb_iface.c:121
[<ffffffff85ca303a>] lapb_register+0xfa/0x590 net/lapb/lapb_iface.c:158
[< inline >] x25_asy_open drivers/net/wan/x25_asy.c:485
[<ffffffff83fa82d8>] x25_asy_open_tty+0x438/0x760
drivers/net/wan/x25_asy.c:573
[<ffffffff82fbd258>] tty_ldisc_open.isra.2+0x78/0xd0
drivers/tty/tty_ldisc.c:454
[<ffffffff82fbd842>] tty_set_ldisc+0x292/0x8a0 drivers/tty/tty_ldisc.c:561
[< inline >] tiocsetd drivers/tty/tty_io.c:2655
[<ffffffff82fa651e>] tty_ioctl+0xb2e/0x2160 drivers/tty/tty_io.c:2910
[< inline >] vfs_ioctl fs/ioctl.c:43
[<ffffffff8180597c>] do_vfs_ioctl+0x18c/0xfb0 fs/ioctl.c:674
[< inline >] SYSC_ioctl fs/ioctl.c:689
[<ffffffff8180682f>] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:680
[<ffffffff8669ddb6>] entry_SYSCALL_64_fastpath+0x16/0x7a
arch/x86/entry/entry_64.S:185
[<ffffffffffffffff>] 0xffffffffffffffff
On commit 23300f657594656e7ebac3130b43460ebc4381cc (Feb 19).
next reply other threads:[~2016-02-22 10:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 10:09 Dmitry Vyukov [this message]
2016-06-22 8:24 ` net: memory leak in lapb_register Dmitry Vyukov
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=CACT4Y+ZtVp-vsZ8ey6W2i3QU2TP3vFJGdmQ6pxpcEDQg4oSVDg@mail.gmail.com \
--to=dvyukov@google.com \
--cc=davem@davemloft.net \
--cc=glider@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kcc@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-x25@vger.kernel.org \
--cc=netdev@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).