Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KMDOD: Correctly copy the DXGKRNL_INTERFACE structure #1020

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MartinDrab
Copy link

@MartinDrab MartinDrab commented Aug 19, 2023

During its DxgkDdiStartDevice routine, the KMDOD driver is provided with an DXGKRNL_INTERFACE structure containing mostly pointers to various WDDM interface functions that it my need to use. The driver copies this structure to its device-specific block of memory. However, the driver expected the system would provide the same version of the structure it uses, however, this is not necessarily true. Such behavior resulted in copying memory past the end of the system-provided structure which triggered the crash.

Fixed version of the driver copies only bytes really occupied by the DXGKRNL_INTERFACE structure (stored in its Size member).

This is a port of PR 967 from kvm-guest-drivers-windows.

During its DxgkDdiStartDevice routine, the KMDOD driver is provided with an DXGKRNL_INTERFACE structure containing mostly pointers to various WDDM interface functions that it my need to use. The driver copies this structure to its device-specific block of memory. However, the driver expected the system would provide the same version of the structure it uses, however, this is not necessarily true. Such behavior resulted in copying memory past the end of the system-provided structure which triggered the crash.

Fixed version of the driver copies only bytes really occupied by the DXGKRNL_INTERFACE structure (stored in its Size member).

Signed-off-by: Martin Drab <martin.drab@virtuozzo.com>
@MartinDrab MartinDrab changed the title [kmdod]: Correctly copy the DXGKRNL_INTERFACE structure KMDOD: Correctly copy the DXGKRNL_INTERFACE structure Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant