lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACT4Y+b59Ct8YXezM+HKGDfrV9YYLcB=Hi1YNNpe41JMQRAoFw@mail.gmail.com>
Date:	Wed, 30 Dec 2015 22:00:44 +0100
From:	Dmitry Vyukov <dvyukov@...gle.com>
To:	"David S. Miller" <davem@...emloft.net>, linux-x25@...r.kernel.org,
	netdev <netdev@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Peter Hurley <peter@...leysoftware.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.com>
Cc:	syzkaller <syzkaller@...glegroups.com>,
	Kostya Serebryany <kcc@...gle.com>,
	Alexander Potapenko <glider@...gle.com>,
	Sasha Levin <sasha.levin@...cle.com>,
	Eric Dumazet <edumazet@...gle.com>
Subject: memory leak in lapb_create_cb

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).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ