Skip to content

Commit 8411408

Browse files
Merge PR "[AUTO-CHERRYPICK] [AutoPR- Security] Patch ntfs-3g for CVE-2026-40706 [HIGH] - branch main" #16857
Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
1 parent ea06fd8 commit 8411408

2 files changed

Lines changed: 65 additions & 1 deletion

File tree

SPECS/ntfs-3g/CVE-2026-40706.patch

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
From b27303905e208e89b9cb7cc5aab9f57339424a86 Mon Sep 17 00:00:00 2001
2+
From: Erik Larsson <erik@tuxera.com>
3+
Date: Tue, 24 Feb 2026 10:04:31 +0200
4+
Subject: [PATCH] acls.c: Fix heap buffer overflow in
5+
'ntfs_build_permissions_posix'.
6+
7+
The root cause was that the memory allocated for the ACE entries was
8+
insufficient for the worst case scenario when group entries were added
9+
for mask entries that didn't have a corresponding group entry already.
10+
Fixed by allocating space for the worst case number of ACE entries.
11+
12+
This was reported by Andrea Bocchetti with a thorough report which made
13+
it very easy to fix.
14+
15+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
16+
Upstream-reference: https://github.com/tuxera/ntfs-3g/commit/e48e1ef2a1fcff13a590c2224ec21c5bd5d3e92e.patch
17+
---
18+
libntfs-3g/acls.c | 25 ++++++++++++++++++++-----
19+
1 file changed, 20 insertions(+), 5 deletions(-)
20+
21+
diff --git a/libntfs-3g/acls.c b/libntfs-3g/acls.c
22+
index 9f16fec..4cf534b 100644
23+
--- a/libntfs-3g/acls.c
24+
+++ b/libntfs-3g/acls.c
25+
@@ -3716,12 +3716,27 @@ struct POSIX_SECURITY *ntfs_build_permissions_posix(
26+
/*
27+
* Build a raw posix security descriptor
28+
* by just translating permissions and ids
29+
- * Add 2 to the count of ACE to be able to insert
30+
- * a group ACE later in access and default ACLs
31+
- * and add 2 more to be able to insert ACEs for owner
32+
- * and 2 more for other
33+
+ *
34+
+ * The worst case number of ACE entries consists of:
35+
+ * - 'acecount' ACE entries from the main loop (see below)
36+
+ * iterating over the 'securattr' array.
37+
+ * - 1 ACE entry which may be added when creating world
38+
+ * permissions if none exist.
39+
+ * - 1 ACE entry which may be added when setting basic owner
40+
+ * permissions if none exist (both lists).
41+
+ * - 1 ACE entry which may be added when duplicating world
42+
+ * permissions as group_obj permissions if none exist.
43+
+ * - 'acecount + 2' ACE entries which may be added when
44+
+ * duplicating world permissions as group permissions if they
45+
+ * were converted to masks and the masks are not followed by a
46+
+ * group entry.
47+
+ * - 1 ACE entry which may be added when inserting a default
48+
+ * mask if none is present and there are designated users or
49+
+ * groups.
50+
+ *
51+
+ * This amounts to 2*acecnt + 6 ACE entries in the worst case.
52+
*/
53+
- alloccnt = acecnt + 6;
54+
+ alloccnt = 2*acecnt + 6;
55+
pxdesc = (struct POSIX_SECURITY*)malloc(
56+
sizeof(struct POSIX_SECURITY)
57+
+ alloccnt*sizeof(struct POSIX_ACE));
58+
--
59+
2.45.4
60+

SPECS/ntfs-3g/ntfs-3g.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
Summary: Linux NTFS userspace driver
22
Name: ntfs-3g
33
Version: 2022.10.3
4-
Release: 2%{?dist}
4+
Release: 3%{?dist}
55
License: GPLv2
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
88
URL: https://www.tuxera.com/company/open-source/
99
Source0: https://tuxera.com/opensource/%{name}_ntfsprogs-%{version}.tgz
1010
Patch0: ntfs-3g_ntfsprogs-2011.10.9-RC-ntfsck-unsupported-return-0.patch
1111
Patch1: CVE-2023-52890.patch
12+
Patch2: CVE-2026-40706.patch
1213

1314
BuildRequires: fuse-devel
1415
BuildRequires: gnutls-devel
@@ -171,6 +172,9 @@ rm -rf %{buildroot}%{_defaultdocdir}/%{name}/README
171172
%exclude %{_mandir}/man8/ntfs-3g*
172173

173174
%changelog
175+
* Thu Apr 23 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 2022.10.3-3
176+
- Patch for CVE-2026-40706
177+
174178
* Mon Jun 17 2024 Suresh Thelkar <sthelkar@microsoft.com> - 2022.10.3-2
175179
- Patch CVE-2023-52890
176180

0 commit comments

Comments
 (0)