new file mode 100644
@@ -0,0 +1,69 @@
+From e9e4ca24ff6f8b118853db8fc1f9dd4d7653e229 Mon Sep 17 00:00:00 2001
+From: Anna Weine <anna.weine@mozilla.com>
+Date: Wed, 17 Jul 2024 16:16:57 +0000
+Subject: [PATCH] Bug 1905691 - ChaChaXor to return after the function
+ r=nss-reviewers,jschanck
+
+Differential Revision: https://phabricator.services.mozilla.com/D215892
+
+--HG--
+extra : moz-landing-system : lando
+
+CVE: CVE-2024-7531
+Upstream-Status: Backport [https://github.com/mozilla/nss/commit/e9e4ca24ff6f8b118853db8fc1f9dd4d7653e229]
+Signed-off-by: Peter Marko <peter.marko@siemens.com>
+---
+ nss/lib/freebl/chacha20poly1305.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/nss/lib/freebl/chacha20poly1305.c b/nss/lib/freebl/chacha20poly1305.c
+index a83f76df0..47aa18ba8 100644
+--- a/nss/lib/freebl/chacha20poly1305.c
++++ b/nss/lib/freebl/chacha20poly1305.c
+@@ -210,12 +210,14 @@ ChaCha20Xor(uint8_t *output, uint8_t *block, uint32_t len, uint8_t *k,
+ #ifndef NSS_DISABLE_AVX2
+ if (avx2_support()) {
+ Hacl_Chacha20_Vec256_chacha20_encrypt_256(len, output, block, k, nonce, ctr);
++ return;
+ }
+ #endif
+
+ #ifndef NSS_DISABLE_SSE3
+ if (ssse3_support() && sse4_1_support() && avx_support()) {
+ Hacl_Chacha20_Vec128_chacha20_encrypt_128(len, output, block, k, nonce, ctr);
++ return;
+ }
+ #endif
+
+@@ -223,10 +225,12 @@ ChaCha20Xor(uint8_t *output, uint8_t *block, uint32_t len, uint8_t *k,
+ !defined(NSS_DISABLE_ALTIVEC) && !defined(NSS_DISABLE_CRYPTO_VSX)
+ if (ppc_crypto_support()) {
+ chacha20vsx(len, output, block, k, nonce, ctr);
+- } else
++ return;
++ }
+ #endif
+ {
+ Hacl_Chacha20_chacha20_encrypt(len, output, block, k, nonce, ctr);
++ return;
+ }
+ }
+ #endif /* NSS_DISABLE_CHACHAPOLY */
+@@ -446,8 +450,6 @@ ChaCha20Poly1305_Encrypt(const ChaCha20Poly1305Context *ctx,
+ goto finish;
+ }
+ #endif
+-
+- else
+ #elif defined(__powerpc64__) && defined(__LITTLE_ENDIAN__) && \
+ !defined(NSS_DISABLE_ALTIVEC) && !defined(NSS_DISABLE_CRYPTO_VSX)
+ if (ppc_crypto_support()) {
+@@ -455,7 +457,7 @@ ChaCha20Poly1305_Encrypt(const ChaCha20Poly1305Context *ctx,
+ (uint8_t *)ctx->key, (uint8_t *)nonce, adLen, (uint8_t *)ad, inputLen,
+ (uint8_t *)input, output, outTag);
+ goto finish;
+- } else
++ }
+ #endif
+ {
+ Hacl_Chacha20Poly1305_32_aead_encrypt(
@@ -40,6 +40,7 @@ SRC_URI = "http://ftp.mozilla.org/pub/security/nss/releases/${VERSION_DIR}/src/$
file://CVE-2024-11704.patch \
file://CVE-2024-11705.patch \
file://CVE-2024-11706.patch \
+ file://CVE-2024-7531.patch \
"
SRC_URI[sha256sum] = "f549cc33d35c0601674bfacf7c6ad683c187595eb4125b423238d3e9aa4209ce"