⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278296 in webkit


Ignore:
Timestamp:
May 31, 2021, 11:18:35 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Cherry-pick ANGLE: Add array bounds checks for WebGL shaders
https://bugs.webkit.org/show_bug.cgi?id=226397

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-05-31
Reviewed by Dean Jackson.

Cherry-pick ANGLE commit b0d39ba2aba218402ff2f32f6e16f18cf4975ff4
At the moment does not affect any WebKit client.
Makes the code consistent with OpenGL.
Makes it easier to understand same change in Metal backend.

Upstream description:
Add array bounds checks for WebGL shaders
WebGL shaders may contain OOB array accesses which in turn
cause undefined behavior, which may result in security
issues. This was detected as an UNKNOWN READ by UBSAN while
testing with SwANGLE.

  • src/libANGLE/renderer/vulkan/ShaderVk.cpp:

(rx::ShaderVk::compile):

Location:
trunk/Source/ThirdParty/ANGLE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r278192 r278296  
     12021-05-31  Kimmo Kinnunen  <kkinnunen@apple.com>
     2
     3        Cherry-pick ANGLE: Add array bounds checks for WebGL shaders
     4        https://bugs.webkit.org/show_bug.cgi?id=226397
     5
     6        Reviewed by Dean Jackson.
     7
     8        Cherry-pick ANGLE commit b0d39ba2aba218402ff2f32f6e16f18cf4975ff4
     9        At the moment does not affect any WebKit client.
     10        Makes the code consistent with OpenGL.
     11        Makes it easier to understand same change in Metal backend.
     12
     13        Upstream description:
     14        Add array bounds checks for WebGL shaders
     15        WebGL shaders may contain OOB array accesses which in turn
     16        cause undefined behavior, which may result in security
     17        issues. This was detected as an UNKNOWN READ by UBSAN while
     18        testing with SwANGLE.
     19
     20        * src/libANGLE/renderer/vulkan/ShaderVk.cpp:
     21        (rx::ShaderVk::compile):
     22
    1232021-05-28  Kimmo Kinnunen  <kkinnunen@apple.com>
    224
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/ShaderVk.cpp

    r270351 r278296  
    3737        // Extra initialization in spirv shader may affect performance.
    3838        compileOptions |= SH_INITIALIZE_UNINITIALIZED_LOCALS;
     39
     40        // WebGL shaders may contain OOB array accesses which in turn cause undefined behavior,
     41        // which may result in security issues. See https://crbug.com/1189110.
     42        compileOptions |= SH_CLAMP_INDIRECT_ARRAY_BOUNDS;
    3943
    4044        if (mState.getShaderType() != gl::ShaderType::Compute)
Note: See TracChangeset for help on using the changeset viewer.