netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* memory leak in lapb_create_cb
@ 2015-12-30 21:00 Dmitry Vyukov
  2016-01-13 16:46 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Vyukov @ 2015-12-30 21:00 UTC (permalink / raw)
  To: David S. Miller, linux-x25, netdev, LKML, Peter Hurley,
	Greg Kroah-Hartman, Jiri Slaby
  Cc: syzkaller, Kostya Serebryany, Alexander Potapenko, Sasha Levin,
	Eric Dumazet

Hello,

The following program leads to a leak of struct lapb_cb:

// autogenerated by syzkaller (http://github.com/google/syzkaller)
#include <unistd.h>
#include <sys/syscall.h>
#include <string.h>
#include <stdint.h>

int main()
{
        syscall(SYS_mmap, 0x20000000ul, 0x10000ul, 0x3ul, 0x32ul,
0xfffffffffffffffful, 0x0ul);
        int fd = syscall(SYS_open, "/dev/ptmx", 0x103002ul, 0x0ul, 0, 0, 0);
        *(uint32_t*)0x20001000 = (uint32_t)0x6;
        syscall(SYS_ioctl, fd, 0x5423ul, 0x20001000ul, 0, 0, 0);
        *(uint32_t*)0x20006ff8 = (uint32_t)0x1;
        *(uint8_t*)0x20006ffc = (uint8_t)0x29c;
        *(uint8_t*)0x20006ffd = (uint8_t)0x3;
        *(uint8_t*)0x20006ffe = (uint8_t)0x4;
        *(uint8_t*)0x20006fff = (uint8_t)0x8;
        *(uint8_t*)0x20007000 = (uint8_t)0x3;
        *(uint8_t*)0x20007001 = (uint8_t)0x1;
        syscall(SYS_ioctl, fd, 0x400442c9ul, 0x20006ff8ul, 0, 0, 0);
        *(uint8_t*)0x20006f64 = (uint8_t)0xe7;
        *(uint8_t*)0x20006f65 = (uint8_t)0xfb49;
        *(uint16_t*)0x20006f66 = (uint16_t)0x3;
        syscall(SYS_ioctl, fd, 0x4b46ul, 0x20006f64ul, 0, 0, 0);
        *(uint16_t*)0x20003000 = (uint16_t)0x8;
        *(uint16_t*)0x20003002 = (uint16_t)0x5;
        *(uint16_t*)0x20003004 = (uint16_t)0x8;
        *(uint16_t*)0x20003006 = (uint16_t)0x3;
        *(uint8_t*)0x20003008 = (uint8_t)0x6;
        *(uint8_t*)0x20003009 = (uint8_t)0x4b8;
        *(uint8_t*)0x2000300a = (uint8_t)0x2;
        *(uint8_t*)0x2000300b = (uint8_t)0x1;
        *(uint32_t*)0x2000300c = (uint32_t)0x5;
        *(uint8_t*)0x20003010 = (uint8_t)0x802;
        syscall(SYS_ioctl, fd, 0x5404ul, 0x20003000ul, 0, 0, 0);
        return 0;
}


unreferenced object 0xffff8800633575d0 (size 512):
  comm "softirq", pid 0, jiffies 4299764624 (age 16.395s)
  hex dump (first 32 bytes):
    00 01 00 00 00 00 ad de 00 02 00 00 00 00 ad de  ................
    c0 a3 d4 34 00 88 ff ff 00 00 00 00 00 00 00 00  ...4............
  backtrace:
    [<ffffffff85c73a22>] kmemleak_alloc+0x72/0xc0 mm/kmemleak.c:915
    [<     inline     >] kmemleak_alloc_recursive include/linux/kmemleak.h:47
    [<     inline     >] slab_post_alloc_hook mm/slub.c:1335
    [<     inline     >] slab_alloc_node mm/slub.c:2594
    [<     inline     >] slab_alloc mm/slub.c:2602
    [<ffffffff816cc6f8>] kmem_cache_alloc_trace+0x138/0x2f0 mm/slub.c:2619
    [<     inline     >] kzalloc include/linux/slab.h:458
    [<     inline     >] lapb_create_cb net/lapb/lapb_iface.c:121
    [<ffffffff852ec5ea>] lapb_register+0xfa/0x590 net/lapb/lapb_iface.c:158
    [<     inline     >] x25_asy_open drivers/net/wan/x25_asy.c:485
    [<ffffffff83a69351>] x25_asy_open_tty+0x431/0x740
drivers/net/wan/x25_asy.c:573
    [<ffffffff82bacd58>] tty_ldisc_open.isra.2+0x78/0xd0
drivers/tty/tty_ldisc.c:447
    [<ffffffff82bad41a>] tty_set_ldisc+0x1ca/0xa30 drivers/tty/tty_ldisc.c:567
    [<     inline     >] tiocsetd drivers/tty/tty_io.c:2650
    [<ffffffff82b9481a>] tty_ioctl+0xb2a/0x2160 drivers/tty/tty_io.c:2883
    [<     inline     >] vfs_ioctl fs/ioctl.c:43
    [<ffffffff81750d41>] do_vfs_ioctl+0x681/0xe40 fs/ioctl.c:607
    [<     inline     >] SYSC_ioctl fs/ioctl.c:622
    [<ffffffff8175158f>] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:613
    [<ffffffff85c8eaf6>] entry_SYSCALL_64_fastpath+0x16/0x7a
arch/x86/entry/entry_64.S:185
    [<ffffffffffffffff>] 0xffffffffffffffff


On commit 8513342170278468bac126640a5d2d12ffbff106 (Dec 28).

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-13 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-30 21:00 memory leak in lapb_create_cb Dmitry Vyukov
2016-01-13 16:46 ` David Miller

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 NNTP newsgroup(s).