Skip to content

Wine leaks non-canonical pointers to x86-64 processes #5946

Description

@Sonicadvance1

At the very least GPU pointers get leaked that are non-canonical to x86-64 to the guest application. Noticed this while running Touhou Koumakyou: New Classic - the Embodiment of Scarlet Devil but it can theoretically happen with any x86-64 game.

Wine doesn't reserve the upper 128TB of VA space, so it'll just end up leaking pointers. We had to fix this on the Linux side otherwise golang applications would break since they do canonical pointer checks (although they can also break on 57-bit VA systems).

FEX could probably partially resolve this by reserving memory in that space just like on the Linux side, but it would be better if WINE itself solved this. With the unixlib it wouldn't be hard to late reserve the region but they could potentially still leak things if they allocated arenas early?

We should have a debug-only option to do canonical pointer checks on memory accesses. Would be incredibly slow, but would let us find more leaks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions