upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/root_signature.cpp
diff options
context:
space:
mode:
authorSuarezPM <SuarezPM@users.noreply.github.com>2026-11-21 17:24:55 -0300
committerSuarezPM <SuarezPM@users.noreply.github.com>2026-11-21 17:24:55 -0300
commitab270f39d6f283975ead43092f0929fe081c2e72 (patch)
treed545ae1ba8d8ffdce14106f86c797409395a3a90 /runtime/src/root_signature.cpp
parentd2debe87af9fab6c1039ecdbc6dbb5bbb4022653 (diff)
Harden RTS0/oracle path: bound sampler counts, dump blob bytes on parse
The Windows oracle test segfaulted in CI. Most likely cause: an unbounded static-sampler reserve driven by real-blob bytes under a wrong layout hypothesis. Both decoders now refuse absurd sampler counts, and the oracle test prints the blob size plus the first 32 bytes before parsing so the next CI log shows the true D3D12 layout either way.
Diffstat (limited to 'runtime/src/root_signature.cpp')
-rw-r--r--runtime/src/root_signature.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/src/root_signature.cpp b/runtime/src/root_signature.cpp
index 4892ecb8c..8b43136be 100644
--- a/runtime/src/root_signature.cpp
+++ b/runtime/src/root_signature.cpp
@@ -163,6 +163,10 @@ DecodeResult decode_canonical(const uint8_t* data, size_t size) {
163 out.error = "more than 64 root parameters"; 163 out.error = "more than 64 root parameters";
164 return out; 164 return out;
165 } 165 }
166 if (nsamplers > 4096) {
167 out.error = "absurd sampler count";
168 return out;
169 }
166 out.sig.version = ver == 1 ? Version::V1_0 : Version::V1_1; 170 out.sig.version = ver == 1 ? Version::V1_0 : Version::V1_1;
167 out.sig.params.reserve(nparams); 171 out.sig.params.reserve(nparams);
168 for (uint32_t i = 0; i < nparams; ++i) { 172 for (uint32_t i = 0; i < nparams; ++i) {
@@ -241,6 +245,10 @@ DecodeResult parse_rts0(const uint8_t* data, size_t size) {
241 out.error = "RTS0 with more than 64 root parameters"; 245 out.error = "RTS0 with more than 64 root parameters";
242 return out; 246 return out;
243 } 247 }
248 if (nsamplers > 4096) {
249 out.error = "RTS0 with absurd sampler count";
250 return out;
251 }
244 out.sig.version = ver == 1 ? Version::V1_0 : Version::V1_1; 252 out.sig.version = ver == 1 ? Version::V1_0 : Version::V1_1;
245 out.sig.flags = flags; 253 out.sig.flags = flags;
246 out.sig.params.reserve(nparams); 254 out.sig.params.reserve(nparams);