Skip to contentSkip to conversation

ntfs-3g-ntfsprogs: backport security fixes

PATCH New Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco) 1 participant 8 messages Oct 19

lore
Share & tools
lore
#0 lore raw

cover ntfs-3g-ntfsprogs: backport security fixes

From: Darsh Kelaiya <[email protected]>

Backport upstream security fixes to ntfs-3g-ntfsprogs 2022.10.3 on Wrynose. The series addresses CVE-2026-46572, CVE-2026-42617, CVE-2026-46571, CVE-2026-46570, CVE-2026-46569, CVE-2026-42618, CVE-2026-42616, and CVE-2026-40706.

The series includes shared index validation fixes, decompression hardening, and a follow-up check for POSIX ACL allocation failure.

Darsh Kelaiya (7):
ntfs-3g-ntfsprogs: fix CVE-2026-46572 and CVE-2026-42617
ntfs-3g-ntfsprogs: fix CVE-2026-46571
ntfs-3g-ntfsprogs: fix CVE-2026-46570
ntfs-3g-ntfsprogs: fix CVE-2026-46569
ntfs-3g-ntfsprogs: fix CVE-2026-42618
ntfs-3g-ntfsprogs: fix CVE-2026-42616
ntfs-3g-ntfsprogs: fix CVE-2026-40706

 .../files/CVE-2026-40706_p1.patch           |  60 ++++++
 .../files/CVE-2026-40706_p2.patch           |  34 +++
 .../files/CVE-2026-42616_p1.patch           |  70 +++++++
 .../files/CVE-2026-42616_p2.patch           |  79 +++++++
 .../files/CVE-2026-42618_p1.patch           |  53 +++++
 .../files/CVE-2026-42618_p2.patch           | 221 ++++++++++++++++++++
 .../files/CVE-2026-46569.patch              |  62 ++++++
 .../files/CVE-2026-46570.patch              |  42 ++++
 .../files/CVE-2026-46571.patch              |  50 +++++
 .../CVE-2026-46572_CVE-2026-42617_p1.patch  |  66 ++++++
 .../CVE-2026-46572_CVE-2026-42617_p2.patch  | 104 +++++++++
 .../CVE-2026-46572_CVE-2026-42617_p3.patch  |  35 ++++
 .../ntfs-3g-ntfsprogs_2022.10.3.bb          |  12 ++
 13 files changed, 888 insertions(+)
Signature · 1 line
2.35.6
#1 lore raw

PATCH 1/7 ntfs-3g-ntfsprogs: fix CVE-2026-46572 and CVE-2026-42617

From: Darsh Kelaiya <[email protected]>

This patch applies the upstream fixes shown in [1], [2], and [3]. The NVD records describing the vulnerabilities are referenced in
[4] and [5].

[1] https://github.com/tuxera/ntfs-3g/commit/2ead8a3ccf940c0219ffba587fab54e21462b3a5
[2] https://github.com/tuxera/ntfs-3g/commit/dfd1a7c6eb23a22238ec193451fa59c989b4381f
[3] https://github.com/tuxera/ntfs-3g/commit/edf2b892356684ca8f2fc5898943c7a9b90ffb80
[4] https://nvd.nist.gov/vuln/detail/CVE-2026-46572
[5] https://nvd.nist.gov/vuln/detail/CVE-2026-42617

---
 .../CVE-2026-46572_CVE-2026-42617_p1.patch    |  66 +++++++++++
 .../CVE-2026-46572_CVE-2026-42617_p2.patch    | 104 ++++++++++++++++++
 .../CVE-2026-46572_CVE-2026-42617_p3.patch    |  35 ++++++
 .../ntfs-3g-ntfsprogs_2022.10.3.bb            |   3 +
 4 files changed, 208 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46572_CVE-2026-42617_p1.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46572_CVE-2026-42617_p2.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46572_CVE-2026-42617_p3.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46572_CVE-2026-42617_p1.patch new file +66 -0
new file mode 100644
index 0000000000..47121ea9a5
@@ -0,0 +1,66 @@
+From 7a3fccddc2bca7609fd6597fcb6ea8a42a258937 Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Fri, 24 Apr 2026 13:00:30 +0300
+Subject: [PATCH] index.c: Validate the size of data copied from root to index
+ block.
+
+If the last entry extends beyond the index block size, we could copy
+more bytes than allocated into the index block, overflowing its
+allocation. Fixed by adding a bounds check prior to the memcpy, emitting
+an error message and returning NULL with errno == EIO as this is an
+inconsistency.
+
+Thanks to Alexandro Calo' from Nozomi Networks Labs for reporting this
+issue.
+
+CVE: CVE-2026-46572 CVE-2026-42617
+Upstream-Status: Backport [https://github.com/tuxera/ntfs-3g/commit/2ead8a3ccf940c0219ffba587fab54e21462b3a5]
+
+(cherry picked from commit 2ead8a3ccf940c0219ffba587fab54e21462b3a5)
+Signed-off-by: Darsh Kelaiya <[email protected]>
+---
+ libntfs-3g/index.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/libntfs-3g/index.c b/libntfs-3g/index.c
+index e48d6aaf..2739594b 100644
+--- a/libntfs-3g/index.c
++++ b/libntfs-3g/index.c
+@@ -1091,14 +1091,16 @@ out:
+ 
+ static INDEX_BLOCK *ntfs_ir_to_ib(INDEX_ROOT *ir, VCN ib_vcn)
+ {
++	u32 ib_size;
+ 	INDEX_BLOCK *ib;
+ 	INDEX_ENTRY *ie_last;
+ 	char *ies_start, *ies_end;
+ 	int i;
+ 	
+ 	ntfs_log_trace("Entering\n");
+-	
+-	ib = ntfs_ib_alloc(ib_vcn, le32_to_cpu(ir->index_block_size), LEAF_NODE);
++
++	ib_size = le32_to_cpu(ir->index_block_size);
++	ib = ntfs_ib_alloc(ib_vcn, ib_size, LEAF_NODE);
+ 	if (!ib)
+ 		return NULL;
+ 	
+@@ -1110,6 +1112,18 @@ static INDEX_BLOCK *ntfs_ir_to_ib(INDEX_ROOT *ir, VCN ib_vcn)
+ 	 * as well, which can never have any data.
+ 	 */
+ 	i = (char *)ie_last - ies_start + le16_to_cpu(ie_last->length);
++
++	if (offsetof(INDEX_BLOCK, index) + le32_to_cpu(ib->index.entries_offset)
++			+ i > ib_size)
++	{
++		ntfs_log_error("Last entry in index root overflows the index "
++				"block size: %d (index block size: %lu)\n",
++				i, (unsigned long)ib_size);
++		free(ib);
++		errno = EIO;
++		return NULL;
++	}
++
+ 	memcpy(ntfs_ie_get_first(&ib->index), ies_start, i);
+ 	
+ 	ib->index.ih_flags = ir->index.ih_flags;
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46572_CVE-2026-42617_p2.patch new file +104 -0

104 lines not on this page · raw message

meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46572_CVE-2026-42617_p3.patch new file +35 -0
new file mode 100644
index 0000000000..54bce4f95e
@@ -0,0 +1,35 @@
+From c8630e735204fd4ed4b49c4dc315716664b965c1 Mon Sep 17 00:00:00 2001
+From: Rakesh Pandit <[email protected]>
+Date: Mon, 8 Jun 2026 09:57:11 +0300
+Subject: [PATCH] Validate INDEX_ROOT.index_block_size from disk.
+
+Reject INDEX_ROOT attributes whose index_block_size is smaller than
+NTFS_BLOCK_SIZE or not a power of two. Same rule the driver already
+applies at libntfs-3g/dir.c.
+
+Thanks to Alexandro Calo' from Nozomi Networks Labs for the report.
+
+CVE: CVE-2026-46572 CVE-2026-42617
+Upstream-Status: Backport [https://github.com/tuxera/ntfs-3g/commit/edf2b892356684ca8f2fc5898943c7a9b90ffb80]
+
+(cherry picked from commit edf2b892356684ca8f2fc5898943c7a9b90ffb80)
+Signed-off-by: Darsh Kelaiya <[email protected]>
+---
+ libntfs-3g/attrib.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c
+index ad9ebceb..cfc2446e 100644
+--- a/libntfs-3g/attrib.c
++++ b/libntfs-3g/attrib.c
+@@ -3528,6 +3528,10 @@ int ntfs_attr_inconsistent(const ATTR_RECORD *a, const MFT_REF mref)
+ 			if (a->non_resident
+ 			    || (le32_to_cpu(a->value_length)
+ 				< offsetof(INDEX_ROOT, index.reserved))
++			    || (le32_to_cpu(ir->index_block_size)
++				< NTFS_BLOCK_SIZE)
++			    || (le32_to_cpu(ir->index_block_size)
++				& (le32_to_cpu(ir->index_block_size) - 1))
+ 			    || (le32_to_cpu(ir->index.entries_offset)
+ 				< sizeof(INDEX_HEADER))
+ 			    || (le32_to_cpu(ir->index.index_length)
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2022.10.3.bb +3 -0
index 3a7dd783b9..4ed47ff53a 100644
@@ -9,6 +9,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
 SRC_URI = "git://github.com/tuxera/ntfs-3g;protocol=https;branch=edge;tag=${PV} \
            file://0001-libntfs-3g-Makefile.am-fix-install-failed-while-host.patch \
            file://0001-unistr.c-Fix-use-after-free-in-ntfs_uppercase_mbs.patch \
+           file://CVE-2026-46572_CVE-2026-42617_p1.patch \
+           file://CVE-2026-46572_CVE-2026-42617_p2.patch \
+           file://CVE-2026-46572_CVE-2026-42617_p3.patch \
 "
 SRCREV = "78414d93613532fd82f3a82aba5d4a1c32898781"
 
Signature · 1 line
2.35.6
#2 lore raw

PATCH 2/7 ntfs-3g-ntfsprogs: fix CVE-2026-46571

In reply to Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)

From: Darsh Kelaiya <[email protected]>

This patch applies the upstream fix shown in [1]. The NVD record describing the vulnerability is referenced in [2].

[1] https://github.com/tuxera/ntfs-3g/commit/b912272b30c552b0457e40a0a68b1fac2587aaea
[2] https://nvd.nist.gov/vuln/detail/CVE-2026-46571

---
 .../files/CVE-2026-46571.patch                | 50 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2022.10.3.bb            |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46571.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46571.patch new file +50 -0
new file mode 100644
index 0000000000..b2739f026e
@@ -0,0 +1,50 @@
+From fc32321c8c795e9f73cbdd8f36fcd9e0a3a9814b Mon Sep 17 00:00:00 2001
+From: Rakesh Pandit <[email protected]>
+Date: Mon, 8 Jun 2026 14:16:39 +0300
+Subject: [PATCH] reparse.c: Bounds-check locase index in ntfs_fix_file_name.
+
+The case-insensitive branch indexed vol->locase with a raw 16-bit code
+point and no check against vol->upcase_len.  A truncated $UpCase made
+the table shorter than 65536 entries, so a file name character >=
+upcase_len read past it and leaked 2 heap bytes via the symlink target
+returned to userspace.
+
+Thanks to Alexandro Calo' from Nozomi Networks Labs for reporting this
+issue.
+
+CVE: CVE-2026-46571
+Upstream-Status: Backport [https://github.com/tuxera/ntfs-3g/commit/b912272b30c552b0457e40a0a68b1fac2587aaea]
+
+(cherry picked from commit b912272b30c552b0457e40a0a68b1fac2587aaea)
+Signed-off-by: Darsh Kelaiya <[email protected]>
+---
+ libntfs-3g/reparse.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/libntfs-3g/reparse.c b/libntfs-3g/reparse.c
+index 76dbe2f1..54858caa 100644
+--- a/libntfs-3g/reparse.c
++++ b/libntfs-3g/reparse.c
+@@ -196,11 +196,19 @@ static u64 ntfs_fix_file_name(ntfs_inode *dir_ni, ntfschar *uname,
+ 				lemref = entry->indexed_file;
+ 				mref = le64_to_cpu(lemref);
+ 				if (NVolCaseSensitive(vol) || !vol->locase) {
+-					for (i=0; i<found->file_name_length; i++)
++					for (i=0; i<found->file_name_length;
++							i++)
+ 						uname[i] = found->file_name[i];
+ 				} else {
+-					for (i=0; i<found->file_name_length; i++)
+-						uname[i] = vol->locase[le16_to_cpu(found->file_name[i])];
++					for (i=0; i<found->file_name_length;
++							i++) {
++						u16 u = le16_to_cpu(found->
++								file_name[i]);
++						uname[i] = (u < vol->upcase_len)
++								? vol->locase[u]
++								: found->
++								  file_name[i];
++					}
+ 				}
+ 			}
+ 		}
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2022.10.3.bb +1 -0
index 4ed47ff53a..1e1b5bc54a 100644
@@ -12,6 +12,7 @@ SRC_URI = "git://github.com/tuxera/ntfs-3g;protocol=https;branch=edge;tag=${PV}
            file://CVE-2026-46572_CVE-2026-42617_p1.patch \
            file://CVE-2026-46572_CVE-2026-42617_p2.patch \
            file://CVE-2026-46572_CVE-2026-42617_p3.patch \
+           file://CVE-2026-46571.patch \
 "
 SRCREV = "78414d93613532fd82f3a82aba5d4a1c32898781"
 
Signature · 1 line
2.35.6
#3 lore raw

PATCH 3/7 ntfs-3g-ntfsprogs: fix CVE-2026-46570

In reply to Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)

From: Darsh Kelaiya <[email protected]>

This patch applies the upstream fix shown in [1]. The NVD record describing the vulnerability is referenced in [2].

[1] https://github.com/tuxera/ntfs-3g/commit/5ab37421ebbcbf33bf96876c7a034393bda05a25
[2] https://nvd.nist.gov/vuln/detail/CVE-2026-46570

---
 .../files/CVE-2026-46570.patch                | 42 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2022.10.3.bb            |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46570.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46570.patch new file +42 -0
new file mode 100644
index 0000000000..fb76bc80b1
@@ -0,0 +1,42 @@
+From bb4da656cab16325002eaf785ca967d426510e94 Mon Sep 17 00:00:00 2001
+From: Rakesh Pandit <[email protected]>
+Date: Mon, 8 Jun 2026 14:24:54 +0300
+Subject: [PATCH] Cap B tree depth in ntfs_index_walk_down to MAX_PARENT_VCN.
+
+ntfs_index_walk_down() incremented ictx->pindex and wrote into
+ictx->parent_pos[] / parent_vcn[] (both sized MAX_PARENT_VCN) without
+checking the bound.  A B+tree deeper than MAX_PARENT_VCN levels then
+overflowed both arrays and since parent_vcn[32] overlaps the pindex
+field the OOB write gave an attacker control over the next iteration's
+offset and value.
+
+Thanks to Alexandro Calo' from Nozomi Networks Labs for reporting this
+issue.
+
+CVE: CVE-2026-46570
+Upstream-Status: Backport [https://github.com/tuxera/ntfs-3g/commit/5ab37421ebbcbf33bf96876c7a034393bda05a25]
+
+(cherry picked from commit 5ab37421ebbcbf33bf96876c7a034393bda05a25)
+Signed-off-by: Darsh Kelaiya <[email protected]>
+---
+ libntfs-3g/index.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/libntfs-3g/index.c b/libntfs-3g/index.c
+index c9651a62..9c11a45c 100644
+--- a/libntfs-3g/index.c
++++ b/libntfs-3g/index.c
+@@ -2105,6 +2105,13 @@ static INDEX_ENTRY *ntfs_index_walk_down(INDEX_ENTRY *ie,
+ 			/* down from non-zero level */
+ 			
+ 			ictx->pindex++;
++			if (ictx->pindex >= MAX_PARENT_VCN) {
++				errno = EOPNOTSUPP;
++				ntfs_log_perror("Index is over %d level deep",
++						MAX_PARENT_VCN);
++				entry = (INDEX_ENTRY*)NULL;
++				break;
++			}
+ 		}
+ 		ictx->parent_pos[ictx->pindex] = 0;
+ 		ictx->parent_vcn[ictx->pindex] = vcn;
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2022.10.3.bb +1 -0
index 1e1b5bc54a..e17c3d2481 100644
@@ -13,6 +13,7 @@ SRC_URI = "git://github.com/tuxera/ntfs-3g;protocol=https;branch=edge;tag=${PV}
            file://CVE-2026-46572_CVE-2026-42617_p2.patch \
            file://CVE-2026-46572_CVE-2026-42617_p3.patch \
            file://CVE-2026-46571.patch \
+           file://CVE-2026-46570.patch \
 "
 SRCREV = "78414d93613532fd82f3a82aba5d4a1c32898781"
 
Signature · 1 line
2.35.6
#4 lore raw

PATCH 4/7 ntfs-3g-ntfsprogs: fix CVE-2026-46569

In reply to Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)

From: Darsh Kelaiya <[email protected]>

This patch applies the upstream fix shown in [1]. The NVD record describing the vulnerability is referenced in [2].

[1] https://github.com/tuxera/ntfs-3g/commit/961ed5c2fa2f36ef6a347f04e1fa586113c97e7c
[2] https://nvd.nist.gov/vuln/detail/CVE-2026-46569

---
 .../files/CVE-2026-46569.patch                | 62 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2022.10.3.bb            |  1 +
 2 files changed, 63 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46569.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-46569.patch new file +62 -0
new file mode 100644
index 0000000000..5c496159ec
@@ -0,0 +1,62 @@
+From 677d21be1ac7ec0a59cfbed8e26d1ffbf0922ac1 Mon Sep 17 00:00:00 2001
+From: Rakesh Pandit <[email protected]>
+Date: Mon, 8 Jun 2026 10:34:38 +0300
+Subject: [PATCH] Bound tail_size in ntfs_ib_copy_tail against destination
+ capacity.
+
+A crafted source INDX block can drive tail_size past the freshly
+allocated destination's usable space and overflow the memcpy.  Add
+a capacity check (and a < 0 guard against sign-extension at
+memcpy).
+
+Thanks to Alexandro Calo' from Nozomi Networks Labs for reporting
+this issue.
+
+CVE: CVE-2026-46569
+Upstream-Status: Backport [https://github.com/tuxera/ntfs-3g/commit/961ed5c2fa2f36ef6a347f04e1fa586113c97e7c]
+
+(cherry picked from commit 961ed5c2fa2f36ef6a347f04e1fa586113c97e7c)
+Signed-off-by: Darsh Kelaiya <[email protected]>
+---
+ libntfs-3g/index.c | 21 ++++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/libntfs-3g/index.c b/libntfs-3g/index.c
+index 9c11a45c..347bd408 100644
+--- a/libntfs-3g/index.c
++++ b/libntfs-3g/index.c
+@@ -1193,7 +1193,7 @@ static int ntfs_ib_copy_tail(ntfs_index_context *icx, INDEX_BLOCK *src,
+ {
+ 	u8 *ies_end;
+ 	INDEX_ENTRY *ie_head;		/* first entry after the median */
+-	int tail_size, ret;
++	int tail_size, dst_capacity, ret;
+ 	INDEX_BLOCK *dst;
+ 	
+ 	ntfs_log_trace("Entering\n");
+@@ -1207,6 +1207,25 @@ static int ntfs_ib_copy_tail(ntfs_index_context *icx, INDEX_BLOCK *src,
+ 	
+ 	ies_end = (u8 *)ntfs_ie_get_end(&src->index);
+ 	tail_size = ies_end - (u8 *)ie_head;
++	dst_capacity = (int)(le32_to_cpu(dst->index.allocated_size)
++			     - le32_to_cpu(dst->index.entries_offset));
++
++	/*
++	 * src->index.entries_offset (on-disk, only required to be >=
++	 * sizeof(INDEX_HEADER) by ntfs_index_block_inconsistent) may be smaller
++	 * than dst's, which ntfs_ib_alloc fixes (40 on a 4 KiB block).  When
++	 * the median lands near the start of the source stream the gap lets
++	 * tail_size exceed dst's usable space.  The < 0 guard catches a
++	 * negative tail_size before memcpy sign-extends it into a huge size_t.
++	 */
++	if (tail_size < 0 || tail_size > dst_capacity) {
++		ntfs_log_error("Invalid tail_size %d (dst capacity %d) in "
++				"ntfs_ib_copy_tail\n", tail_size, dst_capacity);
++		free(dst);
++		errno = EIO;
++		return STATUS_ERROR;
++	}
++
+ 	memcpy(ntfs_ie_get_first(&dst->index), ie_head, tail_size);
+ 	
+ 	dst->index.index_length = cpu_to_le32(tail_size + 
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2022.10.3.bb +1 -0
index e17c3d2481..f4f4ccfdf1 100644
@@ -14,6 +14,7 @@ SRC_URI = "git://github.com/tuxera/ntfs-3g;protocol=https;branch=edge;tag=${PV}
            file://CVE-2026-46572_CVE-2026-42617_p3.patch \
            file://CVE-2026-46571.patch \
            file://CVE-2026-46570.patch \
+           file://CVE-2026-46569.patch \
 "
 SRCREV = "78414d93613532fd82f3a82aba5d4a1c32898781"
 
Signature · 1 line
2.35.6
#5 lore raw

PATCH 5/7 ntfs-3g-ntfsprogs: fix CVE-2026-42618

In reply to Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)

From: Darsh Kelaiya <[email protected]>

This patch applies the upstream fixes shown in [1] and [2]. The NVD record describing the vulnerability is referenced in [3].

[1] https://github.com/tuxera/ntfs-3g/commit/e021cbe3d7a42963110e4561f2a1327614c20a00
[2] https://github.com/tuxera/ntfs-3g/commit/6aa66d98980ac1d966d7977c7b079f4fe380eb42
[3] https://nvd.nist.gov/vuln/detail/CVE-2026-42618

---
 .../files/CVE-2026-42618_p1.patch             |  53 +++++
 .../files/CVE-2026-42618_p2.patch             | 221 ++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2022.10.3.bb            |   2 +
 3 files changed, 276 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-42618_p1.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-42618_p2.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-42618_p1.patch new file +53 -0
new file mode 100644
index 0000000000..15aad65234
@@ -0,0 +1,53 @@
+From fbc829df733e7aa960780e0c60d26a0b63786a38 Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Fri, 24 Apr 2026 12:06:24 +0300
+Subject: [PATCH] compress.c: Fix incorrect comparison in destination bounds
+ check.
+
+When checking whether 'dest' was at or past the end of the destination
+buffer we were checking if 'dest' was larger then 'dest_sb_end', however
+'dest_sb_end' is already past the end of the destination buffer since
+it is constructed with 'dest + dest_size', i.e. dereferencing
+'dest_sb_end' is invalid. Fixed by using '>=' instead of '>'.
+
+Thanks to Alexandro Calo' from Nozomi Networks Labs for reporting this
+issue.
+
+CVE: CVE-2026-42618
+Upstream-Status: Backport [https://github.com/tuxera/ntfs-3g/commit/e021cbe3d7a42963110e4561f2a1327614c20a00]
+
+Backport Changes:
+- Upstream e021cbe3 follows the indentation changes in 6c67a098.
+  Apply its two bounds checks to the original ntfs_decompress() layout
+  in libntfs-3g/compress.c from NTFS-3G 2022.10.3.
+- Preserve both upstream dest >= dest_sb_end checks so the tag and
+  token paths stop before accessing the end of the destination buffer.
+
+(cherry picked from commit e021cbe3d7a42963110e4561f2a1327614c20a00)
+Signed-off-by: Darsh Kelaiya <[email protected]>
+---
+ libntfs-3g/compress.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libntfs-3g/compress.c b/libntfs-3g/compress.c
+index 390b2d97..5f4df0ea 100644
+--- a/libntfs-3g/compress.c
++++ b/libntfs-3g/compress.c
+@@ -546,7 +546,7 @@ do_next_tag:
+ 		goto do_next_sb;
+ 	}
+ 	/* Check we are still in range. */
+-	if (cb > cb_sb_end || dest > dest_sb_end)
++	if (cb > cb_sb_end || dest >= dest_sb_end)
+ 		goto return_overflow;
+ 	/* Get the next tag and advance to first token. */
+ 	tag = *cb++;
+@@ -557,7 +557,7 @@ do_next_tag:
+ 		u8 *dest_back_addr;
+ 
+ 		/* Check if we are done / still in range. */
+-		if (cb >= cb_sb_end || dest > dest_sb_end)
++		if (cb >= cb_sb_end || dest >= dest_sb_end)
+ 			break;
+ 		/* Determine token type and parse appropriately.*/
+ 		if ((tag & NTFS_TOKEN_MASK) == NTFS_SYMBOL_TOKEN) {
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-42618_p2.patch new file +221 -0

221 lines not on this page · raw message

meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2022.10.3.bb +2 -0
index f4f4ccfdf1..85f355ca64 100644
@@ -15,6 +15,8 @@ SRC_URI = "git://github.com/tuxera/ntfs-3g;protocol=https;branch=edge;tag=${PV}
            file://CVE-2026-46571.patch \
            file://CVE-2026-46570.patch \
            file://CVE-2026-46569.patch \
+           file://CVE-2026-42618_p1.patch \
+           file://CVE-2026-42618_p2.patch \
 "
 SRCREV = "78414d93613532fd82f3a82aba5d4a1c32898781"
 
Signature · 1 line
2.35.6
#6 lore raw

PATCH 6/7 ntfs-3g-ntfsprogs: fix CVE-2026-42616

In reply to Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)

From: Darsh Kelaiya <[email protected]>

This patch applies the upstream fix shown in [1]. The NVD record describing the vulnerability is referenced in [3].

The follow-up in [2] is included to close the opened attribute when malloc fails and use a common cleanup path for the attribute and buffer.

[1] https://github.com/tuxera/ntfs-3g/commit/dc1b682e99b6c055b0281ca543a8420b698420d1
[2] https://github.com/tuxera/ntfs-3g/commit/8cd4718cad4941ef49ea5b3af8cd9ec68a46af7a
[3] https://nvd.nist.gov/vuln/detail/CVE-2026-42616

---
 .../files/CVE-2026-42616_p1.patch             | 70 ++++++++++++++++
 .../files/CVE-2026-42616_p2.patch             | 79 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2022.10.3.bb            |  2 +
 3 files changed, 151 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-42616_p1.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-42616_p2.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-42616_p1.patch new file +70 -0
new file mode 100644
index 0000000000..26858a3537
@@ -0,0 +1,70 @@
+From 96f3c15677c6aa0251798eef74a5a4c376523ee3 Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Fri, 24 Apr 2026 12:18:24 +0300
+Subject: [PATCH] ntfscat.c: Fix reading outside the buffer when block size >
+ buffer size.
+
+The block size may be read from the index root's 'index_block_size'
+member, and isn't guaranteed to be >= 4096 (as far as I can tell it
+could be larger). This would for MST protected records lead to storing
+data past the end of the allocated buffer.
+
+Fixed by allocating the necessary amount of buffer space for the case
+when the block size exceeds 4096.
+
+Thanks to Alexandro Calo' from Nozomi Networks Labs for reporting this
+issue.
+
+CVE: CVE-2026-42616
+Upstream-Status: Backport [https://github.com/tuxera/ntfs-3g/commit/dc1b682e99b6c055b0281ca543a8420b698420d1]
+
+(cherry picked from commit dc1b682e99b6c055b0281ca543a8420b698420d1)
+Signed-off-by: Darsh Kelaiya <[email protected]>
+---
+ ntfsprogs/ntfscat.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/ntfsprogs/ntfscat.c b/ntfsprogs/ntfscat.c
+index b8af2503..0f711815 100644
+--- a/ntfsprogs/ntfscat.c
++++ b/ntfsprogs/ntfscat.c
+@@ -334,22 +334,17 @@ static int index_get_size(ntfs_inode *inode)
+ static int cat(ntfs_volume *vol, ntfs_inode *inode, ATTR_TYPES type,
+ 		ntfschar *name, int namelen)
+ {
+-	const int bufsize = 4096;
+ 	char *buffer;
+ 	ntfs_attr *attr;
+ 	s64 bytes_read, written;
+ 	s64 offset;
+ 	u32 block_size;
+-
+-	buffer = malloc(bufsize);
+-	if (!buffer)
+-		return 1;
++	u32 bufsize = 4096;
+ 
+ 	attr = ntfs_attr_open(inode, type, name, namelen);
+ 	if (!attr) {
+ 		ntfs_log_error("Cannot find attribute type 0x%x.\n",
+ 				le32_to_cpu(type));
+-		free(buffer);
+ 		return 1;
+ 	}
+ 
+@@ -360,6 +355,15 @@ static int cat(ntfs_volume *vol, ntfs_inode *inode, ATTR_TYPES type,
+ 	else
+ 		block_size = 0;
+ 
++	if (bufsize < block_size) {
++		bufsize = block_size;
++	}
++
++	buffer = malloc(bufsize);
++	if (!buffer) {
++		return 1;
++	}
++
+ 	offset = 0;
+ 	for (;;) {
+ 		if (!opts.raw && block_size > 0) {
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-42616_p2.patch new file +79 -0

79 lines not on this page · raw message

meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2022.10.3.bb +2 -0
index 85f355ca64..3ba45438bd 100644
@@ -17,6 +17,8 @@ SRC_URI = "git://github.com/tuxera/ntfs-3g;protocol=https;branch=edge;tag=${PV}
            file://CVE-2026-46569.patch \
            file://CVE-2026-42618_p1.patch \
            file://CVE-2026-42618_p2.patch \
+           file://CVE-2026-42616_p1.patch \
+           file://CVE-2026-42616_p2.patch \
 "
 SRCREV = "78414d93613532fd82f3a82aba5d4a1c32898781"
 
Signature · 1 line
2.35.6
#7 lore raw

PATCH 7/7 ntfs-3g-ntfsprogs: fix CVE-2026-40706

In reply to Darsh Kelaiya -X (dkelaiya - E INFOCHIPS PRIVATE LIMITED at Cisco)

From: Darsh Kelaiya <[email protected]>

This patch applies the upstream allocation fix shown in [1]. The NVD record describing the vulnerability is referenced in [3].

The fix in [1] allocates space for the worst-case number of POSIX ACL entries in ntfs_build_permissions_posix(). The follow-up in [2] is included to handle allocation failure: check the malloc result, set errno to ENOMEM, and return NULL before using the descriptor.

[1] https://github.com/tuxera/ntfs-3g/commit/e48e1ef2a1fcff13a590c2224ec21c5bd5d3e92e
[2] https://github.com/tuxera/ntfs-3g/commit/c5413e242309f88ce5a83c0c2538184b19eea1bc
[3] https://nvd.nist.gov/vuln/detail/CVE-2026-40706

---
 .../files/CVE-2026-40706_p1.patch             | 60 +++++++++++++++++++
 .../files/CVE-2026-40706_p2.patch             | 34 +++++++++++
 .../ntfs-3g-ntfsprogs_2022.10.3.bb            |  2 +
 3 files changed, 96 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-40706_p1.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-40706_p2.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-40706_p1.patch new file +60 -0
new file mode 100644
index 0000000000..22ece5aca3
@@ -0,0 +1,60 @@
+From 696eb743bd94ddbb86e84e544e152845b92a8a7f Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Tue, 24 Feb 2026 10:04:31 +0200
+Subject: [PATCH] acls.c: Fix heap buffer overflow in
+ 'ntfs_build_permissions_posix'.
+
+The root cause was that the memory allocated for the ACE entries was
+insufficient for the worst case scenario when group entries were added
+for mask entries that didn't have a corresponding group entry already.
+Fixed by allocating space for the worst case number of ACE entries.
+
+This was reported by Andrea Bocchetti with a thorough report which made
+it very easy to fix.
+
+CVE: CVE-2026-40706
+Upstream-Status: Backport [https://github.com/tuxera/ntfs-3g/commit/e48e1ef2a1fcff13a590c2224ec21c5bd5d3e92e]
+
+(cherry picked from commit e48e1ef2a1fcff13a590c2224ec21c5bd5d3e92e)
+Signed-off-by: Darsh Kelaiya <[email protected]>
+---
+ libntfs-3g/acls.c | 25 ++++++++++++++++++++-----
+ 1 file changed, 20 insertions(+), 5 deletions(-)
+
+diff --git a/libntfs-3g/acls.c b/libntfs-3g/acls.c
+index 9f16fecd..4cf534bf 100644
+--- a/libntfs-3g/acls.c
++++ b/libntfs-3g/acls.c
+@@ -3716,12 +3716,27 @@ struct POSIX_SECURITY *ntfs_build_permissions_posix(
+ 		/*
+ 		 * Build a raw posix security descriptor
+ 		 * by just translating permissions and ids
+-		 * Add 2 to the count of ACE to be able to insert
+-		 * a group ACE later in access and default ACLs
+-		 * and add 2 more to be able to insert ACEs for owner
+-		 * and 2 more for other
++		 *
++		 * The worst case number of ACE entries consists of:
++		 * - 'acecount' ACE entries from the main loop (see below)
++		 *   iterating over the 'securattr' array.
++		 * - 1 ACE entry which may be added when creating world
++		 *   permissions if none exist.
++		 * - 1 ACE entry which may be added when setting basic owner
++		 *   permissions if none exist (both lists).
++		 * - 1 ACE entry which may be added when duplicating world
++		 *   permissions as group_obj permissions if none exist.
++		 * - 'acecount + 2' ACE entries which may be added when
++		 *   duplicating world permissions as group permissions if they
++		 *   were converted to masks and the masks are not followed by a
++		 *   group entry.
++		 * - 1 ACE entry which may be added when inserting a default
++		 *   mask if none is present and there are designated users or
++		 *   groups.
++		 *
++		 * This amounts to 2*acecnt + 6 ACE entries in the worst case.
+ 		 */
+-	alloccnt = acecnt + 6;
++	alloccnt = 2*acecnt + 6;
+ 	pxdesc = (struct POSIX_SECURITY*)malloc(
+ 				sizeof(struct POSIX_SECURITY)
+ 				+ alloccnt*sizeof(struct POSIX_ACE));
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/files/CVE-2026-40706_p2.patch new file +34 -0
new file mode 100644
index 0000000000..f19f9370bf
@@ -0,0 +1,34 @@
+From a0842353864ad42abc30119af2fa5b9f5751d66b Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Tue, 24 Feb 2026 16:35:21 +0200
+Subject: [PATCH] acls.c: Add 'malloc' return value check when allocating POSIX
+ ACL.
+
+CVE: CVE-2026-40706
+Upstream-Status: Backport [https://github.com/tuxera/ntfs-3g/commit/c5413e242309f88ce5a83c0c2538184b19eea1bc]
+
+(cherry picked from commit c5413e242309f88ce5a83c0c2538184b19eea1bc)
+Signed-off-by: Darsh Kelaiya <[email protected]>
+---
+ libntfs-3g/acls.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/libntfs-3g/acls.c b/libntfs-3g/acls.c
+index 4cf534bf..2d24d65e 100644
+--- a/libntfs-3g/acls.c
++++ b/libntfs-3g/acls.c
+@@ -3740,6 +3740,14 @@ struct POSIX_SECURITY *ntfs_build_permissions_posix(
+ 	pxdesc = (struct POSIX_SECURITY*)malloc(
+ 				sizeof(struct POSIX_SECURITY)
+ 				+ alloccnt*sizeof(struct POSIX_ACE));
++	if (!pxdesc) {
++		ntfs_log_perror("Unable to allocate %zu bytes for "
++				"POSIX_SECURITY structure",
++				(size_t)(sizeof(struct POSIX_SECURITY) +
++					alloccnt*sizeof(struct POSIX_ACE)));
++		errno = ENOMEM;
++		return NULL;
++	}
+ 	k = 0;
+ 	l = alloccnt;
+ 	for (i=0; i<2; i++) {
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2022.10.3.bb +2 -0
index 3ba45438bd..a29be8ab90 100644
@@ -19,6 +19,8 @@ SRC_URI = "git://github.com/tuxera/ntfs-3g;protocol=https;branch=edge;tag=${PV}
            file://CVE-2026-42618_p2.patch \
            file://CVE-2026-42616_p1.patch \
            file://CVE-2026-42616_p2.patch \
+           file://CVE-2026-40706_p1.patch \
+           file://CVE-2026-40706_p2.patch \
 "
 SRCREV = "78414d93613532fd82f3a82aba5d4a1c32898781"
 
Signature · 1 line
2.35.6