public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Tom spot Callaway <spotaws@amazon.com>
To: git-commits@fedoraproject.org
Subject: [rpms/ntfs-3g] epel9: apply upstream fixes committed after 2022.10.3
Date: Thu, 16 Jul 2026 14:14:32 GMT [thread overview]
Message-ID: <178421127228.1.6544960111898355460.rpms-ntfs-3g-b4e92a9c09c1@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/ntfs-3g
Branch : epel9
Commit : b4e92a9c09c131f741e91c4463c1cfd6ea4c651d
Author : Tom spot Callaway <spotaws@amazon.com>
Date : 2025-06-05T14:57:37-04:00
Stats : +237/-1 in 7 file(s)
URL : https://src.fedoraproject.org/rpms/ntfs-3g/c/b4e92a9c09c131f741e91c4463c1cfd6ea4c651d?branch=epel9
Log:
apply upstream fixes committed after 2022.10.3
---
diff --git a/01b9bddc0c2165baa46abe7562550ef4e8c2752b.patch b/01b9bddc0c2165baa46abe7562550ef4e8c2752b.patch
new file mode 100644
index 0000000..3e0e075
--- /dev/null
+++ b/01b9bddc0c2165baa46abe7562550ef4e8c2752b.patch
@@ -0,0 +1,24 @@
+From 01b9bddc0c2165baa46abe7562550ef4e8c2752b Mon Sep 17 00:00:00 2001
+From: Erik Larsson <erik@tuxera.com>
+Date: Wed, 3 May 2023 09:57:34 +0200
+Subject: [PATCH] attrib.c: Fix errno not being set on NULL character in
+ attribute name.
+
+This is an error condition as we jump to err_out, but there's no errno
+value set to accompany it. Fixed by setting EIO.
+---
+ libntfs-3g/attrib.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c
+index efb91943..652a60f8 100644
+--- a/libntfs-3g/attrib.c
++++ b/libntfs-3g/attrib.c
+@@ -433,6 +433,7 @@ ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type,
+ if (ntfs_ucsnlen(name, name_len) != name_len) {
+ ntfs_log_error("Null character in attribute name"
+ " of inode %lld\n",(long long)ni->mft_no);
++ errno = EIO;
+ goto err_out;
+ }
+ name = ntfs_ucsndup(name, name_len);
diff --git a/1565b01e215c74e5c5f83f3ecde1ed682637dc5a.patch b/1565b01e215c74e5c5f83f3ecde1ed682637dc5a.patch
new file mode 100644
index 0000000..177036a
--- /dev/null
+++ b/1565b01e215c74e5c5f83f3ecde1ed682637dc5a.patch
@@ -0,0 +1,66 @@
+From 1565b01e215c74e5c5f83f3ecde1ed682637dc5a Mon Sep 17 00:00:00 2001
+From: Erik Larsson <erik@tuxera.com>
+Date: Tue, 9 May 2023 11:25:10 +0300
+Subject: [PATCH] mft.c: Fix broken free MFT records accounting during bitmap
+ extension.
+
+When the bitmap needs extending, 'vol->free_mft_records' is incremented
+by 8*8=64 records. This is due to the bitmap's initialized area being
+extended 8 bytes at a time.
+However the way 'vol->free_mft_records' is being initialized is that all
+the bits that are currently allocated to the MFT bitmap are already
+taken into account at initialization time. This leads to a value for
+'vol->free_mft_records' that is larger than the actual available number
+of MFT records.
+
+For example if there are 20 used MFT records and the bitmap has a 4096
+byte allocation where 16 bytes are initialized, the number of free MFT
+records are ((8 * 16) - 20) + (8 * (4096 - 16)) = 32748 records
+available.
+If we now expand the bitmap by 8 initialized bytes, we'd be adding 64
+MFT entries according to the logic in the function
+'ntfs_mft_bitmap_extend_initialized'.
+However we are expanding it within the bounds of the existing allocation
+where there is (4096 - 16) bytes free, so they shouldn't be added at all
+at this stage.
+
+The result is that our internal accounting is that we have 32748 + 64 =
+32812 available MFT records, but in reality we will have 32748 records
+available all the time until we expand the allocation beyond 4096 bytes.
+
+Fixed by incrementing 'vol->free_mft_records' when the allocation is
+expanded, not when the initialized size is.
+---
+ libntfs-3g/mft.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/libntfs-3g/mft.c b/libntfs-3g/mft.c
+index aefbb5f1..cd2b4157 100644
+--- a/libntfs-3g/mft.c
++++ b/libntfs-3g/mft.c
+@@ -978,7 +978,6 @@ static int ntfs_mft_bitmap_extend_initialized(ntfs_volume *vol)
+ ll = ntfs_attr_pwrite(mftbmp_na, old_initialized_size, 8, &ll);
+ if (ll == 8) {
+ ntfs_log_debug("Wrote eight initialized bytes to mft bitmap.\n");
+- vol->free_mft_records += (8 * 8);
+ ret = 0;
+ goto out;
+ }
+@@ -1776,6 +1775,7 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, ntfs_inode *base_ni)
+ (long long)mftbmp_na->initialized_size);
+ if (mftbmp_na->initialized_size + 8 > mftbmp_na->allocated_size) {
+
++ const s64 old_allocated_size = mftbmp_na->allocated_size;
+ int ret = ntfs_mft_bitmap_extend_allocation(vol);
+
+ if (ret == STATUS_ERROR)
+@@ -1792,6 +1792,9 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, ntfs_inode *base_ni)
+ (long long)mftbmp_na->allocated_size,
+ (long long)mftbmp_na->data_size,
+ (long long)mftbmp_na->initialized_size);
++
++ vol->free_mft_records +=
++ (mftbmp_na->allocated_size - old_allocated_size) << 3;
+ }
+ /*
+ * We now have sufficient allocated space, extend the initialized_size
diff --git a/233658e5a1599e40bbd8211e64bb98a12751b1ea.patch b/233658e5a1599e40bbd8211e64bb98a12751b1ea.patch
new file mode 100644
index 0000000..4a39aa6
--- /dev/null
+++ b/233658e5a1599e40bbd8211e64bb98a12751b1ea.patch
@@ -0,0 +1,22 @@
+From 233658e5a1599e40bbd8211e64bb98a12751b1ea Mon Sep 17 00:00:00 2001
+From: Erik Larsson <erik@tuxera.com>
+Date: Fri, 19 May 2023 12:20:54 +0300
+Subject: [PATCH] attrib.c: Fix another instance of errno not being set on
+ error.
+
+---
+ libntfs-3g/attrib.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c
+index 652a60f8..6bee808b 100644
+--- a/libntfs-3g/attrib.c
++++ b/libntfs-3g/attrib.c
+@@ -463,6 +463,7 @@ ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type,
+ ntfs_log_error("Null character in attribute"
+ " name in inode %lld\n",
+ (long long)ni->mft_no);
++ errno = EIO;
+ goto put_err_out;
+ }
+ name = ntfs_ucsndup(attr_name, a->name_length);
diff --git a/241ddb38605b6b298174e6f1019e8e2502a45558.patch b/241ddb38605b6b298174e6f1019e8e2502a45558.patch
new file mode 100644
index 0000000..6840e53
--- /dev/null
+++ b/241ddb38605b6b298174e6f1019e8e2502a45558.patch
@@ -0,0 +1,40 @@
+From 241ddb38605b6b298174e6f1019e8e2502a45558 Mon Sep 17 00:00:00 2001
+From: Erik Larsson <erik@tuxera.com>
+Date: Wed, 3 May 2023 10:44:57 +0200
+Subject: [PATCH] index.c: Fix crash when a reparse tag cannot be found in the
+ index.
+
+When 'remove_reparse_index', called by 'ntfs_delete_reparse_index',
+fails to look up a reparse key in the index, it leaves the
+'ntfs_index_context' without a populated 'INDEX_BLOCK *ib' field.
+
+This causes 'remove_reparse_index' to fail but the index entry is then
+marked dirty unconditionally in 'ntfs_index_entry_mark_dirty', called by
+'ntfs_delete_reparse_index', even though 'ib' may be NULL.
+
+The following 'ntfs_index_ctx_put' call then starts to write out the
+dirty 'INDEX_BLOCK', which causes a crash.
+
+Fixed by only marking the index block dirty in if it's non-NULL.
+
+Thanks to Stephen Greenham <sg@solarisfire.com> for reporting this issue
+and providing debug information.
+---
+ libntfs-3g/index.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libntfs-3g/index.c b/libntfs-3g/index.c
+index e48d6aaf..efe18d89 100644
+--- a/libntfs-3g/index.c
++++ b/libntfs-3g/index.c
+@@ -66,8 +66,9 @@ void ntfs_index_entry_mark_dirty(ntfs_index_context *ictx)
+ {
+ if (ictx->is_in_root)
+ ntfs_inode_mark_dirty(ictx->actx->ntfs_ino);
+- else
++ else if (ictx->ib != NULL) {
+ ictx->ib_dirty = TRUE;
++ }
+ }
+
+ static s64 ntfs_ib_vcn_to_pos(ntfs_index_context *icx, VCN vcn)
diff --git a/75dcdc2cf37478fad6c0e3427403d198b554951d.patch b/75dcdc2cf37478fad6c0e3427403d198b554951d.patch
new file mode 100644
index 0000000..bf26dbf
--- /dev/null
+++ b/75dcdc2cf37478fad6c0e3427403d198b554951d.patch
@@ -0,0 +1,34 @@
+From 75dcdc2cf37478fad6c0e3427403d198b554951d Mon Sep 17 00:00:00 2001
+From: Erik Larsson <erik@tuxera.com>
+Date: Tue, 13 Jun 2023 17:47:15 +0300
+Subject: [PATCH] unistr.c: Fix use-after-free in 'ntfs_uppercase_mbs'.
+
+If 'utf8_to_unicode' throws an error due to an invalid UTF-8 sequence,
+then 'n' will be less than 0 and the loop will terminate without storing
+anything in '*t'. After the loop the uppercase string's allocation is
+freed, however after it is freed it is unconditionally accessed through
+'*t', which points into the freed allocation, for the purpose of NULL-
+terminating the string. This leads to a use-after-free.
+Fixed by only NULL-terminating the string when no error has been thrown.
+
+Thanks for Jeffrey Bencteux for reporting this issue:
+https://github.com/tuxera/ntfs-3g/issues/84
+---
+ libntfs-3g/unistr.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libntfs-3g/unistr.c b/libntfs-3g/unistr.c
+index 5854b3b7..db8ddf42 100644
+--- a/libntfs-3g/unistr.c
++++ b/libntfs-3g/unistr.c
+@@ -1189,8 +1189,9 @@ char *ntfs_uppercase_mbs(const char *low,
+ free(upp);
+ upp = (char*)NULL;
+ errno = EILSEQ;
++ } else {
++ *t = 0;
+ }
+- *t = 0;
+ }
+ return (upp);
+ }
diff --git a/e73d481a76a5814076ff78a1c3a70e9b7da7c0e9.patch b/e73d481a76a5814076ff78a1c3a70e9b7da7c0e9.patch
new file mode 100644
index 0000000..410a24a
--- /dev/null
+++ b/e73d481a76a5814076ff78a1c3a70e9b7da7c0e9.patch
@@ -0,0 +1,39 @@
+From e73d481a76a5814076ff78a1c3a70e9b7da7c0e9 Mon Sep 17 00:00:00 2001
+From: Erik Larsson <erik@tuxera.com>
+Date: Mon, 12 Dec 2022 18:51:12 +0200
+Subject: [PATCH] mkntfs.c: Enable microsecond-precision volume creation time.
+
+Previously the creation time was filled in with seconds (obtained using
+time(NULL)) but the microsecond part was left zeroed. Fixed by using
+gettimeofday when available.
+---
+ ntfsprogs/mkntfs.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/ntfsprogs/mkntfs.c b/ntfsprogs/mkntfs.c
+index 3e127a3d..5c3a367b 100644
+--- a/ntfsprogs/mkntfs.c
++++ b/ntfsprogs/mkntfs.c
+@@ -776,8 +776,20 @@ static ntfs_time mkntfs_time(void)
+
+ ts.tv_sec = 0;
+ ts.tv_nsec = 0;
+- if (!opts.use_epoch_time)
+- ts.tv_sec = time(NULL);
++ if (!opts.use_epoch_time) {
++#ifdef HAVE_GETTIMEOFDAY
++ struct timeval tv = { 0, 0, };
++
++ if (!gettimeofday(&tv, NULL)) {
++ ts.tv_sec = tv.tv_sec;
++ ts.tv_nsec = tv.tv_usec * 1000L;
++ }
++ else
++#endif
++ {
++ ts.tv_sec = time(NULL);
++ }
++ }
+ return timespec2ntfs(ts);
+ }
+
diff --git a/ntfs-3g.spec b/ntfs-3g.spec
index 1a34089..8424c0c 100644
--- a/ntfs-3g.spec
+++ b/ntfs-3g.spec
@@ -8,13 +8,21 @@
Name: ntfs-3g
Epoch: 2
Version: 2022.10.3
-Release: 8%{?dist}
+Release: 9%{?dist}
Summary: Linux NTFS userspace driver
# Automatically converted from old format: GPLv2+ - review is highly recommended.
License: GPL-2.0-or-later
URL: https://www.tuxera.com/company/open-source/
Source0: http://tuxera.com/opensource/%{name}_ntfsprogs-%{version}%{?subver}.tgz
Patch0: ntfs-3g_ntfsprogs-2011.10.9-RC-ntfsck-unsupported-return-0.patch
+# Upstream seems mostly gone, but there are some patches merged after 2022.10.3
+Patch1: https://github.com/tuxera/ntfs-3g/commit/e73d481a76a5814076ff78a1c3a70e9b7da7c0e9.patch
+Patch2: https://github.com/tuxera/ntfs-3g/commit/01b9bddc0c2165baa46abe7562550ef4e8c2752b.patch
+Patch3: https://github.com/tuxera/ntfs-3g/commit/241ddb38605b6b298174e6f1019e8e2502a45558.patch
+Patch4: https://github.com/tuxera/ntfs-3g/commit/1565b01e215c74e5c5f83f3ecde1ed682637dc5a.patch
+Patch5: https://github.com/tuxera/ntfs-3g/commit/233658e5a1599e40bbd8211e64bb98a12751b1ea.patch
+Patch6: https://github.com/tuxera/ntfs-3g/commit/75dcdc2cf37478fad6c0e3427403d198b554951d.patch
+
BuildRequires: make
# ntfs-3g BuildRequires
BuildRequires: gnutls-devel
@@ -192,6 +200,9 @@ rm -rf %{buildroot}%{_defaultdocdir}/%{name}/README
%exclude %{_mandir}/man8/ntfs-3g*
%changelog
+* Thu Jun 5 2025 Tom Callaway <spot@fedoraproject.org> - 2:2022.10.3-9
+- apply upstream fixes committed after 2022.10.3
+
* Fri Jan 17 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2:2022.10.3-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
reply other threads:[~2026-07-16 14:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178421127228.1.6544960111898355460.rpms-ntfs-3g-b4e92a9c09c1@fedoraproject.org \
--to=spotaws@amazon.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox