diff options
| author | Pavel Skripkin <[email protected]> | 2021-12-30 14:26:49 +0000 |
|---|---|---|
| committer | Gerd Hoffmann <[email protected]> | 2022-01-18 06:52:41 +0000 |
| commit | 2b6dd600dd72573c23ea180b5b0b2f1813405882 (patch) | |
| tree | ddd26905a18679cd5860f0b3e1ad926348c7e52e /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
| parent | drm/bridge: anx7625: Return -EPROBE_DEFER if the dsi host was not found (diff) | |
| download | kernel-2b6dd600dd72573c23ea180b5b0b2f1813405882.tar.gz kernel-2b6dd600dd72573c23ea180b5b0b2f1813405882.zip | |
udmabuf: validate ubuf->pagecount
Syzbot has reported GPF in sg_alloc_append_table_from_pages(). The
problem was in ubuf->pages == ZERO_PTR.
ubuf->pagecount is calculated from arguments passed from user-space. If
user creates udmabuf with list.size == 0 then ubuf->pagecount will be
also equal to zero; it causes kmalloc_array() to return ZERO_PTR.
Fix it by validating ubuf->pagecount before passing it to
kmalloc_array().
Fixes: fbb0de795078 ("Add udmabuf misc device")
Reported-and-tested-by: [email protected]
Signed-off-by: Pavel Skripkin <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
0 files changed, 0 insertions, 0 deletions
