Skip to content

Data races and security #1788

Closed
Closed

Description

@alan-baker

Raising this issue for awareness and discussion. Google believes that there is a potential security issue relying on inserted bounds checks in generated code (SPIR-V, HLSL, DXIL, MSL) when a program contains one or more data races. Most implementations consider a data race to be undefined behaviour and compilers will assume data races do not occur which might lead to incorrect code generation at a lower level. That incorrect code generation could lead to bounds checks being optimized away allowing a malicious shader to read memory outside its purview. We are investigating possible mitigations of such a problem, but do not have a full solution yet.

Whether this is a problem for other implementations likely depends on the architecture of your implementation and, potentially, the underlying implementations you use.

Activity

  1. added
    wgsl
    on Jun 1, 2021
  2. alan-baker commented on Aug 4, 2021

    @alan-baker
    ContributorAuthor

    We discussed this internally with some of our security colleagues and no longer expect this to be particularly problematic. They acknowledged that it is probably possible to leak data via a race, but that it is unlikely to have enough throughput to be a practical attack vector and would depend on specific implementation knowledge. It is more likely that attackers would focus on different exploits.

  3. kdashg commented on Aug 9, 2021

    @kdashg
    Contributor
    WGSL meeting minutes 2021-08-03
    • AB: We discussed this internally. We took it to our security teams. They said “you have way bigger problems than this. So don’t sweat this.” We’re not planning to do anything extra special here any more
    • AB: Using data races is not the most reliable way to attack the GPU.
    • JB: We want to know what kind of attacks we want to protect against
    • BC: They were trying to say that exploitation of GPU code is significantly rarer than CPU-side attacks. The first set of things that people look for are vulns in CPU code. The number of successful breaking-out of the sandbox by using the GPUs is rare. We should be focusing on the API and compiler stack
    • AB: Their feedback is “this is not a practical way to [missed]”
    • JG: Please say some stuff in the issue about all this, and close it.
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

    wgsl

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions