<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/exfat, branch v7.2-rc1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-06-15T11:01:04+00:00</updated>
<entry>
<title>exfat: bound uniname advance in exfat_find_dir_entry()</title>
<updated>2026-06-15T11:01:04+00:00</updated>
<author>
<name>Bryam Vargas</name>
<email>hexlabsecurity@proton.me</email>
</author>
<published>2026-06-12T19:29:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3a1230e7b043c62737b05a3e9275ca83a43ad20a'/>
<id>urn:sha1:3a1230e7b043c62737b05a3e9275ca83a43ad20a</id>
<content type='text'>
In exfat_find_dir_entry(), each TYPE_EXTEND (file name) entry advances the
output pointer by a fixed amount while the loop guard only tracks the
accumulated name length:

	if (++order == 2)
		uniname = p_uniname-&gt;name;
	else
		uniname += EXFAT_FILE_NAME_LEN;
	len = exfat_extract_uni_name(ep, entry_uniname);
	name_len += len;
	unichar = *(uniname+len);
	*(uniname+len) = 0x0;

uniname grows by EXFAT_FILE_NAME_LEN (15) per name entry, but name_len
grows only by the actual extracted length, which is shorter when a name
fragment contains an early NUL.  The only guard is
`name_len &gt;= MAX_NAME_LENGTH`, so a crafted directory with many short
name fragments lets uniname run far past the
p_uniname-&gt;name[MAX_NAME_LENGTH + 3] buffer while name_len stays small,
causing an out-of-bounds read and write at *(uniname+len).

The sibling extractor exfat_get_uniname_from_ext_entry() already stops
on a short fragment (the lockstep `len != EXFAT_FILE_NAME_LEN` guard
added in commit d42334578eba ("exfat: check if filename entries exceeds
max filename length")); exfat_find_dir_entry() never got the
equivalent.  Track the per-entry write offset as a count and reject a
fragment once the offset, or the offset plus the extracted length, would
exceed MAX_NAME_LENGTH, before forming the output pointer.

Fixes: ca06197382bd ("exfat: add directory operations")
Cc: stable@vger.kernel.org
Suggested-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Bryam Vargas &lt;hexlabsecurity@proton.me&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: add swap_activate support</title>
<updated>2026-06-15T11:01:00+00:00</updated>
<author>
<name>Jan Polensky</name>
<email>japo@linux.ibm.com</email>
</author>
<published>2026-06-09T09:21:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=03a43677ca91e3997355a13b1da6e47329b025e1'/>
<id>urn:sha1:03a43677ca91e3997355a13b1da6e47329b025e1</id>
<content type='text'>
Commit 07d67f3e9083 ("exfat: add iomap buffered I/O support")
converted exfat buffered I/O to iomap, but did not add a
.swap_activate handler to the address_space_operations.

swapon(2) on an exfat swapfile then fails with EINVAL, which causes
LTP swap tests to fail.

Add exfat_iomap_swap_activate() and hook it into exfat_aops so exfat
uses iomap_swapfile_activate() for swapfile activation.

Fixes: 614f71ca1bdf ("exfat: add iomap buffered I/O support")
Closes: https://lore.kernel.org/all/20260603110212.3020276-1-japo@linux.ibm.com/
Signed-off-by: Jan Polensky &lt;japo@linux.ibm.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: preserve benign secondary entries during rename and move</title>
<updated>2026-06-15T11:00:53+00:00</updated>
<author>
<name>Rochan Avlur</name>
<email>rochan.avlur@gmail.com</email>
</author>
<published>2026-05-28T14:21:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=942296784b2a9439651750c42f540bf2579b330f'/>
<id>urn:sha1:942296784b2a9439651750c42f540bf2579b330f</id>
<content type='text'>
Commit 8258ef28001a ("exfat: handle unreconized benign secondary
entries") added cluster freeing for benign secondary entries inside
exfat_remove_entries().  However, exfat_remove_entries() is also called
from the rename and move paths (exfat_rename_file and exfat_move_file),
where the old entry set is being relocated rather than deleted.  This
causes benign secondary entries such as vendor extension entries to be
silently destroyed on rename or cross-directory move, violating the
exFAT spec requirement (section 8.2) that implementations preserve
unrecognized benign secondary entries.

Fix this by adding a free_benign parameter to exfat_remove_entries()
so callers can suppress cluster freeing during relocation, and
extending exfat_init_ext_entry() to copy trailing benign secondary
entries from the old entry set into the new one internally.  Also
clean up the error paths to delete newly allocated entries on failure.

Fixes: 8258ef28001a ("exfat: handle unreconized benign secondary entries")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/linux-fsdevel/CAG7tbBV--waov7XVu2FHQEc6paR92dufS=em9DW5Kzsrpu3iQg@mail.gmail.com/
Signed-off-by: Rochan Avlur &lt;rochan.avlur@gmail.com&gt;
Reviewed-by: Yuezhang Mo &lt;Yuezhang.Mo@sony.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: serialize truncate against in-flight DIO</title>
<updated>2026-06-15T11:00:49+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@kernel.org</email>
</author>
<published>2026-05-22T01:00:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c7034e0bcb087754317d058b1149bb53e0a13213'/>
<id>urn:sha1:c7034e0bcb087754317d058b1149bb53e0a13213</id>
<content type='text'>
exfat_setattr() did not call inode_dio_wait() before performing a size
change, leaving a window where a concurrent in-flight DIO write could be
operating on clusters that the truncate is about to free.

Add inode_dio_wait() before the truncate_setsize()/exfat_truncate()
sequence so that any in-flight DIO completes before cluster freeing
begins.

Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: add support for SEEK_HOLE and SEEK_DATA in llseek</title>
<updated>2026-06-15T11:00:44+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@kernel.org</email>
</author>
<published>2026-05-23T04:59:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b4b7fe2c7cbf519ab5e7edc6625c71608805fb1d'/>
<id>urn:sha1:b4b7fe2c7cbf519ab5e7edc6625c71608805fb1d</id>
<content type='text'>
Adds exfat_file_llseek() that implements these whence values via
the iomap layer (iomap_seek_hole() and iomap_seek_data()) using the
existing exfat_read_iomap_ops.
Unlike many other modern filesystems, exFAT does not support sparse files
with unallocated clusters (holes). In exFAT, clusters are always fully
allocated once they are written or preallocated. In addition, exFAT
maintains a separate "Valid Data Length" (valid_size) that is distinct
from the logical file size. This affects how holes are reported during
seeking. In exfat_iomap_begin(), ranges where the offset is greater
than or equal to ei-&gt;valid_size are mapped as IOMAP_UNWRITTEN, while ranges
below valid_size are mapped as IOMAP_MAPPED. This mapping behavior is used
by the iomap seek functions to correctly report SEEK_HOLE and SEEK_DATA
positions.

   - Ranges with offset &gt;= ei-&gt;valid_size are mapped as IOMAP_HOLE.
   - Ranges with offset &lt; ei-&gt;valid_size are mapped as IOMAP_MAPPED.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: "Darrick J. Wong" &lt;djwong@kernel.org&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: add iomap direct I/O support</title>
<updated>2026-06-15T11:00:40+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@kernel.org</email>
</author>
<published>2026-05-23T04:56:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=867b9c96dc837e09ef125a79dc151fa2fc7a5d32'/>
<id>urn:sha1:867b9c96dc837e09ef125a79dc151fa2fc7a5d32</id>
<content type='text'>
Add iomap-based direct I/O support to the exfat filesystem. This replaces
the previous exfat_direct_IO() implementation that used
blockdev_direct_IO() with iomap_dio_rw() interface.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: "Darrick J. Wong" &lt;djwong@kernel.org&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: add iomap buffered I/O support</title>
<updated>2026-06-15T11:00:23+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@kernel.org</email>
</author>
<published>2026-06-15T10:59:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=82a81a7352bcf5f2756ac33d47ee0582737e9a85'/>
<id>urn:sha1:82a81a7352bcf5f2756ac33d47ee0582737e9a85</id>
<content type='text'>
Add full buffered I/O support using the iomap framework to the exfat
filesystem. This will replaces the old exfat_get_block(),
exfat_write_begin(), exfat_write_end(), and exfat_block_truncate_page()
with their iomap equivalents. Buffered writes now use
iomap_file_buffered_write(), read uses iomap_bio_read_folio() and
iomap_bio_readahead(), and writeback is handled through iomap_writepages().

Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: "Darrick J. Wong" &lt;djwong@kernel.org&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: fix implicit declaration of brelse()</title>
<updated>2026-06-15T10:55:52+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@kernel.org</email>
</author>
<published>2026-05-13T01:44:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f0d1b2e1e02c11e29c953f22a485449e3da2a575'/>
<id>urn:sha1:f0d1b2e1e02c11e29c953f22a485449e3da2a575</id>
<content type='text'>
exfat_cluster_walk() calls brelse(bh) without including the header that
declares the function, causing the following build error:

    fs/exfat/exfat_fs.h:542:9: error: implicit declaration of function ‘brelse’ [-Werror=implicit-function-declaration]

Fix this by adding the missing buffer_head.h in exfat_fs.h.

Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: "Darrick J. Wong" &lt;djwong@kernel.org&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: add data_start_bytes and exfat_cluster_to_phys_bytes() helper</title>
<updated>2026-06-15T10:55:47+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@kernel.org</email>
</author>
<published>2026-05-06T01:52:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3b9450beeb961c7ddf4cccddba37fcfa6d1fcb7a'/>
<id>urn:sha1:3b9450beeb961c7ddf4cccddba37fcfa6d1fcb7a</id>
<content type='text'>
This caches the data area start offset in bytes (data_start_bytes)
and introduces a helper function exfat_cluster_to_phys_bytes() to compute
the physical byte position of a given cluster.

Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: "Darrick J. Wong" &lt;djwong@kernel.org&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
<entry>
<title>exfat: add support for multi-cluster allocation</title>
<updated>2026-06-15T10:55:42+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@kernel.org</email>
</author>
<published>2026-05-07T00:05:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=286ae368871d2a93b68148c7684b8cff63c9ba80'/>
<id>urn:sha1:286ae368871d2a93b68148c7684b8cff63c9ba80</id>
<content type='text'>
Currently exfat_map_cluster() allocates and returns only one cluster
at a time even when more clusters are needed. This causes multiple
FAT walks and repeated allocation calls during large sequential writes
or when using iomap for writes. This change exfat_map_cluster() and
exfat_alloc_cluster() to be able to allocate multiple contiguous
clusters.

Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: "Darrick J. Wong" &lt;djwong@kernel.org&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
</entry>
</feed>
