summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec/errors.rs
diff options
context:
space:
mode:
authorZack Rusin <zack.rusin@broadcom.com>2026-10-29 10:45:07 -0400
committerZack Rusin <zack.rusin@broadcom.com>2026-11-16 15:09:32 -0500
commit9725b0454e65f15ae76788f2004a7ba8b493362a (patch)
tree1da226763a670958a90f7a90641ea9c35bdabe1d /rust/kernel/alloc/kvec/errors.rs
parent05ee42f3dd5484415fac587d0efb8fe846b74c2c (diff)
drm/vmwgfx: bound MKSSTAT lengths before rounding to pages
vmw_mksstat_add_ioctl rounds the user-supplied 64bit lengths to page counts before comparing them with the descriptors page arrays. PFN_UP can wrap for lengths near U64_MAX. On 32bit kernels, storing a large page count in size_t can also truncate it to a value that passes the checks. A render-node client can therefore register a descriptor with lengths that exceed its pinned page arrays, including nonzero lengths with no backing pages. Compare each byte length with its page array's capacity before rounding or narrowing it. Compute those capacities in 64 bits and calculate the page counts only after all three lengths have passed validation. Sashiko reported this while reviewing the i386 hypercall changes. Fixes: 7a7a933edd6c ("drm/vmwgfx: Introduce VMware mks-guest-stats") 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-2-zack.rusin@broadcom.com
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions