memory leak in drm_vma_node_allow

From: syzbot
Date: Sat Apr 11 2020 - 03:59:33 EST


Hello,

syzbot found the following crash on:

HEAD commit: 7e634208 Merge tag 'acpi-5.7-rc1-2' of git://git.kernel.or..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=156ec43be00000
kernel config: https://syzkaller.appspot.com/x/.config?x=d7f19fdf7ef2f5a4
dashboard link: https://syzkaller.appspot.com/bug?extid=04639d98c75c52e41b8a
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=121898ede00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+04639d98c75c52e41b8a@xxxxxxxxxxxxxxxxxxxxxxxxx

2020/04/07 05:10:47 executed programs: 23
2020/04/07 05:10:53 executed programs: 35
2020/04/07 05:11:00 executed programs: 46
2020/04/07 05:11:06 executed programs: 62
BUG: memory leak
unreferenced object 0xffff888104682080 (size 64):
comm "syz-executor.5", pid 8616, jiffies 4294946318 (age 15.290s)
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 da bd 03 81 88 ff ff ................
backtrace:
[<00000000cac525e9>] kmalloc include/linux/slab.h:555 [inline]
[<00000000cac525e9>] drm_vma_node_allow+0x32/0x120 drivers/gpu/drm/drm_vma_manager.c:274
[<00000000ab055b7c>] drm_gem_handle_create_tail+0xd8/0x250 drivers/gpu/drm/drm_gem.c:403
[<00000000d1e67364>] vgem_gem_create drivers/gpu/drm/vgem/vgem_drv.c:198 [inline]
[<00000000d1e67364>] vgem_gem_dumb_create+0x73/0x100 drivers/gpu/drm/vgem/vgem_drv.c:218
[<00000000dd87232b>] drm_mode_create_dumb+0xbe/0xf0 drivers/gpu/drm/drm_dumb_buffers.c:94
[<00000000d7ff7e08>] drm_ioctl_kernel+0xcb/0x130 drivers/gpu/drm/drm_ioctl.c:787
[<0000000080a20f26>] drm_ioctl+0x25c/0x420 drivers/gpu/drm/drm_ioctl.c:887
[<00000000d53a93ee>] vfs_ioctl fs/ioctl.c:47 [inline]
[<00000000d53a93ee>] ksys_ioctl+0xa6/0xd0 fs/ioctl.c:763
[<00000000c5492a67>] __do_sys_ioctl fs/ioctl.c:772 [inline]
[<00000000c5492a67>] __se_sys_ioctl fs/ioctl.c:770 [inline]
[<00000000c5492a67>] __x64_sys_ioctl+0x1a/0x20 fs/ioctl.c:770
[<00000000becf688f>] do_syscall_64+0x6e/0x220 arch/x86/entry/common.c:295
[<0000000050094727>] entry_SYSCALL_64_after_hwframe+0x44/0xa9



---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxxx

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches