Browse Source

backports

Frank-Rainer Grahl 2 weeks ago
parent
commit
59a85f352d

+ 34 - 0
mozilla-release/patches/1493449-64a1.patch

@@ -0,0 +1,34 @@
+# HG changeset patch
+# User Boris Zbarsky <bzbarsky@mit.edu>
+# Date 1538801353 0
+# Node ID e2ec1eeb812d2a3178c303e9ba5538e0d2264bec
+# Parent  3147b219ecc28435d75c59625571e75628c22711
+Bug 1493449.  Change the default credentials mode for module scripts from 'omit' to 'same-origin'.  r=farre
+
+Differential Revision: https://phabricator.services.mozilla.com/D7113
+
+diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp
+--- a/dom/script/ScriptLoader.cpp
++++ b/dom/script/ScriptLoader.cpp
+@@ -1012,19 +1012,18 @@ ScriptLoader::StartLoad(ScriptLoadReques
+   nsIDocShell* docshell = window->GetDocShell();
+   nsCOMPtr<nsIInterfaceRequestor> prompter(do_QueryInterface(docshell));
+ 
+   nsSecurityFlags securityFlags;
+   if (aRequest->IsModuleRequest()) {
+     // According to the spec, module scripts have different behaviour to classic
+     // scripts and always use CORS.
+     securityFlags = nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS;
+-    if (aRequest->mCORSMode == CORS_NONE) {
+-      securityFlags |= nsILoadInfo::SEC_COOKIES_OMIT;
+-    } else if (aRequest->mCORSMode == CORS_ANONYMOUS) {
++    if (aRequest->mCORSMode == CORS_NONE ||
++        aRequest->mCORSMode == CORS_ANONYMOUS) {
+       securityFlags |= nsILoadInfo::SEC_COOKIES_SAME_ORIGIN;
+     } else {
+       MOZ_ASSERT(aRequest->mCORSMode == CORS_USE_CREDENTIALS);
+       securityFlags |= nsILoadInfo::SEC_COOKIES_INCLUDE;
+     }
+   } else {
+     securityFlags = aRequest->mCORSMode == CORS_NONE
+       ? nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL

+ 86 - 0
mozilla-release/patches/1907230-130a1.patch

@@ -0,0 +1,86 @@
+# HG changeset patch
+# User Iain Ireland <iireland@mozilla.com>
+# Date 1721088494 0
+# Node ID 438d0a5ed0b3aa690cc5fc046b124b173ee34d93
+# Parent  db8883f37d699d64e05ef4b342713d5cb66e0a29
+Bug 1907230: Fix error handling in xpc::CreateSandboxObject r=mccr8
+
+Differential Revision: https://phabricator.services.mozilla.com/D216599
+
+diff --git a/js/xpconnect/crashtests/1907230.html b/js/xpconnect/crashtests/1907230.html
+new file mode 100644
+--- /dev/null
++++ b/js/xpconnect/crashtests/1907230.html
+@@ -0,0 +1,8 @@
++<!DOCTYPE html>
++<script>
++window.addEventListener("load", () => {
++  let a = new UIEvent("load", {"bubbles": true})
++  try { document.doctype.dispatchEvent(a) } catch (e) {}
++  document.write("<audio>")
++})
++</script>
+diff --git a/js/xpconnect/crashtests/crashtests.list b/js/xpconnect/crashtests/crashtests.list
+--- a/js/xpconnect/crashtests/crashtests.list
++++ b/js/xpconnect/crashtests/crashtests.list
+@@ -51,8 +51,9 @@ load 797583.html
+ load 806751.html
+ load 833856.html
+ load 851418.html
+ load 854139.html
+ load 854604.html
+ pref(dom.use_xbl_scopes_for_remote_xul,true) load 898939.html
+ pref(security.fileuri.strict_origin_policy,false) load 938297.html
+ load 977538.html
++load 1907230.html
+diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp
+--- a/js/xpconnect/src/Sandbox.cpp
++++ b/js/xpconnect/src/Sandbox.cpp
+@@ -1258,17 +1258,20 @@ xpc::CreateSandboxObject(JSContext* cx, 
+     vp.setObject(*sandbox);
+     if (js::GetContextCompartment(cx) && !JS_WrapValue(cx, vp))
+         return NS_ERROR_UNEXPECTED;
+ 
+     // Set the location information for the new global, so that tools like
+     // about:memory may use that information
+     xpc::SetLocationForGlobal(sandbox, options.sandboxName);
+ 
+-    xpc::SetSandboxMetadata(cx, sandbox, options.metadata);
++    nsresult rv = xpc::SetSandboxMetadata(cx, sandbox, options.metadata);
++    if (NS_WARN_IF(NS_FAILED(rv))) {
++      return rv;
++    }
+ 
+     JSAutoCompartment ac(cx, sandbox);
+     JS_FireOnNewGlobalObject(cx, sandbox);
+ 
+     return NS_OK;
+ }
+ 
+ NS_IMETHODIMP
+diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h
+--- a/js/xpconnect/src/xpcprivate.h
++++ b/js/xpconnect/src/xpcprivate.h
+@@ -2933,19 +2933,19 @@ GetSandboxAddonId(JSContext* cx, JS::Han
+                   JS::MutableHandleValue rval);
+ 
+ // Helper for retrieving metadata stored in a reserved slot. The metadata
+ // is set during the sandbox creation using the "metadata" option.
+ nsresult
+ GetSandboxMetadata(JSContext* cx, JS::HandleObject sandboxArg,
+                    JS::MutableHandleValue rval);
+ 
+-nsresult
+-SetSandboxMetadata(JSContext* cx, JS::HandleObject sandboxArg,
+-                   JS::HandleValue metadata);
++[[nodiscard]] nsresult SetSandboxMetadata(JSContext* cx,
++                                          JS::HandleObject sandboxArg,
++                                          JS::HandleValue metadata);
+ 
+ bool
+ CreateObjectIn(JSContext* cx, JS::HandleValue vobj, CreateObjectInOptions& options,
+                JS::MutableHandleValue rval);
+ 
+ bool
+ EvalInWindow(JSContext* cx, const nsAString& source, JS::HandleObject scope,
+              JS::MutableHandleValue rval);

+ 214 - 0
mozilla-release/patches/1912471-132a1.patch

@@ -0,0 +1,214 @@
+# HG changeset patch
+# User Steve Fink <sfink@mozilla.com>
+# Date 1725418656 0
+# Node ID 477a37c49b20b34b3e94d9792671de2bf260f949
+# Parent  92c355f44c71f78d04f1ad3103575fc6f9b63828
+Bug 1912471 - Disallow deserializing structured clone buffers with transferables more than once r=iain
+
+Differential Revision: https://phabricator.services.mozilla.com/D220644
+
+diff --git a/js/public/StructuredClone.h b/js/public/StructuredClone.h
+--- a/js/public/StructuredClone.h
++++ b/js/public/StructuredClone.h
+@@ -516,16 +516,17 @@ class JS_PUBLIC_API(JSAutoStructuredClon
+ #define JS_SCTAG_USER_MIN  ((uint32_t) 0xFFFF8000)
+ #define JS_SCTAG_USER_MAX  ((uint32_t) 0xFFFFFFFF)
+ 
+ #define JS_SCERR_RECURSION 0
+ #define JS_SCERR_TRANSFERABLE 1
+ #define JS_SCERR_DUP_TRANSFERABLE 2
+ #define JS_SCERR_UNSUPPORTED_TYPE 3
+ #define JS_SCERR_SHMEM_TRANSFERABLE 4
++#define JS_SCERR_TRANSFERABLE_TWICE 5
+ 
+ JS_PUBLIC_API(bool)
+ JS_ReadUint32Pair(JSStructuredCloneReader* r, uint32_t* p1, uint32_t* p2);
+ 
+ JS_PUBLIC_API(bool)
+ JS_ReadBytes(JSStructuredCloneReader* r, void* p, size_t len);
+ 
+ JS_PUBLIC_API(bool)
+diff --git a/js/src/jit-test/tests/structured-clone/transferable-cleanup.js.1912471.later b/js/src/jit-test/tests/structured-clone/transferable-cleanup.js.1912471.later
+new file mode 100644
+--- /dev/null
++++ b/js/src/jit-test/tests/structured-clone/transferable-cleanup.js.1912471.later
+@@ -0,0 +1,39 @@
++--- transferable-cleanup.js
+++++ transferable-cleanup.js
++@@ -155,26 +155,36 @@ function testMultiWithDeserializeReadTra
++     ], "serialize " + desc);
++     obj.log = null;
++ 
++     try {
++         let clone = deserialize(s);
++     } catch (e) {
++         assertEq(e.message.includes("invalid transferable"), true);
++     }
+++
+++    try {
+++        // This fails without logging anything, since the re-transfer will be caught
+++        // by looking at its header before calling any callbacks.
+++        let clone = deserialize(s);
+++    } catch (e) {
+++        assertEq(e.message.includes("cannot transfer twice"), true);
+++    }
+++
++     s = null;
++     gc();
++     printTrace(arguments.callee.name, g, BASE, obj.log, "deserialize");
++     assertEq("" + obj.log, "" + [
++         // readTransfer(obj) then readTransfer(obj3) which fails.
++         BASE + 1, "R", BASE + 3, "R",
++         // obj2 has not been read at all because we errored out during readTransferMap(),
++         // which comes before the main reading. obj transfer data is now owned by its
++         // clone. obj3 transfer data was not successfully handed over to a new object,
++         // so it is still owned by the clone buffer and must be discarded with freeTransfer.
+++        // 'F' means the data is freed.
++         BASE + 3, "F",
++     ], "deserialize " + desc);
++     obj.log = null;
++ }
++ 
++ function testMultiWithDeserializeReadTransferError() {
++     const desc = "write 3 objects, transfer obj1 and obj3 only, fail during readTransfer(obj3)";
++     testMultiWithDeserializeReadTransferErrorHelper(globalThis, 800, desc);
+diff --git a/js/src/js.msg b/js/src/js.msg
+--- a/js/src/js.msg
++++ b/js/src/js.msg
+@@ -435,16 +435,17 @@ MSG_DEF(JSMSG_PROXY_REVOKED,           0
+ MSG_DEF(JSMSG_PROXY_ARG_REVOKED,       1, JSEXN_TYPEERR, "argument {0} cannot be a revoked proxy")
+ MSG_DEF(JSMSG_BAD_TRAP,                1, JSEXN_TYPEERR, "proxy handler's {0} trap wasn't undefined, null, or callable")
+ 
+ // Structured cloning
+ MSG_DEF(JSMSG_SC_BAD_CLONE_VERSION,    0, JSEXN_ERR, "unsupported structured clone version")
+ MSG_DEF(JSMSG_SC_BAD_SERIALIZED_DATA,  1, JSEXN_INTERNALERR, "bad serialized structured data ({0})")
+ MSG_DEF(JSMSG_SC_DUP_TRANSFERABLE,     0, JSEXN_TYPEERR, "duplicate transferable for structured clone")
+ MSG_DEF(JSMSG_SC_NOT_TRANSFERABLE,     0, JSEXN_TYPEERR, "invalid transferable array for structured clone")
++MSG_DEF(JSMSG_SC_TRANSFERABLE_TWICE,   0, JSEXN_TYPEERR, "structured clone cannot transfer twice")
+ MSG_DEF(JSMSG_SC_UNSUPPORTED_TYPE,     0, JSEXN_TYPEERR, "unsupported type for structured data")
+ MSG_DEF(JSMSG_SC_NOT_CLONABLE,         1, JSEXN_TYPEERR, "{0} cannot be cloned in this context")
+ MSG_DEF(JSMSG_SC_SAB_DISABLED,         0, JSEXN_TYPEERR, "SharedArrayBuffer not cloned - shared memory disabled in receiver")
+ MSG_DEF(JSMSG_SC_SAB_REFCNT_OFLO,      0, JSEXN_TYPEERR, "SharedArrayBuffer has too many references")
+ MSG_DEF(JSMSG_SC_SHMEM_TRANSFERABLE,   0, JSEXN_TYPEERR, "Shared memory objects must not be in the transfer list")
+ MSG_DEF(JSMSG_SC_SHMEM_POLICY,         0, JSEXN_TYPEERR, "Policy object must forbid cloning shared memory objects cross-process")
+ 
+ // Debugger
+diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
+--- a/js/src/vm/StructuredClone.cpp
++++ b/js/src/vm/StructuredClone.cpp
+@@ -137,29 +137,33 @@ enum StructuredDataType : uint32_t {
+     SCTAG_TRANSFER_MAP_STORED_ARRAY_BUFFER,
+     SCTAG_TRANSFER_MAP_END_OF_BUILTIN_TYPES,
+ 
+     SCTAG_END_OF_BUILTIN_TYPES
+ };
+ 
+ /*
+  * Format of transfer map:
+- *   <SCTAG_TRANSFER_MAP_HEADER, TransferableMapHeader(UNREAD|TRANSFERRED)>
+- *   numTransferables (64 bits)
+- *   array of:
+- *     <SCTAG_TRANSFER_MAP_*, TransferableOwnership>
+- *     pointer (64 bits)
+- *     extraData (64 bits), eg byte length for ArrayBuffers
++ *   - <SCTAG_TRANSFER_MAP_HEADER, UNREAD|TRANSFERRING|TRANSFERRED>
++ *   - numTransferables (64 bits)
++ *   - array of:
++ *     - <SCTAG_TRANSFER_MAP_*, TransferableOwnership> pointer (64
++ *       bits)
++ *     - extraData (64 bits), eg byte length for ArrayBuffers
++ *     - any data written for custom transferables
+  */
+ 
+-// Data associated with an SCTAG_TRANSFER_MAP_HEADER that tells whether the
+-// contents have been read out yet or not.
++// contents have been read out yet or not. TRANSFERRING is for the case where we
++// have started but not completed reading, which due to errors could mean that
++// there are things still owned by the clone buffer that need to be released, so
++// discarding should not just be skipped.
+ enum TransferableMapHeader {
+-    SCTAG_TM_UNREAD = 0,
+-    SCTAG_TM_TRANSFERRED
++  SCTAG_TM_UNREAD = 0,
++  SCTAG_TM_TRANSFERRING,
++  SCTAG_TM_TRANSFERRED
+ };
+ 
+ static inline uint64_t
+ PairToUInt64(uint32_t tag, uint32_t data)
+ {
+     return uint64_t(data) | (uint64_t(tag) << 32);
+ }
+ 
+@@ -592,16 +596,20 @@ ReportDataCloneError(JSContext* cx,
+       case JS_SCERR_UNSUPPORTED_TYPE:
+         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_SC_UNSUPPORTED_TYPE);
+         break;
+ 
+       case JS_SCERR_SHMEM_TRANSFERABLE:
+         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_SC_SHMEM_TRANSFERABLE);
+         break;
+ 
++      case JS_SCERR_TRANSFERABLE_TWICE:
++        JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JS_SCERR_TRANSFERABLE_TWICE);
++        break;
++
+       default:
+         MOZ_CRASH("Unkown errorId");
+         break;
+     }
+ }
+ 
+ bool
+ WriteStructuredClone(JSContext* cx, HandleValue v, JSStructuredCloneData* bufp,
+@@ -2413,18 +2421,30 @@ JSStructuredCloneReader::readTransferMap
+ {
+     JSContext* cx = context();
+     auto headerPos = in.tell();
+ 
+     uint32_t tag, data;
+     if (!in.getPair(&tag, &data))
+         return in.reportTruncated();
+ 
+-    if (tag != SCTAG_TRANSFER_MAP_HEADER || TransferableMapHeader(data) == SCTAG_TM_TRANSFERRED)
++    auto transferState = static_cast<TransferableMapHeader>(data);
++
++    if (tag != SCTAG_TRANSFER_MAP_HEADER ||
++        transferState == SCTAG_TM_TRANSFERRED) {
+         return true;
++    }
++
++    if (transferState == SCTAG_TM_TRANSFERRING) {
++      ReportDataCloneError(cx, callbacks, JS_SCERR_TRANSFERABLE_TWICE); // ,closure);
++      return false;
++    }
++
++    headerPos.write(
++        PairToUInt64(SCTAG_TRANSFER_MAP_HEADER, SCTAG_TM_TRANSFERRING));
+ 
+     uint64_t numTransferables;
+     MOZ_ALWAYS_TRUE(in.readPair(&tag, &data));
+     if (!in.read(&numTransferables))
+         return false;
+ 
+     for (uint64_t i = 0; i < numTransferables; i++) {
+         auto pos = in.tell();
+@@ -2502,17 +2522,17 @@ JSStructuredCloneReader::readTransferMap
+         if (!allObjs.append(ObjectValue(*obj)))
+             return false;
+     }
+ 
+     // Mark the whole transfer map as consumed.
+ #ifdef DEBUG
+     SCInput::getPair(headerPos.peek(), &tag, &data);
+     MOZ_ASSERT(tag == SCTAG_TRANSFER_MAP_HEADER);
+-    MOZ_ASSERT(TransferableMapHeader(data) != SCTAG_TM_TRANSFERRED);
++    MOZ_ASSERT(TransferableMapHeader(data) == SCTAG_TM_TRANSFERRING);
+ #endif
+     headerPos.write(PairToUInt64(SCTAG_TRANSFER_MAP_HEADER, SCTAG_TM_TRANSFERRED));
+ 
+     return true;
+ }
+ 
+ JSObject*
+ JSStructuredCloneReader::readSavedFrame(uint32_t principalsTag)

+ 51 - 0
mozilla-release/patches/1912715-131a1.patch

@@ -0,0 +1,51 @@
+# HG changeset patch
+# User Iain Ireland <iireland@mozilla.com>
+# Date 1724176537 0
+# Node ID 4f1411f1beb61bdc40b858a03cfe82c2ea56288f
+# Parent  97e2c1875832171f3a2f954873121184575186dc
+Bug 1912715: Simplify with-env handling in FetchName r=jandem
+
+Differential Revision: https://phabricator.services.mozilla.com/D219198
+
+diff --git a/js/src/vm/Interpreter-inl.h b/js/src/vm/Interpreter-inl.h
+--- a/js/src/vm/Interpreter-inl.h
++++ b/js/src/vm/Interpreter-inl.h
+@@ -183,32 +183,32 @@ FetchName(JSContext* cx, HandleObject re
+             return ReportIsNotDefined(cx, name);
+           case GetNameMode::TypeOf:
+             vp.setUndefined();
+             return true;
+         }
+     }
+ 
+     /* Take the slow path if shape was not found in a native object. */
+-    if (!receiver->isNative() || !holder->isNative()) {
++    if (!receiver->isNative() || !holder->isNative() ||
++        receiver->is<WithEnvironmentObject>()) {
+         Rooted<jsid> id(cx, NameToId(name));
+         if (!GetProperty(cx, receiver, receiver, id, vp))
+             return false;
+     } else {
+         RootedShape shape(cx, prop.shape());
+         if (shape->isDataDescriptor() && shape->hasDefaultGetter()) {
+             /* Fast path for Object instance properties. */
+             MOZ_ASSERT(shape->isDataProperty());
+             vp.set(holder->as<NativeObject>().getSlot(shape->slot()));
+         } else {
+-            // Unwrap 'with' environments for reasons given in
+-            // GetNameBoundInEnvironment.
+-            RootedObject normalized(cx, MaybeUnwrapWithEnvironment(receiver));
+-            if (!NativeGetExistingProperty(cx, normalized, holder.as<NativeObject>(), shape, vp))
+-                return false;
++            if (!NativeGetExistingProperty(cx, receiver, holder.as<NativeObject>(),
++                                           shape, vp)) {
++                 return false;
++            }
+         }
+     }
+ 
+     // We do our own explicit checking for |this|
+     if (name == cx->names().dotThis)
+         return true;
+ 
+     // NAME operations are the slow paths already, so unconditionally check

+ 115 - 0
mozilla-release/patches/1916476-132a1.patch

@@ -0,0 +1,115 @@
+# HG changeset patch
+# User Andrew Osmond <aosmond@mozilla.com>
+# Date 1725388482 0
+# Node ID b6d1d0decfa60a7351e3341eca53f3d8f8af3ab4
+# Parent  ca48ff6b393e461d6229de516143e05feea11261
+Bug 1916476. r=media-playback-reviewers,padenot
+
+Differential Revision: https://phabricator.services.mozilla.com/D220912
+
+diff --git a/dom/media/gmp/GMPVideoi420FrameImpl.cpp b/dom/media/gmp/GMPVideoi420FrameImpl.cpp
+--- a/dom/media/gmp/GMPVideoi420FrameImpl.cpp
++++ b/dom/media/gmp/GMPVideoi420FrameImpl.cpp
+@@ -84,20 +84,47 @@ GMPVideoi420FrameImpl::CheckFrameData(co
+       (aFrameData.mUPlane().mSize() < aFrameData.mUPlane().mStride() * ((aFrameData.mHeight()+1)/2)) ||
+       (aFrameData.mVPlane().mSize() < aFrameData.mVPlane().mStride() * ((aFrameData.mHeight()+1)/2)))
+   {
+     return false;
+   }
+   return true;
+ }
+ 
+-bool
+-GMPVideoi420FrameImpl::CheckDimensions(int32_t aWidth, int32_t aHeight,
+-                                       int32_t aStride_y, int32_t aStride_u, int32_t aStride_v)
+-{
++bool GMPVideoi420FrameImpl::CheckDimensions(int32_t aWidth, int32_t aHeight,
++                                            int32_t aStride_y,
++                                            int32_t aStride_u,
++                                            int32_t aStride_v, int32_t aSize_y,
++                                            int32_t aSize_u, int32_t aSize_v) {
++  if (aWidth < 1 || aHeight < 1 || aStride_y < aWidth || aSize_y < 1 ||
++      aSize_u < 1 || aSize_v < 1) {
++    return false;
++  }
++  auto halfWidth = (CheckedInt<int32_t>(aWidth) + 1) / 2;
++  if (!halfWidth.isValid() || aStride_u < halfWidth.value() ||
++      aStride_v < halfWidth.value()) {
++    return false;
++  }
++  auto height = CheckedInt<int32_t>(aHeight);
++  auto halfHeight = (height + 1) / 2;
++  auto minSizeY = height * aStride_y;
++  auto minSizeU = halfHeight * aStride_u;
++  auto minSizeV = halfHeight * aStride_v;
++  if (!minSizeY.isValid() || !minSizeU.isValid() || !minSizeV.isValid() ||
++      minSizeY.value() > aSize_y || minSizeU.value() > aSize_u ||
++      minSizeV.value() > aSize_v) {
++    return false;
++  }
++  return true;
++}
++
++bool GMPVideoi420FrameImpl::CheckDimensions(int32_t aWidth, int32_t aHeight,
++                                            int32_t aStride_y,
++                                            int32_t aStride_u,
++                                            int32_t aStride_v) {
+   int32_t half_width = (aWidth + 1) / 2;
+   if (aWidth < 1 || aHeight < 1 ||
+       aStride_y < aWidth || aStride_u < half_width || aStride_v < half_width ||
+       !(CheckedInt<int32_t>(aHeight) * aStride_y
+         + ((CheckedInt<int32_t>(aHeight) + 1) / 2)
+           * (CheckedInt<int32_t>(aStride_u) + aStride_v)).isValid()) {
+     return false;
+   }
+@@ -174,21 +201,18 @@ GMPVideoi420FrameImpl::CreateFrame(int32
+                                    int32_t aSize_v, const uint8_t* aBuffer_v,
+                                    int32_t aWidth, int32_t aHeight,
+                                    int32_t aStride_y, int32_t aStride_u, int32_t aStride_v)
+ {
+   MOZ_ASSERT(aBuffer_y);
+   MOZ_ASSERT(aBuffer_u);
+   MOZ_ASSERT(aBuffer_v);
+ 
+-  if (aSize_y < 1 || aSize_u < 1 || aSize_v < 1) {
+-    return GMPGenericErr;
+-  }
+-
+-  if (!CheckDimensions(aWidth, aHeight, aStride_y, aStride_u, aStride_v)) {
++  if (!CheckDimensions(aWidth, aHeight, aStride_y, aStride_u, aStride_v,
++                       aSize_y, aSize_u, aSize_v)) {
+     return GMPGenericErr;
+   }
+ 
+   GMPErr err = mYPlane.Copy(aSize_y, aStride_y, aBuffer_y);
+   if (err != GMPNoErr) {
+     return err;
+   }
+   err = mUPlane.Copy(aSize_u, aStride_u, aBuffer_u);
+diff --git a/dom/media/gmp/GMPVideoi420FrameImpl.h b/dom/media/gmp/GMPVideoi420FrameImpl.h
+--- a/dom/media/gmp/GMPVideoi420FrameImpl.h
++++ b/dom/media/gmp/GMPVideoi420FrameImpl.h
+@@ -60,18 +60,21 @@ public:
+   void SetTimestamp(uint64_t aTimestamp) override;
+   uint64_t Timestamp() const override;
+   void SetDuration(uint64_t aDuration) override;
+   uint64_t Duration() const override;
+   bool IsZeroSize() const override;
+   void ResetSize() override;
+ 
+ private:
+-  bool CheckDimensions(int32_t aWidth, int32_t aHeight,
+-                       int32_t aStride_y, int32_t aStride_u, int32_t aStride_v);
++  bool CheckDimensions(int32_t aWidth, int32_t aHeight, int32_t aStride_y,
++                       int32_t aStride_u, int32_t aStride_v, int32_t aSize_y,
++                       int32_t aSize_u, int32_t aSize_v);
++  bool CheckDimensions(int32_t aWidth, int32_t aHeight, int32_t aStride_y,
++                       int32_t aStride_u, int32_t aStride_v);
+ 
+   GMPPlaneImpl mYPlane;
+   GMPPlaneImpl mUPlane;
+   GMPPlaneImpl mVPlane;
+   int32_t mWidth;
+   int32_t mHeight;
+   uint64_t mTimestamp;
+   uint64_t mDuration;

+ 46 - 0
mozilla-release/patches/977538-61a1.patch

@@ -0,0 +1,46 @@
+# HG changeset patch
+# User Ryan VanderMeulen <ryanvm@gmail.com>
+# Date 1521077765 14400
+# Node ID 2edc56eddf55d0fd07b24f234961f5f4ac026856
+# Parent  7701560f1b143a75a4fcda5111cf398319380012
+Bug 977538 - Land the attached testcase as a crashtest. r=me
+
+diff --git a/js/xpconnect/crashtests/977538.html b/js/xpconnect/crashtests/977538.html
+new file mode 100644
+--- /dev/null
++++ b/js/xpconnect/crashtests/977538.html
+@@ -0,0 +1,20 @@
++<script>
++function f() {
++  var buffer = new Uint8Array(8);
++  
++  for (var i=0; i<100; i++) {}
++
++  buffer[0] = 0xff;
++  buffer[1] = 0xff;
++  buffer[2] = 0xff;
++  buffer[3] = 0xff;
++  buffer[4] = 0xff;
++  buffer[5] = 0xff;
++  buffer[6] = 0x0f;
++  buffer[7] = 0x00;
++
++  var view = new DataView(buffer.buffer);
++  view.getFloat64(0);
++}
++f();
++</script>
+diff --git a/js/xpconnect/crashtests/crashtests.list b/js/xpconnect/crashtests/crashtests.list
+--- a/js/xpconnect/crashtests/crashtests.list
++++ b/js/xpconnect/crashtests/crashtests.list
+@@ -50,8 +50,9 @@ asserts(0-1) load 786142.html # We may h
+ load 797583.html
+ load 806751.html
+ load 833856.html
+ load 851418.html
+ load 854139.html
+ load 854604.html
+ pref(dom.use_xbl_scopes_for_remote_xul,true) load 898939.html
+ pref(security.fileuri.strict_origin_policy,false) load 938297.html
++load 977538.html
+

+ 6 - 0
mozilla-release/patches/series

@@ -7638,8 +7638,10 @@ TOP-NOBUG-nsstyle-prefers-reduced-motion.patch
 TOP-1909714-NSS3904-11514.patch
 TOP-NOBUG-blockquad0-25319.patch
 TOP-NOBUG-fixnasmcheck-25320.patch
+977538-61a1.patch
 1479945-1no2-63a1.patch
 1479945-3no4-63a1.patch
+1493449-64a1.patch
 1564097-72a1.patch
 1563403-2-73a1.patch
 1601872-73a1.patch
@@ -7654,7 +7656,11 @@ TOP-NOBUG-fixnasmcheck-25320.patch
 1728988-2-VS2022-gyp-25320.patch
 1857492-120a1.patch
 1900355-129a1.patch
+1907230-130a1.patch
 1907053-131a1.patch
+1912715-131a1.patch
+1916476-132a1.patch
+1912471-132a1.patch
 1902935-seamonkey-credits-25320.patch
 1862395-incorrect-version-resistfingerprinting-v2-25320.patch
 1737436-use-mozilla-compat-version-define-25320.patch