nss: patch CVE-2024-6602

Pick the same patch as Debian took for bullseye.

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
Peter Marko
2024-10-29 23:12:38 +01:00
committed by Armin Kuster
parent 1d2878df6c
commit 8ad3c43248
2 changed files with 66 additions and 0 deletions
@@ -0,0 +1,65 @@
From 7804e99346339bb31f801a2fcba63b6fbd8bca4a Mon Sep 17 00:00:00 2001
From: John Schanck <jschanck@mozilla.com>
Date: Mon, 20 May 2024 18:46:14 +0000
Subject: [PATCH] Bug 1895032 - remove redundant AllocItem implementation.
r=nss-reviewers,rrelyea
Differential Revision: https://phabricator.services.mozilla.com/D209476
--HG--
extra : moz-landing-system : lando
CVE: CVE-2024-6602
Upstream-Status: Backport [https://hg.mozilla.org/projects/nss/rev/f9b22115dc97be76e388dc9d0dca946dde955e64]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
nss/lib/util/secitem.c | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/nss/lib/util/secitem.c b/nss/lib/util/secitem.c
index cd6996178..6ba11a551 100644
--- a/nss/lib/util/secitem.c
+++ b/nss/lib/util/secitem.c
@@ -238,35 +238,20 @@ SECITEM_ArenaDupItem(PLArenaPool *arena, const SECItem *from)
SECItem *to;
if (from == NULL) {
- return (NULL);
+ return NULL;
}
- if (arena != NULL) {
- to = (SECItem *)PORT_ArenaAlloc(arena, sizeof(SECItem));
- } else {
- to = (SECItem *)PORT_Alloc(sizeof(SECItem));
- }
+ to = SECITEM_AllocItem(arena, NULL, from->len);
if (to == NULL) {
- return (NULL);
+ return NULL;
}
- if (arena != NULL) {
- to->data = (unsigned char *)PORT_ArenaAlloc(arena, from->len);
- } else {
- to->data = (unsigned char *)PORT_Alloc(from->len);
- }
- if (to->data == NULL) {
- PORT_Free(to);
- return (NULL);
- }
-
- to->len = from->len;
to->type = from->type;
if (to->len) {
PORT_Memcpy(to->data, from->data, to->len);
}
- return (to);
+ return to;
}
SECStatus
--
2.30.2
+1
View File
@@ -32,6 +32,7 @@ SRC_URI = "http://ftp.mozilla.org/pub/security/nss/releases/${VERSION_DIR}/src/$
file://system-pkcs11.txt \
file://nss-fix-nsinstall-build.patch \
file://0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch \
file://CVE-2024-6602.patch \
"
SRC_URI[sha256sum] = "f549cc33d35c0601674bfacf7c6ad683c187595eb4125b423238d3e9aa4209ce"