summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec/errors.rs
diff options
context:
space:
mode:
authorZack Rusin <zack.rusin@broadcom.com>2026-10-29 10:44:49 -0400
committerZack Rusin <zack.rusin@broadcom.com>2026-11-16 15:09:31 -0500
commit05ee42f3dd5484415fac587d0efb8fe846b74c2c (patch)
tree04597d1501fe260316e880cfc44bf0702c3d014b /rust/kernel/alloc/kvec/errors.rs
parentc4b134969ce350cdd4e726b5102b85b8a2d6fad5 (diff)
drm/vmwgfx: avoid underflow when stripping short GuestInfo replies
vmw_host_get_guestinfo subtracts the two-byte reply prefix using max(reply_len - 2, (size_t)0). Since reply_len is unsigned, a one-byte reply wraps to SIZE_MAX instead of being clamped to zero. The subsequent copy can read past the host reply allocation. Theoretically malformed host reply can reach this path when the driver queries the GuestInfo parameter used to enable VKMS. Check the reply length before subtracting the prefix so short replies produce an empty payload and cannot cause an out-of-bounds read. Sashiko reported this while reviewing the i386 hypercall changes. Fixes: 89da76fde68d ("drm/vmwgfx: Add VMWare host messaging capability") Cc: stable@vger.kernel.org Closes: https://sashiko.dev/#/patchset/4ab10678a8f50053934b62b56af81f881c1d3798.1788414669.git.zack.rusin%40broadcom.com Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com> Link: https://patch.msgid.link/20261029215738.3010276-1-zack.rusin@broadcom.com
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions