syzbot


memory leak in tty_init_dev (2)

Status: upstream: reported C repro on 2022/05/24 21:19
Reported-by: syzbot+5e1694f5b0869a691915@syzkaller.appspotmail.com
First crash: 37d, last: 37d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream memory leak in tty_init_dev C 9 388d 1032d 22/22 fixed on 2021/11/10 00:50

Sample crash report:
BUG: memory leak
unreferenced object 0xffff88810da76400 (size 1024):
  comm "syz-executor299", pid 3683, jiffies 4294957001 (age 29.640s)
  hex dump (first 32 bytes):
    01 54 00 00 01 00 00 00 00 00 00 00 00 00 00 00  .T..............
    40 95 0d 04 81 88 ff ff 00 fc c4 84 ff ff ff ff  @...............
  backtrace:
    [<ffffffff825ee96c>] kmalloc include/linux/slab.h:581 [inline]
    [<ffffffff825ee96c>] kzalloc include/linux/slab.h:714 [inline]
    [<ffffffff825ee96c>] alloc_tty_struct+0x3c/0x2f0 drivers/tty/tty_io.c:3091
    [<ffffffff825eec40>] tty_init_dev.part.0+0x20/0x2f0 drivers/tty/tty_io.c:1412
    [<ffffffff825eef50>] tty_init_dev+0x40/0x60 drivers/tty/tty_io.c:1409
    [<ffffffff825fd949>] ptmx_open drivers/tty/pty.c:834 [inline]
    [<ffffffff825fd949>] ptmx_open+0xd9/0x210 drivers/tty/pty.c:800
    [<ffffffff815c628d>] chrdev_open+0x10d/0x340 fs/char_dev.c:414
    [<ffffffff815b4c46>] do_dentry_open+0x1e6/0x650 fs/open.c:824
    [<ffffffff815db101>] do_open fs/namei.c:3476 [inline]
    [<ffffffff815db101>] path_openat+0x18a1/0x1e70 fs/namei.c:3609
    [<ffffffff815dddd1>] do_filp_open+0xc1/0x1b0 fs/namei.c:3636
    [<ffffffff815b841d>] do_sys_openat2+0xed/0x260 fs/open.c:1213
    [<ffffffff815b8e6f>] do_sys_open fs/open.c:1229 [inline]
    [<ffffffff815b8e6f>] __do_sys_openat fs/open.c:1245 [inline]
    [<ffffffff815b8e6f>] __se_sys_openat fs/open.c:1240 [inline]
    [<ffffffff815b8e6f>] __x64_sys_openat+0x7f/0xe0 fs/open.c:1240
    [<ffffffff84565f05>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f05>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae

BUG: memory leak
unreferenced object 0xffff888109c1ce00 (size 512):
  comm "syz-executor299", pid 3683, jiffies 4294957001 (age 29.640s)
  hex dump (first 32 bytes):
    50 ce c1 09 81 88 ff ff e0 ff ff ff 0f 00 00 00  P...............
    10 ce c1 09 81 88 ff ff 10 ce c1 09 81 88 ff ff  ................
  backtrace:
    [<ffffffff825fdb42>] kmalloc include/linux/slab.h:581 [inline]
    [<ffffffff825fdb42>] pty_common_install+0x72/0x3d0 drivers/tty/pty.c:382
    [<ffffffff825eec7b>] tty_driver_install_tty drivers/tty/tty_io.c:1307 [inline]
    [<ffffffff825eec7b>] tty_init_dev.part.0+0x5b/0x2f0 drivers/tty/tty_io.c:1419
    [<ffffffff825eef50>] tty_init_dev+0x40/0x60 drivers/tty/tty_io.c:1409
    [<ffffffff825fd949>] ptmx_open drivers/tty/pty.c:834 [inline]
    [<ffffffff825fd949>] ptmx_open+0xd9/0x210 drivers/tty/pty.c:800
    [<ffffffff815c628d>] chrdev_open+0x10d/0x340 fs/char_dev.c:414
    [<ffffffff815b4c46>] do_dentry_open+0x1e6/0x650 fs/open.c:824
    [<ffffffff815db101>] do_open fs/namei.c:3476 [inline]
    [<ffffffff815db101>] path_openat+0x18a1/0x1e70 fs/namei.c:3609
    [<ffffffff815dddd1>] do_filp_open+0xc1/0x1b0 fs/namei.c:3636
    [<ffffffff815b841d>] do_sys_openat2+0xed/0x260 fs/open.c:1213
    [<ffffffff815b8e6f>] do_sys_open fs/open.c:1229 [inline]
    [<ffffffff815b8e6f>] __do_sys_openat fs/open.c:1245 [inline]
    [<ffffffff815b8e6f>] __se_sys_openat fs/open.c:1240 [inline]
    [<ffffffff815b8e6f>] __x64_sys_openat+0x7f/0xe0 fs/open.c:1240
    [<ffffffff84565f05>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f05>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae


Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-gce-leak 2022/05/20 21:14 upstream 3d7285a335ed bd37ad7e .config log report syz C memory leak in tty_init_dev