Re: [syzbot] memory leak in drm_vma_node_allow

From: syzbot
Date: Wed Nov 09 2022 - 13:25:53 EST


syzbot has found a reproducer for the following issue on:

HEAD commit: f141df371335 Merge tag 'audit-pr-20221107' of git://git.ke..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=123bdcd1880000
kernel config: https://syzkaller.appspot.com/x/.config?x=f7ebe38e4b66a7b
dashboard link: https://syzkaller.appspot.com/bug?extid=04639d98c75c52e41b8a
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=158ec0c1880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=120cc3e1880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d056ae4a8f32/disk-f141df37.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/02fdf71b87b4/vmlinux-f141df37.xz
kernel image: https://storage.googleapis.com/syzbot-assets/14078d70a64d/bzImage-f141df37.xz

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

executing program
executing program
executing program
executing program
BUG: memory leak
unreferenced object 0xffff88810f65f0c0 (size 64):
comm "syz-executor402", pid 3630, jiffies 4294948375 (age 13.410s)
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 94 b3 05 81 88 ff ff ................
backtrace:
[<ffffffff814cfce0>] kmalloc_trace+0x20/0x90 mm/slab_common.c:1046
[<ffffffff826b5bd2>] kmalloc include/linux/slab.h:576 [inline]
[<ffffffff826b5bd2>] drm_vma_node_allow+0x32/0x120 drivers/gpu/drm/drm_vma_manager.c:274
[<ffffffff8269bbda>] drm_gem_handle_create_tail+0x10a/0x250 drivers/gpu/drm/drm_gem.c:377
[<ffffffff826e45e9>] drm_gem_shmem_create_with_handle drivers/gpu/drm/drm_gem_shmem_helper.c:432 [inline]
[<ffffffff826e45e9>] drm_gem_shmem_dumb_create+0xb9/0x200 drivers/gpu/drm/drm_gem_shmem_helper.c:534
[<ffffffff826cb557>] drm_mode_create_dumb+0x117/0x150 drivers/gpu/drm/drm_dumb_buffers.c:96
[<ffffffff8269d094>] drm_ioctl_kernel+0x144/0x260 drivers/gpu/drm/drm_ioctl.c:788
[<ffffffff8269d49c>] drm_ioctl+0x2ec/0x4f0 drivers/gpu/drm/drm_ioctl.c:891
[<ffffffff81602aec>] vfs_ioctl fs/ioctl.c:51 [inline]
[<ffffffff81602aec>] __do_sys_ioctl fs/ioctl.c:870 [inline]
[<ffffffff81602aec>] __se_sys_ioctl fs/ioctl.c:856 [inline]
[<ffffffff81602aec>] __x64_sys_ioctl+0xfc/0x140 fs/ioctl.c:856
[<ffffffff84608245>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff84608245>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84800087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd