From patchwork Fri Mar 7 18:39:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 39787 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7A61427BBE9; Fri, 7 Mar 2025 18:42:31 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2DDA427BBE2 for ; Fri, 7 Mar 2025 18:42:30 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqceB-0002RZ-1v; Fri, 07 Mar 2025 13:42:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tqcdR-0001KS-O5 for guix-patches@gnu.org; Fri, 07 Mar 2025 13:41:28 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqcdQ-0003H5-Qm for guix-patches@gnu.org; Fri, 07 Mar 2025 13:41:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=UPx9uy2ptUQQ9G2VkiorAkpz6KFAONeGc/Gm/R/4meE=; b=Km9FT8A6BzOZGJhptU7yPaEcgHfJBJkG/odhpboBIymS1CJt46ujgkjegPNYXYyQtpW5EWXI6qX6q3xFPfEXrrdT05imVAo8Z5pQ0GyV42I2xnDumatIHn1rpF3jusue5MHN1LGUwncAoJjd7KxpPRsXVhBpAy4JVExm/AjYx2uLjah6mOW44e/v+Hz7vR6LuEuH14qs/o4YzOhe2WCJ79c4WQKQ2/+SCUei45mk7/qrz6jFm/+jkPnFTI4QC94qC6duWLUNFXlveXMPO9Wo2g2KcnNkMW686vBQzG7wRinFGiyUZqX3/mtQLx6Is5BZO19yiLFdC8MrMD8WFqsAQw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tqcdQ-0006qU-M4 for guix-patches@gnu.org; Fri, 07 Mar 2025 13:41:24 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76819] [PATCH v7 35/35] gnu: yajl: Patch CVE-2023-33460. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Mar 2025 18:41:24 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76819 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76819@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 76819-submit@debbugs.gnu.org id=B76819.174137287926226 (code B ref 76819); Fri, 07 Mar 2025 18:41:24 +0000 Received: (at 76819) by debbugs.gnu.org; 7 Mar 2025 18:41:19 +0000 Received: from localhost ([127.0.0.1]:50288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tqcdK-0006oj-Jd for submit@debbugs.gnu.org; Fri, 07 Mar 2025 13:41:19 -0500 Received: from 2.mo575.mail-out.ovh.net ([46.105.52.162]:54865) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tqccN-0006ej-LU for 76819@debbugs.gnu.org; Fri, 07 Mar 2025 13:40:20 -0500 Received: from director9.ghost.mail-out.ovh.net (unknown [10.109.176.32]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4Z8Zpp4LBmz1n35 for <76819@debbugs.gnu.org>; Fri, 7 Mar 2025 18:40:18 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-9vblb (unknown [10.110.168.179]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 660E21FE50; Fri, 7 Mar 2025 18:40:18 +0000 (UTC) Received: from ngraves.fr ([37.59.142.105]) by ghost-submission-5b5ff79f4f-9vblb with ESMTPSA id kFzREZI9y2e/rxYAkrx+OQ (envelope-from ); Fri, 07 Mar 2025 18:40:18 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-105G006e724747a-a6dd-4f4a-a9de-9a521024af97, 93CD87FFD4632086FD827B47E208BFE70AFEC0F0) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Fri, 7 Mar 2025 19:39:04 +0100 Message-ID: <20250307183914.8825-35-ngraves@ngraves.fr> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250307183914.8825-1-ngraves@ngraves.fr> References: <20250307183914.8825-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 4436608583203676898 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduuddugedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepudelffejveduhedtjeethfeuveehudevleehgfdtvdeuffdvieehteefieeukeelnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpuggvsghirghnrdhorhhgnecukfhppeduvdejrddtrddtrddupdeltddrledvrdduudejrddugeegpdefjedrheelrddugedvrddutdehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejieekudelseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehjeehmgdpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=UPx9uy2ptUQQ9G2VkiorAkpz6KFAONeGc/Gm/R/4meE=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1741372818; v=1; b=NApIUfVN2tyFn5W6g93oBOjDotUSZntMRBj9ZfIXZrdQ2mUGE1cqdM5oUR7JcTMcg0oH4Ynk iZCdSkLzDd+neBQqru3DxlwlCMtz7gjDnWIE22RmyPdL5b0e2vzbdeNe4iAaV6ow7P6KlYSSS80 xGOr2OTTqffxeXm5d5MfpDzk+bjXM2CO5ByQ5+8JR1bxLAJZgk3eWnDYMMnh0VZ4htS5ZDzdQfx EmV/7ZmQmA1SApacTvgnfLAWPn1Z4tqCjJ/Hg3fbWSOZZrysXEu2GrGj0hh7m92LXVpWQ2Qgfkg X7aWLjOwj95+vn4ZtoKXF27b/FEgF8V6eugaqqA4Rag2A== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/yajl-CVE-2023-33460.patch: Add file. * gnu/local.mk: Record patch. * gnu/packages/web.scm (yajl)[source]: Record patch. --- gnu/local.mk | 1 + .../patches/yajl-CVE-2023-33460.patch | 38 +++++++++++++++++++ gnu/packages/web.scm | 4 +- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/yajl-CVE-2023-33460.patch diff --git a/gnu/local.mk b/gnu/local.mk index dc7836d9a5..c00cee8b15 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2439,6 +2439,7 @@ dist_patch_DATA = \ %D%/packages/patches/xterm-370-explicit-xcursor.patch \ %D%/packages/patches/xygrib-fix-finding-data.patch \ %D%/packages/patches/xygrib-newer-proj.patch \ + %D%/packages/patches/yajl-CVE-2023-33460.patch \ %D%/packages/patches/yggdrasil-extra-config.patch \ %D%/packages/patches/zig-0.9-build-respect-PKG_CONFIG-env-var.patch \ %D%/packages/patches/zig-0.9-fix-runpath.patch \ diff --git a/gnu/packages/patches/yajl-CVE-2023-33460.patch b/gnu/packages/patches/yajl-CVE-2023-33460.patch new file mode 100644 index 0000000000..9ba6e72774 --- /dev/null +++ b/gnu/packages/patches/yajl-CVE-2023-33460.patch @@ -0,0 +1,38 @@ +Memory leak in yajl 2.1.0 with use of yajl_tree_parse function +See https://github.com/lloyd/yajl/issues/250#issuecomment-1628695214 + +Origin: https://github.com/openEuler-BaseService/yajl/commit/23a122eddaa28165a6c219000adcc31ff9a8a698 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1039984 +Bug: https://github.com/lloyd/yajl/issues/250 +--- + src/yajl_tree.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/yajl_tree.c b/src/yajl_tree.c +index 3d357a32..56c7012f 100644 +--- a/src/yajl_tree.c ++++ b/src/yajl_tree.c +@@ -143,7 +143,7 @@ static yajl_val context_pop(context_t *ctx) + ctx->stack = stack->next; + + v = stack->value; +- ++ free (stack->key); + free (stack); + + return (v); +@@ -444,7 +444,14 @@ yajl_val yajl_tree_parse (const char *input, + snprintf(error_buffer, error_buffer_size, "%s", internal_err_str); + YA_FREE(&(handle->alloc), internal_err_str); + } ++ while(ctx.stack != NULL) { ++ yajl_val v = context_pop(&ctx); ++ yajl_tree_free(v); ++ } + yajl_free (handle); ++ //If the requested memory is not released in time, it will cause memory leakage ++ if(ctx.root) ++ yajl_tree_free(ctx.root); + return NULL; + } + diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 25436c32ab..26bc3b2939 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -1746,7 +1746,9 @@ (define-public yajl (file-name (git-file-name name version)) (sha256 (base32 - "00yj06drb6izcxfxfqlhimlrb089kka0w0x8k27pyzyiq7qzcvml")))) + "00yj06drb6izcxfxfqlhimlrb089kka0w0x8k27pyzyiq7qzcvml")) + (patches + (search-patches "yajl-CVE-2023-33460.patch")))) (build-system cmake-build-system) (arguments '(#:phases