syzbot


memory leak in nbd_add_socket

Status: fixed on 2020/08/01 00:48
Reported-by: syzbot+934037347002901b8d2a@syzkaller.appspotmail.com
Fix commit: 579dd91ab3a5 nbd: Fix memory leak in nbd_add_socket
First crash: 862d, last: 862d
Patch testing requests:
Created Duration User Patch Repo Result
2020/04/01 17:18 13m anenbupt@gmail.com patch git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 673b41e0 log

Sample crash report:
BUG: memory leak
unreferenced object 0xffff88810fd584a0 (size 32):
  comm "syz-executor586", pid 8424, jiffies 4294961663 (age 40.060s)
  hex dump (first 32 bytes):
    2f 64 65 76 2f 6e 62 64 30 00 00 00 00 00 00 00  /dev/nbd0.......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000090cb73c8>] __do_krealloc mm/slab_common.c:1671 [inline]
    [<0000000090cb73c8>] krealloc+0x7c/0xa0 mm/slab_common.c:1700
    [<00000000cf9e6ba7>] nbd_add_socket+0x7d/0x1e0 drivers/block/nbd.c:1040
    [<0000000040a0a881>] __nbd_ioctl drivers/block/nbd.c:1373 [inline]
    [<0000000040a0a881>] nbd_ioctl+0x175/0x430 drivers/block/nbd.c:1437
    [<000000004972a55a>] __blkdev_driver_ioctl block/ioctl.c:322 [inline]
    [<000000004972a55a>] blkdev_ioctl+0x147/0x300 block/ioctl.c:718
    [<000000008903d911>] block_ioctl+0x50/0x70 fs/block_dev.c:1995
    [<00000000c37950d9>] vfs_ioctl fs/ioctl.c:47 [inline]
    [<00000000c37950d9>] ksys_ioctl+0xa6/0xd0 fs/ioctl.c:763
    [<00000000ffe4bbdc>] __do_sys_ioctl fs/ioctl.c:772 [inline]
    [<00000000ffe4bbdc>] __se_sys_ioctl fs/ioctl.c:770 [inline]
    [<00000000ffe4bbdc>] __x64_sys_ioctl+0x1a/0x20 fs/ioctl.c:770
    [<00000000ede38b98>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:294
    [<00000000553f73d5>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810fd584a0 (size 32):
  comm "syz-executor586", pid 8424, jiffies 4294961663 (age 40.170s)
  hex dump (first 32 bytes):
    2f 64 65 76 2f 6e 62 64 30 00 00 00 00 00 00 00  /dev/nbd0.......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000090cb73c8>] __do_krealloc mm/slab_common.c:1671 [inline]
    [<0000000090cb73c8>] krealloc+0x7c/0xa0 mm/slab_common.c:1700
    [<00000000cf9e6ba7>] nbd_add_socket+0x7d/0x1e0 drivers/block/nbd.c:1040
    [<0000000040a0a881>] __nbd_ioctl drivers/block/nbd.c:1373 [inline]
    [<0000000040a0a881>] nbd_ioctl+0x175/0x430 drivers/block/nbd.c:1437
    [<000000004972a55a>] __blkdev_driver_ioctl block/ioctl.c:322 [inline]
    [<000000004972a55a>] blkdev_ioctl+0x147/0x300 block/ioctl.c:718
    [<000000008903d911>] block_ioctl+0x50/0x70 fs/block_dev.c:1995
    [<00000000c37950d9>] vfs_ioctl fs/ioctl.c:47 [inline]
    [<00000000c37950d9>] ksys_ioctl+0xa6/0xd0 fs/ioctl.c:763
    [<00000000ffe4bbdc>] __do_sys_ioctl fs/ioctl.c:772 [inline]
    [<00000000ffe4bbdc>] __se_sys_ioctl fs/ioctl.c:770 [inline]
    [<00000000ffe4bbdc>] __x64_sys_ioctl+0x1a/0x20 fs/ioctl.c:770
    [<00000000ede38b98>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:294
    [<00000000553f73d5>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810fd584a0 (size 32):
  comm "syz-executor586", pid 8424, jiffies 4294961663 (age 40.270s)
  hex dump (first 32 bytes):
    2f 64 65 76 2f 6e 62 64 30 00 00 00 00 00 00 00  /dev/nbd0.......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000090cb73c8>] __do_krealloc mm/slab_common.c:1671 [inline]
    [<0000000090cb73c8>] krealloc+0x7c/0xa0 mm/slab_common.c:1700
    [<00000000cf9e6ba7>] nbd_add_socket+0x7d/0x1e0 drivers/block/nbd.c:1040
    [<0000000040a0a881>] __nbd_ioctl drivers/block/nbd.c:1373 [inline]
    [<0000000040a0a881>] nbd_ioctl+0x175/0x430 drivers/block/nbd.c:1437
    [<000000004972a55a>] __blkdev_driver_ioctl block/ioctl.c:322 [inline]
    [<000000004972a55a>] blkdev_ioctl+0x147/0x300 block/ioctl.c:718
    [<000000008903d911>] block_ioctl+0x50/0x70 fs/block_dev.c:1995
    [<00000000c37950d9>] vfs_ioctl fs/ioctl.c:47 [inline]
    [<00000000c37950d9>] ksys_ioctl+0xa6/0xd0 fs/ioctl.c:763
    [<00000000ffe4bbdc>] __do_sys_ioctl fs/ioctl.c:772 [inline]
    [<00000000ffe4bbdc>] __se_sys_ioctl fs/ioctl.c:770 [inline]
    [<00000000ffe4bbdc>] __x64_sys_ioctl+0x1a/0x20 fs/ioctl.c:770
    [<00000000ede38b98>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:294
    [<00000000553f73d5>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810fd584a0 (size 32):
  comm "syz-executor586", pid 8424, jiffies 4294961663 (age 40.380s)
  hex dump (first 32 bytes):
    2f 64 65 76 2f 6e 62 64 30 00 00 00 00 00 00 00  /dev/nbd0.......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000090cb73c8>] __do_krealloc mm/slab_common.c:1671 [inline]
    [<0000000090cb73c8>] krealloc+0x7c/0xa0 mm/slab_common.c:1700
    [<00000000cf9e6ba7>] nbd_add_socket+0x7d/0x1e0 drivers/block/nbd.c:1040
    [<0000000040a0a881>] __nbd_ioctl drivers/block/nbd.c:1373 [inline]
    [<0000000040a0a881>] nbd_ioctl+0x175/0x430 drivers/block/nbd.c:1437
    [<000000004972a55a>] __blkdev_driver_ioctl block/ioctl.c:322 [inline]
    [<000000004972a55a>] blkdev_ioctl+0x147/0x300 block/ioctl.c:718
    [<000000008903d911>] block_ioctl+0x50/0x70 fs/block_dev.c:1995
    [<00000000c37950d9>] vfs_ioctl fs/ioctl.c:47 [inline]
    [<00000000c37950d9>] ksys_ioctl+0xa6/0xd0 fs/ioctl.c:763
    [<00000000ffe4bbdc>] __do_sys_ioctl fs/ioctl.c:772 [inline]
    [<00000000ffe4bbdc>] __se_sys_ioctl fs/ioctl.c:770 [inline]
    [<00000000ffe4bbdc>] __x64_sys_ioctl+0x1a/0x20 fs/ioctl.c:770
    [<00000000ede38b98>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:294
    [<00000000553f73d5>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810fd584a0 (size 32):
  comm "syz-executor586", pid 8424, jiffies 4294961663 (age 40.480s)
  hex dump (first 32 bytes):
    2f 64 65 76 2f 6e 62 64 30 00 00 00 00 00 00 00  /dev/nbd0.......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000090cb73c8>] __do_krealloc mm/slab_common.c:1671 [inline]
    [<0000000090cb73c8>] krealloc+0x7c/0xa0 mm/slab_common.c:1700
    [<00000000cf9e6ba7>] nbd_add_socket+0x7d/0x1e0 drivers/block/nbd.c:1040
    [<0000000040a0a881>] __nbd_ioctl drivers/block/nbd.c:1373 [inline]
    [<0000000040a0a881>] nbd_ioctl+0x175/0x430 drivers/block/nbd.c:1437
    [<000000004972a55a>] __blkdev_driver_ioctl block/ioctl.c:322 [inline]
    [<000000004972a55a>] blkdev_ioctl+0x147/0x300 block/ioctl.c:718
    [<000000008903d911>] block_ioctl+0x50/0x70 fs/block_dev.c:1995
    [<00000000c37950d9>] vfs_ioctl fs/ioctl.c:47 [inline]
    [<00000000c37950d9>] ksys_ioctl+0xa6/0xd0 fs/ioctl.c:763
    [<00000000ffe4bbdc>] __do_sys_ioctl fs/ioctl.c:772 [inline]
    [<00000000ffe4bbdc>] __se_sys_ioctl fs/ioctl.c:770 [inline]
    [<00000000ffe4bbdc>] __x64_sys_ioctl+0x1a/0x20 fs/ioctl.c:770
    [<00000000ede38b98>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:294
    [<00000000553f73d5>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810fd584a0 (size 32):
  comm "syz-executor586", pid 8424, jiffies 4294961663 (age 40.590s)
  hex dump (first 32 bytes):
    2f 64 65 76 2f 6e 62 64 30 00 00 00 00 00 00 00  /dev/nbd0.......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000090cb73c8>] __do_krealloc mm/slab_common.c:1671 [inline]
    [<0000000090cb73c8>] krealloc+0x7c/0xa0 mm/slab_common.c:1700
    [<00000000cf9e6ba7>] nbd_add_socket+0x7d/0x1e0 drivers/block/nbd.c:1040
    [<0000000040a0a881>] __nbd_ioctl drivers/block/nbd.c:1373 [inline]
    [<0000000040a0a881>] nbd_ioctl+0x175/0x430 drivers/block/nbd.c:1437
    [<000000004972a55a>] __blkdev_driver_ioctl block/ioctl.c:322 [inline]
    [<000000004972a55a>] blkdev_ioctl+0x147/0x300 block/ioctl.c:718
    [<000000008903d911>] block_ioctl+0x50/0x70 fs/block_dev.c:1995
    [<00000000c37950d9>] vfs_ioctl fs/ioctl.c:47 [inline]
    [<00000000c37950d9>] ksys_ioctl+0xa6/0xd0 fs/ioctl.c:763
    [<00000000ffe4bbdc>] __do_sys_ioctl fs/ioctl.c:772 [inline]
    [<00000000ffe4bbdc>] __se_sys_ioctl fs/ioctl.c:770 [inline]
    [<00000000ffe4bbdc>] __x64_sys_ioctl+0x1a/0x20 fs/ioctl.c:770
    [<00000000ede38b98>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:294
    [<00000000553f73d5>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810fd584a0 (size 32):
  comm "syz-executor586", pid 8424, jiffies 4294961663 (age 40.690s)
  hex dump (first 32 bytes):
    2f 64 65 76 2f 6e 62 64 30 00 00 00 00 00 00 00  /dev/nbd0.......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000090cb73c8>] __do_krealloc mm/slab_common.c:1671 [inline]
    [<0000000090cb73c8>] krealloc+0x7c/0xa0 mm/slab_common.c:1700
    [<00000000cf9e6ba7>] nbd_add_socket+0x7d/0x1e0 drivers/block/nbd.c:1040
    [<0000000040a0a881>] __nbd_ioctl drivers/block/nbd.c:1373 [inline]
    [<0000000040a0a881>] nbd_ioctl+0x175/0x430 drivers/block/nbd.c:1437
    [<000000004972a55a>] __blkdev_driver_ioctl block/ioctl.c:322 [inline]
    [<000000004972a55a>] blkdev_ioctl+0x147/0x300 block/ioctl.c:718
    [<000000008903d911>] block_ioctl+0x50/0x70 fs/block_dev.c:1995
    [<00000000c37950d9>] vfs_ioctl fs/ioctl.c:47 [inline]
    [<00000000c37950d9>] ksys_ioctl+0xa6/0xd0 fs/ioctl.c:763
    [<00000000ffe4bbdc>] __do_sys_ioctl fs/ioctl.c:772 [inline]
    [<00000000ffe4bbdc>] __se_sys_ioctl fs/ioctl.c:770 [inline]
    [<00000000ffe4bbdc>] __x64_sys_ioctl+0x1a/0x20 fs/ioctl.c:770
    [<00000000ede38b98>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:294
    [<00000000553f73d5>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

BUG: memory leak
unreferenced object 0xffff88810fd584a0 (size 32):
  comm "syz-executor586", pid 8424, jiffies 4294961663 (age 40.800s)
  hex dump (first 32 bytes):
    2f 64 65 76 2f 6e 62 64 30 00 00 00 00 00 00 00  /dev/nbd0.......
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000090cb73c8>] __do_krealloc mm/slab_common.c:1671 [inline]
    [<0000000090cb73c8>] krealloc+0x7c/0xa0 mm/slab_common.c:1700
    [<00000000cf9e6ba7>] nbd_add_socket+0x7d/0x1e0 drivers/block/nbd.c:1040
    [<0000000040a0a881>] __nbd_ioctl drivers/block/nbd.c:1373 [inline]
    [<0000000040a0a881>] nbd_ioctl+0x175/0x430 drivers/block/nbd.c:1437
    [<000000004972a55a>] __blkdev_driver_ioctl block/ioctl.c:322 [inline]
    [<000000004972a55a>] blkdev_ioctl+0x147/0x300 block/ioctl.c:718
    [<000000008903d911>] block_ioctl+0x50/0x70 fs/block_dev.c:1995
    [<00000000c37950d9>] vfs_ioctl fs/ioctl.c:47 [inline]
    [<00000000c37950d9>] ksys_ioctl+0xa6/0xd0 fs/ioctl.c:763
    [<00000000ffe4bbdc>] __do_sys_ioctl fs/ioctl.c:772 [inline]
    [<00000000ffe4bbdc>] __se_sys_ioctl fs/ioctl.c:770 [inline]
    [<00000000ffe4bbdc>] __x64_sys_ioctl+0x1a/0x20 fs/ioctl.c:770
    [<00000000ede38b98>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:294
    [<00000000553f73d5>] entry_SYSCALL_64_after_hwframe+0x44/0xa9


Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-gce-leak 2020/03/31 12:11 upstream 673b41e04a03 c8d1cc20 .config log report syz C