> DRM_IOCTL_VIRTGPU_EXECBUFFER accepts a user-controlled command size and > copies the command with vmemdup_user(). For a vmalloc-backed command, > virtio-gpu maps each page to one SG entry, then adds a request and response > entry before submitting the chain to the control virtqueue. > > With indirect descriptors negotiated, the driver accounts for the chain as > one free ring descriptor. An unprivileged render client can therefore > submit more SG entries than the device Queue Size. A sufficiently large > split-ring command wraps the indirect table's u16 next index. The device > then consumes a chain different from the one constructed by the driver. > > Reject command sizes whose vmalloc page count plus the fixed request and > response exceeds the actual control Queue Size. This execbuffer check does > not depend on the ring layout and applies to both split and packed > virtqueues. The driver creates one command SG entry per page even when > [ ... ] > Link: > https://lore.kernel.org/all/[email protected]/ > Suggested-by: Hyeonjun Hong <[email protected]> > Suggested-by: GEONWOO HAN <[email protected]> > Cc: [email protected] > Signed-off-by: Seojin An <[email protected]>
Sashiko has reviewed this patch and found no issues. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=1
