Bug 4436 - [ANCK 5.10] virtio-gpu: fix a missing check to avoid NULL dereference
Summary: [ANCK 5.10] virtio-gpu: fix a missing check to avoid NULL dereference
Status: NEW
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: 5.10.y-10
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: er222XIAO
QA Contact: shuming
URL:
Whiteboard:
Keywords: Bugfix
Depends on:
Blocks:
 
Reported: 2023-03-08 14:53 UTC by er222XIAO
Modified: 2023-03-08 15:06 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description er222XIAO 2023-03-08 14:53:24 UTC
Description of problem:
    virtio-gpu: fix a missing check to avoid NULL dereference
    
    [ Upstream commit bd63f11f4c3c46afec07d821f74736161ff6e526 ]
    
    'cache_ent' could be set NULL inside virtio_gpu_cmd_get_capset()
    and it will lead to a NULL dereference by a lately use of it
    (i.e., ptr = cache_ent->caps_cache). Fix it with a NULL check.


Additional info:
Upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/gpu/drm/virtio/virtgpu_ioctl.c?h=linux-5.10.y&id=259773fc874258606c0121767a4a27466ff337eb