Skip to content

Commit

Permalink
chore: update patches
Browse files Browse the repository at this point in the history
  • Loading branch information
patchup[bot] committed Apr 13, 2024
1 parent 42dcdbf commit beee48e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 31 deletions.
14 changes: 7 additions & 7 deletions patches/DirectXShaderCompiler/cherry-pick-a65e511a14b4.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
From a65e511a14b4bffda1b24052732b09ca130359d1 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Antonio Maiorano <amaiorano@google.com>
Date: Wed, 03 Apr 2024 15:58:51 -0400
Subject: [PATCH] Fix ASAN use-after-free on unreferenced self-assignment of struct instance (#6466)
Date: Wed, 3 Apr 2024 15:58:51 -0400
Subject: Fix ASAN use-after-free on unreferenced self-assignment of struct
instance (#6466)

When deleting an unused memcpy, ScalarReplAggregatesHLSL was attempting
to delete both the target and the source of the memcpy without first
Expand All @@ -13,13 +14,12 @@ Reviewed-on: https://chromium-review.googlesource.com/c/external/github.com/micr
Reviewed-by: David Neto <dneto@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@chromium.org>
---

diff --git a/lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp b/lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp
index 59f32a9..3f8ffdb 100644
index ae726fbcb67de79ed75992e6d31acfdc21f516c0..bd429ae98b0e11bbb2b95c68392b82eb222f64a4 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp
@@ -1003,9 +1003,11 @@
@@ -1003,9 +1003,11 @@ void DeleteMemcpy(MemCpyInst *MI) {
if (op0->user_empty())
op0->eraseFromParent();
}
Expand All @@ -36,7 +36,7 @@ index 59f32a9..3f8ffdb 100644

diff --git a/tools/clang/test/DXC/unreferenced_struct_selft_assignment_crash.hlsl b/tools/clang/test/DXC/unreferenced_struct_selft_assignment_crash.hlsl
new file mode 100644
index 0000000..81adf71
index 0000000000000000000000000000000000000000..81adf71867c9868992372e12dc1ba81aebb48344
--- /dev/null
+++ b/tools/clang/test/DXC/unreferenced_struct_selft_assignment_crash.hlsl
@@ -0,0 +1,24 @@
Expand Down
34 changes: 16 additions & 18 deletions patches/angle/cherry-pick-f6672dbbe223.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f6672dbbe223e68396d6dfab11edc342aa435719 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shahbaz Youssefi <syoussefi@chromium.org>
Date: Mon, 25 Mar 2024 14:46:56 -0400
Subject: [PATCH] M123: Translator: Disallow samplers in structs in interface blocks
Subject: M123: Translator: Disallow samplers in structs in interface blocks

As disallowed by the spec:

Expand All @@ -19,22 +19,18 @@ Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
(cherry picked from commit a0fa06f6d79ced897c0fe2795551268199d29806)
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5435737
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
---

diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index d8aec3c..ad39437 100644
index 036e9c4bbec2a4a949d77eb6d529dc52da6bb97b..b91f2a0625fd5f64a3d49e69a53e95735e9b812b 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -34,27 +34,39 @@
@@ -34,27 +34,39 @@ namespace

const int kWebGLMaxStructNesting = 4;

-bool ContainsSampler(const TStructure *structType);
-
-bool ContainsSampler(const TType &type)
+struct IsSamplerFunc
{
- if (IsSampler(type.getBasicType()))
+{
+ bool operator()(TBasicType type) { return IsSampler(type); }
+};
+struct IsOpaqueFunc
Expand All @@ -44,10 +40,12 @@ index d8aec3c..ad39437 100644
+
+template <typename OpaqueFunc>
+bool ContainsOpaque(const TStructure *structType);
+

-bool ContainsSampler(const TType &type)
+template <typename OpaqueFunc>
+bool ContainsOpaque(const TType &type)
+{
{
- if (IsSampler(type.getBasicType()))
+ if (OpaqueFunc{}(type.getBasicType()))
{
return true;
Expand All @@ -72,7 +70,7 @@ index d8aec3c..ad39437 100644
return true;
}
return false;
@@ -1120,7 +1132,7 @@
@@ -1057,7 +1069,7 @@ bool TParseContext::checkIsNotOpaqueType(const TSourceLoc &line,
{
if (pType.type == EbtStruct)
{
Expand All @@ -81,7 +79,7 @@ index d8aec3c..ad39437 100644
{
std::stringstream reasonStream = sh::InitializeStream<std::stringstream>();
reasonStream << reason << " (structure contains a sampler)";
@@ -4994,12 +5006,9 @@
@@ -4923,12 +4935,9 @@ TIntermDeclaration *TParseContext::addInterfaceBlock(
{
TField *field = (*fieldList)[memberIndex];
TType *fieldType = field->type();
Expand All @@ -97,10 +95,10 @@ index d8aec3c..ad39437 100644

const TQualifier qualifier = fieldType->getQualifier();
diff --git a/src/tests/gl_tests/GLSLTest.cpp b/src/tests/gl_tests/GLSLTest.cpp
index 1aaeaf8..2604bd7 100644
index ec075c7d08094686b45e10874d082612f6d59bcc..c9d954ed1f7a4bfd4d5b5d5916d3def07aaa2637 100644
--- a/src/tests/gl_tests/GLSLTest.cpp
+++ b/src/tests/gl_tests/GLSLTest.cpp
@@ -6716,7 +6716,34 @@
@@ -6716,7 +6716,34 @@ void main()
gl_FragColor = vec4(f(us), 0, 0, 1);
})";

Expand Down Expand Up @@ -136,7 +134,7 @@ index 1aaeaf8..2604bd7 100644
ASSERT_GL_NO_ERROR();
}

@@ -18430,6 +18457,116 @@
@@ -18212,6 +18239,116 @@ void main() {
EXPECT_EQ(0u, shader);
}

Expand Down Expand Up @@ -254,10 +252,10 @@ index 1aaeaf8..2604bd7 100644
// SPIR-V generator that made a copy of the array to pass to the function, by decomposing and
// reconstructing it (in the absence of OpCopyLogical), but the reconstruction instruction has a
diff --git a/src/tests/gl_tests/PixelLocalStorageTest.cpp b/src/tests/gl_tests/PixelLocalStorageTest.cpp
index 7b3e4eb..7666947 100644
index c49ba5741ad565ad9637fb2188a472ccbebc6284..126936271eb25eec601349a560fabc6f0f7d4b75 100644
--- a/src/tests/gl_tests/PixelLocalStorageTest.cpp
+++ b/src/tests/gl_tests/PixelLocalStorageTest.cpp
@@ -5574,8 +5574,7 @@
@@ -5573,8 +5573,7 @@ TEST_P(PixelLocalStorageCompilerTest, Declarations)
EXPECT_FALSE(log.compileFragmentShader(kPLSInStruct));
EXPECT_TRUE(log.has("ERROR: 0:5: 'pixelLocalANGLE' : disallowed type in struct"));
EXPECT_TRUE(
Expand Down
11 changes: 5 additions & 6 deletions patches/chromium/cherry-pick-1b1f34234346.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1b1f34234346db1df8751e51c7a26c533b308fb4 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kylechar <kylechar@chromium.org>
Date: Tue, 09 Apr 2024 17:14:26 +0000
Subject: [PATCH] [M120-LTS] Validate buffer length
Date: Tue, 9 Apr 2024 17:14:26 +0000
Subject: Validate buffer length

The BitmapInSharedMemory mojo traits were only validating row length and
not total buffer length.
Expand All @@ -24,13 +24,12 @@ Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/branch-heads/6099@{#2003}
Cr-Branched-From: e6ee4500f7d6549a9ac1354f8d056da49ef406be-refs/heads/main@{#1217362}
---

diff --git a/services/viz/public/cpp/compositing/bitmap_in_shared_memory_mojom_traits.cc b/services/viz/public/cpp/compositing/bitmap_in_shared_memory_mojom_traits.cc
index a6e5f45..519d554 100644
index a6e5f45d9e72b9ac48e536c3a7756966b3c263cf..519d554055e5182cdcbae44fafdac339a64a923b 100644
--- a/services/viz/public/cpp/compositing/bitmap_in_shared_memory_mojom_traits.cc
+++ b/services/viz/public/cpp/compositing/bitmap_in_shared_memory_mojom_traits.cc
@@ -76,6 +76,10 @@
@@ -76,6 +76,10 @@ bool StructTraits<viz::mojom::BitmapInSharedMemoryDataView, SkBitmap>::Read(
if (!mapping_ptr->IsValid())
return false;

Expand Down

0 comments on commit beee48e

Please sign in to comment.