From patchwork Wed Nov 25 05:12:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ashishkumar Parmar X (asparmar - E INFOCHIPS PRIVATE LIMITED at Cisco)" X-Patchwork-Id: 105510 Received: from aer-iport-5.cisco.com (aer-iport-5.cisco.com [173.38.203.67]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.36112.1795583576147279887 for ; Tue, 24 Nov 2026 21:12:57 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: message contains an insecure body length tag" header.i=@cisco.com header.s=iport01 header.b=Ja4qTPWF; spf=pass (domain: cisco.com, ip: 173.38.203.67, mailfrom: asparmar@cisco.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.com; i=@cisco.com; l=19803; q=dns/txt; s=iport01; t=1795583577; x=1796793177; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=4ovlC5yRBzS4jRIZaePVaJ4GNnh7SpULvNhhAS2/7UA=; b=Ja4qTPWFf6SJFRuFmB8xkqrThyvySDxo0oLZlg52TN3iya5oI/gwfOz6 AijhoTE8Z/GDyMXLYVVzI4XGwOluZL5YHu5imdInUzq6W39DkEbCCJLSf lp80uf4SyPD8+RoGQJOKDSAkPMYk6RbzYcdTZpyb/Ccf9Kivbnu/RRTru Btp+Q67+FOb60z7FEcK8zf3RGXkDoJgpMsIwtL/9rdw3l08NRFvw4ZGfp cAK945XtGYKGbxZkP5wKeJjodBw1qXG6DPQ4p4lGD8MPKx2LGrkm2KB8N tbZ9Fs327C9hZkGBqduArOYWd/pLgN4R3Yfup3S4PuGncBnnW+05S/cDf Q==; X-CSE-ConnectionGUID: 5rdqmjGrRn6k+V5kNnFvZg== X-CSE-MsgGUID: V8tIHj2BTTqed3iUTS+6Ww== X-IPAS-Result: A0BJAgAhbQZr/8xK/pBQCh4BPAwCC4Flghg/dWFCSZQqgiGBFopTkkOBfg8BAQEPRA0EAQGCEpEXA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TqUmeouw85G27IAlZjuC2a4SLJ4PiqcN9oBaEh 0LEpU7FPggXOIee9Aa+sSyTmbqa9c/8cMdIfFGizdZtmFCVy2kZBREaWFf+qv6jh2a6WslDM AoT4icooK04+UCnQ9W7WAe3yENopTYVVsAVF6gx7xuAj/KPpQ2YHWMDCDVGbbTKqfMLeNDj7 XfR9/uBONClmOf9pa61nltMkQ6PBA== IronPort-HdrOrdr: A9a23:RklC/K+R6zU/YjDdfTNuk+DoI+orL9Y04lQ7vn2ZLiYlEPBw+P rBoB1273LJYVUqKRIdcK67WZVoKEm0nfUe3WB7B9iftWfd1FdAVLsD0aLShxv9Bib56ulRkY 1kc6R4FZnMKGISt7ee3OF9eOxQp+VuN8uT9IPj80s= X-Talos-CUID: 9a23:/8Nlo2xSkIA7NZDQnVZ3BgVJAMw8d3/y1k3WfUz7Nztqbru7V22frfY= X-Talos-MUID: 9a23:gdMmYQSIMmXQVuW4RXTS1C1DFMUyyZiSEU0BypQ7h/LHaxNvbmI= X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="6.27,232,1787011200"; d="scan'208";a="60336657" Received: from aer-l-core-03.cisco.com ([144.254.74.204]) by aer-iport-5.cisco.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 25 Nov 2026 05:12:54 +0000 Received: from sjc-ads-20495.cisco.com (sjc-ads-20495.cisco.com [171.70.188.248]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "ciscoit-managed-infra-smtp-auth.cisco.com", Issuer "Internal Private TLS SubCA" (verified OK)) by aer-l-core-03.cisco.com (Postfix) with ESMTPS id B94D1180006E3 for ; Wed, 25 Nov 2026 05:12:53 +0000 (GMT) Received: by sjc-ads-20495.cisco.com (Postfix, from userid 1877012) id 6D800CC1634; Tue, 24 Nov 2026 21:12:52 -0800 (PST) From: "Ashishkumar Parmar X (asparmar - E INFOCHIPS PRIVATE LIMITED at Cisco)" To: openembedded-core@lists.openembedded.org Subject: [OE-core][wrynose][PATCH 1/6] git: fix CVE-2026-105437 Date: Tue, 24 Nov 2026 21:12:41 -0800 Message-Id: <20261125051246.3108822-1-asparmar@cisco.com> X-Mailer: git-send-email 2.35.6 MIME-Version: 1.0 X-Outbound-Client-TLS: VERIFIED;sjc-ads-20495.cisco.com [171.70.188.248];TLSv1.3;TLS_AES_256_GCM_SHA384;256;ciscoit-managed-infra-smtp-auth.cisco.com X-Outbound-SMTP-Client: 171.70.188.248, sjc-ads-20495.cisco.com X-Outbound-Node: aer-l-core-03.cisco.com List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Wed, 25 Nov 2026 05:12:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251135 From: Ashishkumar Parmar This patch applies the upstream Git 2.53.1 backport for CVE-2026-105437. Use size_t for merge-output sizes and checked addition before allocating the merge buffer. The upstream fix series is referenced in [1] and the CVE advisory in [2]. The Git 2.53.1 release notes are referenced in [3]. Preserve Git 2.53.0 and retain the upstream regression tests. The required st_add5() helper is included with the overflow fix. [1] https://github.com/git/git/commit/1c93cc03eaed7d3e830864c502aae49551421fd2 [2] https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/105xxx/CVE-2026-105437.json [3] https://github.com/git/git/blob/v2.53.1/Documentation/RelNotes/2.53.1.adoc Signed-off-by: Ashishkumar Parmar --- .../git/git/CVE-2026-105437_p1.patch | 235 ++++++++++++++++++ .../git/git/CVE-2026-105437_p2.patch | 211 ++++++++++++++++ meta/recipes-devtools/git/git_2.53.0.bb | 2 + 3 files changed, 448 insertions(+) create mode 100644 meta/recipes-devtools/git/git/CVE-2026-105437_p1.patch create mode 100644 meta/recipes-devtools/git/git/CVE-2026-105437_p2.patch diff --git a/meta/recipes-devtools/git/git/CVE-2026-105437_p1.patch b/meta/recipes-devtools/git/git/CVE-2026-105437_p1.patch new file mode 100644 index 0000000000..f2e60f5a4a --- /dev/null +++ b/meta/recipes-devtools/git/git/CVE-2026-105437_p1.patch @@ -0,0 +1,235 @@ +From 5a0e9915092ece3be3f7c06b409504c066950585 Mon Sep 17 00:00:00 2001 +From: Kaartic Sivaraam +Date: Fri, 16 Oct 2026 15:30:01 +0530 +Subject: [PATCH] xdiff: use size_t for merge buffer size computations + +libxdiff keeps some intermediate size computations in "long" and "int" +variables and then feeds the result to malloc(). These can overflow, +especially "int", which is 32 bits even on 64-bit platforms ("long" is +too, on Windows). Often this is harmless apart from a wrong answer: +when the same truncated value is passed both to malloc() and to the +memcpy() that fills the buffer, the copy stays inside the allocation +and the result is merely truncated. + +xdl_fill_merge_buffer() is different. It adds up the output size in an +int, allocates that much, then writes each piece at "dest + size". The +sum can overflow because a conflict-marker-size from .gitattributes +accepts any positive int and is added several times per conflict, and +because diff3 output of large inputs can exceed INT_MAX. + +We considered both ways the sum can wrap: + + 1. It ends up negative. malloc() sees a huge size_t and fails, which + is a spurious error but not exploitable. + + 2. It wraps back to a small positive value. malloc() succeeds with a + buffer that is too small. Each addend is below 2^31, so the + running offset passes through negative values on the way. Writes + therefore first run past the end of the buffer and then land + before its start. + +Convert these variables to size_t. The running sum can then no longer +go negative, and on 64-bit platforms it can no longer realistically +wrap either. Two holes remain, which the next commit closes by using +st_add*(): the marker addends (e.g. "marker_size + 1 + needs_cr + +marker1_size") are still computed as int and can overflow when +conflict-marker-size is close to INT_MAX, and on 32-bit platforms +size_t itself can still wrap. + +Note that in xdl_do_merge(), the value returned by xdl_fill_merge_buffer() +is assigned to mmbuffer_t's size which is a long. This may result in +silent truncation on LLP64 platforms like Windows, where long is 32 bits. +Fixing this properly means converting the users of mmbuffer_t, which +pass its size on to functions taking an unsigned long, and the code +they call, to size_t. That is a larger effort for a separate series. +Until then, fail the merge when the result does not fit in a long. +This turns a silent truncation into an error the caller already +knows how to handle. + +CVE: CVE-2026-105437 +Upstream-Status: Backport [https://github.com/git/git/commit/288266c11d91a01239e8e17f4bd90f1276e30030] + +Based-on-patch-by: Jeff King +Helped-by: Toon Claes +Helped-by: Christian Couder +Signed-off-by: Kaartic Sivaraam +Signed-off-by: Ashishkumar Parmar +--- + t/t4300-merge-tree.sh | 74 +++++++++++++++++++++++++++++++++++++++++++ + xdiff/xmerge.c | 45 ++++++++++++++------------ + 2 files changed, 99 insertions(+), 20 deletions(-) + +diff --git a/t/t4300-merge-tree.sh b/t/t4300-merge-tree.sh +index 27fbe193bc..13e883c491 100755 +--- a/t/t4300-merge-tree.sh ++++ b/t/t4300-merge-tree.sh +@@ -378,4 +378,78 @@ test_expect_success 'merge-tree respects core.useReplaceRefs=false' ' + test valid = $merged + ' + ++# A couple of tests to ensure merge-tree does not undergo a heap ++# buffer overflow. ++# ++# Number of lines per file, and every Nth line is a conflict site. ++# With N=5 and 2100 lines there are 420 independent conflict hunks per file. ++# We use the specified MARKER_SIZE as it amounts to around 10MiB of conflict ++# hunk text for each conflict in the file. This helps us to quickly trigger ++# the heap buffer overflow with just 420 conflict hunks. ++LINES=2100 ++STEP=5 ++MARKER_SIZE=3495254 ++ ++# gen_file