Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • xserver xserver
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 935
    • Issues 935
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 121
    • Merge requests 121
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

Update #1:

Due to abusive users subverting our CI facilities to mine cryptocurrency, breaking out of the container sandbox in the process, we have been forced to take actions to limit the usage of the public runners to official projects only.

The policy will be enforced on 2023-03-23 (or before if we detect abuses).

Please see this issue for more context and to see if and how you are impacted.

  • xorgxorg
  • xserverxserver
  • Merge requests
  • !1008

xwayland: Support CHERI/Morello by not storing pointers in uint64_t

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Jessica Clarke requested to merge jrtc27/xserver:xwayland-event-id-pointer into master Dec 05, 2022
  • Overview 3
  • Commits 4
  • Pipelines 1
  • Changes 1

On traditional 32-bit and 64-bit architectures, uint64_t can be abused to hold a uintptr_t and be cast back to a valid pointer. However, on CHERI, and thus Arm's Morello prototype, pointers are capabilities, which contain a traditional address alongside additional metadata, including a tag bit that ensures it cannot be forged (the only way to get a capability with the tag bit set is by using instructions that take in another valid capability with sufficient bounds/permissions/etc for the request, and any other operation, like overwriting individual bytes in memory, will give a capability whose tag is clear). Casting a pointer to a uintptr_t is fine as uintptr_t is represented as a capability, but casting to a uint64_t yields just the address, losing the metadata and tag. Thus, when cast back to a uintptr_t, the capability remains invalid and faults on any attempt to dereference.

As with various other places in the tree, address this by searching for the pointer in a list so that we no longer rely on this undefined behaviour.

As part of this, a bunch of cleanup is done to reduce the number of places that have to convert from event_id back to event in the first place.

A more invasive change would be to pass the vblank itself through the callbacks, or have some kind of arbitrary data field in the vblank that's a pointer to whatever the present implementation wants (which could also allow xwayland to stop extending present_vblank_rec), but this is the simplest change to make it work and seems consistent with other places like the modesetting vblank sequence number handling and scmd.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: xwayland-event-id-pointer