<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs/ntfs, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge tag 'ntfs-for-7.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs</title>
<updated>2026-11-14T16:27:30+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-11-14T16:27:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=68271fbe7d14b6397e90df730c3967d3a481902b'/>
<id>68271fbe7d14b6397e90df730c3967d3a481902b</id>
<content type='text'>
Pull ntfs fixes from Namjae Jeon:

 - Validate that $INDEX_ALLOCATION is open and non-resident before
   reading or writing index blocks, preventing NULL pointer dereferences
   when an earlier index operation has not opened it

 - Check that index allocation inodes are non-resident and child VCNs
   are non-negative and within bounds before directory lookup reads,
   preventing a deadlock when $INDEX_ALLOCATION is missing or damaged

 - Validate file names against the index entry's key length, preventing
   out-of-bounds reads when directory enumeration resumes using a copied
   key

 - Return -ENOENT for NTFS_IOC_LIST_STREAMS on deleted base files and
   fix unsigned underflow in its buffer bounds check, preventing
   out-of-bounds writes when the sizing and filling passes disagree

 - Use kfree() for the temporary runlist allocated with kmalloc() on
   merge failure, resolving the Coccinelle allocation/free mismatch
   warning

* tag 'ntfs-for-7.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs:
  ntfs: open the index allocation before reading or writing an index block
  ntfs: do not read an index block outside $INDEX_ALLOCATION
  ntfs: silence kmalloc/kvfree mismatch warning
  ntfs: check the file name against the key length of an index entry
  ntfs: fix out-of-bounds write race in NTFS_IOC_LIST_STREAMS
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull ntfs fixes from Namjae Jeon:

 - Validate that $INDEX_ALLOCATION is open and non-resident before
   reading or writing index blocks, preventing NULL pointer dereferences
   when an earlier index operation has not opened it

 - Check that index allocation inodes are non-resident and child VCNs
   are non-negative and within bounds before directory lookup reads,
   preventing a deadlock when $INDEX_ALLOCATION is missing or damaged

 - Validate file names against the index entry's key length, preventing
   out-of-bounds reads when directory enumeration resumes using a copied
   key

 - Return -ENOENT for NTFS_IOC_LIST_STREAMS on deleted base files and
   fix unsigned underflow in its buffer bounds check, preventing
   out-of-bounds writes when the sizing and filling passes disagree

 - Use kfree() for the temporary runlist allocated with kmalloc() on
   merge failure, resolving the Coccinelle allocation/free mismatch
   warning

* tag 'ntfs-for-7.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs:
  ntfs: open the index allocation before reading or writing an index block
  ntfs: do not read an index block outside $INDEX_ALLOCATION
  ntfs: silence kmalloc/kvfree mismatch warning
  ntfs: check the file name against the key length of an index entry
  ntfs: fix out-of-bounds write race in NTFS_IOC_LIST_STREAMS
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'vfs-7.4-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs</title>
<updated>2026-11-10T15:25:09+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-11-10T15:25:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5f5be6584cf5af0d70ee2fd40aa6264da18617ec'/>
<id>5f5be6584cf5af0d70ee2fd40aa6264da18617ec</id>
<content type='text'>
Pull vfs fixes from Christian Brauner:

 - libfs: Make readdir on tmpfs walk the offset tree in offset order
   instead of d_children to avoid skipping entries or relisting the
   whole directory

   It's faster too. Listing a million entries takes 114ms instead of
   146ms, and 113ms instead of 470ms with four processes listing in
   parallel

 - iomap: Finish the -&gt;iomap_next() conversion that started in v7.3

   The nilfs2 and fuse ext_map iomap code added this merge window is
   converted so now we can remove the -&gt;iomap_begin()/-&gt;iomap_end()
   fallback. We waited until the new iomap users from other trees were
   in mainline otherwise this would have been very messy

 - errseq: Retry with the current value when the cmpxchg() in
   errseq_check_and_advance() fails to avoid an old value coming back
   later hiding the errors

 - aio: Hold an extra count for exit_aio() itself so it can't return
   before the last free_ioctx_reqs() callback has called complete()

 - pidfd: Fail the namespace ioctls with EREMOTE unless the target is
   visible in the caller's pid namespace like PIDFD_GET_INFO does

 - eventpoll: Wake the next waiter when a woken waiter returns early
   because of a fatal signal to avoid sleeping forever

 - backing-file: Pass RWF_NOAPPEND on to synchronous writes to the
   backing file

 - initrd: Flush the deferred fput() of the ramdisk file before mounting
   root

 - iov_iter: Take an unsigned long segment count in import_iovec()

   The upper 32 bits of the count passed to readv(), writev() and
   friends were dropped before the UIO_MAXIOV check

 - splice: Advance the pipe tail before checking for a full bvec array
   in splice_to_socket(). The last buffer was counted again, so MSG_MORE
   was set although the pipe was empty and small TCP transfers waited
   for the cork timeout

 - vfs:

     - Reject negative offsets for SEEK_DATA and SEEK_HOLE in
       default_llseek() and use must_set_pos() for its whence handling

     - Only clear tv_nsec in timestamp_truncate() when clamping changed
       the seconds. Timestamps whose seconds were exactly at a
       filesystem time limit lost their subsecond part

     - Don't leak the kernel-internal STATX_ATTR_CHANGE_MONOTONIC in
       stx_attributes_mask

     - Clamp the FIONREAD result to the int range so a file with 4 GiB
       left isn't reported as empty

     - Fix the SEEK_CUR f_lock check

 - selftests: Fix the statmount and mount_setattr tests on 32-bit and
   s390, build the fchmodat2 and openat2 tests without sanitizers when
   the toolchain lacks the runtimes and fix a clang warning in the
   mount-notify test

 - docs: Fix a docutils warning in porting.rst

* tag 'vfs-7.4-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (28 commits)
  fs: fix the SEEK_CUR f_lock condition
  splice, net: avoid MSG_MORE when the bvec array fills
  aio: don't let exit_aio() return before complete() is done
  fs: porting.rst: use literal string to avoid warning
  selftests/fs/mount-notify: fix the indentation in the fsmount test
  selftests: probe for sanitizer support in fchmodat2 and openat2
  selftests/mount_setattr: build with a 64-bit off_t
  selftests/statmount: fix format warnings on 32-bit and s390
  fs: use must_set_pos() in default_llseek()
  fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek()
  pidfd: restrict task access ioctls to the caller's pid namespace
  fs: clamp FIONREAD result to int range
  eventpoll: wake the next waiter when a woken waiter is killed
  statx: don't leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask
  vfs: preserve subsecond timestamps at filesystem time limits
  iov_iter: take an unsigned long segment count in import_iovec()
  lib/tests: errseq: add a concurrent check_and_advance test
  errseq: don't let errseq_check_and_advance() hide later errors
  backing-file: pass RWF_NOAPPEND to synchronous writes
  initrd: flush deferred fput() before mounting root
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull vfs fixes from Christian Brauner:

 - libfs: Make readdir on tmpfs walk the offset tree in offset order
   instead of d_children to avoid skipping entries or relisting the
   whole directory

   It's faster too. Listing a million entries takes 114ms instead of
   146ms, and 113ms instead of 470ms with four processes listing in
   parallel

 - iomap: Finish the -&gt;iomap_next() conversion that started in v7.3

   The nilfs2 and fuse ext_map iomap code added this merge window is
   converted so now we can remove the -&gt;iomap_begin()/-&gt;iomap_end()
   fallback. We waited until the new iomap users from other trees were
   in mainline otherwise this would have been very messy

 - errseq: Retry with the current value when the cmpxchg() in
   errseq_check_and_advance() fails to avoid an old value coming back
   later hiding the errors

 - aio: Hold an extra count for exit_aio() itself so it can't return
   before the last free_ioctx_reqs() callback has called complete()

 - pidfd: Fail the namespace ioctls with EREMOTE unless the target is
   visible in the caller's pid namespace like PIDFD_GET_INFO does

 - eventpoll: Wake the next waiter when a woken waiter returns early
   because of a fatal signal to avoid sleeping forever

 - backing-file: Pass RWF_NOAPPEND on to synchronous writes to the
   backing file

 - initrd: Flush the deferred fput() of the ramdisk file before mounting
   root

 - iov_iter: Take an unsigned long segment count in import_iovec()

   The upper 32 bits of the count passed to readv(), writev() and
   friends were dropped before the UIO_MAXIOV check

 - splice: Advance the pipe tail before checking for a full bvec array
   in splice_to_socket(). The last buffer was counted again, so MSG_MORE
   was set although the pipe was empty and small TCP transfers waited
   for the cork timeout

 - vfs:

     - Reject negative offsets for SEEK_DATA and SEEK_HOLE in
       default_llseek() and use must_set_pos() for its whence handling

     - Only clear tv_nsec in timestamp_truncate() when clamping changed
       the seconds. Timestamps whose seconds were exactly at a
       filesystem time limit lost their subsecond part

     - Don't leak the kernel-internal STATX_ATTR_CHANGE_MONOTONIC in
       stx_attributes_mask

     - Clamp the FIONREAD result to the int range so a file with 4 GiB
       left isn't reported as empty

     - Fix the SEEK_CUR f_lock check

 - selftests: Fix the statmount and mount_setattr tests on 32-bit and
   s390, build the fchmodat2 and openat2 tests without sanitizers when
   the toolchain lacks the runtimes and fix a clang warning in the
   mount-notify test

 - docs: Fix a docutils warning in porting.rst

* tag 'vfs-7.4-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (28 commits)
  fs: fix the SEEK_CUR f_lock condition
  splice, net: avoid MSG_MORE when the bvec array fills
  aio: don't let exit_aio() return before complete() is done
  fs: porting.rst: use literal string to avoid warning
  selftests/fs/mount-notify: fix the indentation in the fsmount test
  selftests: probe for sanitizer support in fchmodat2 and openat2
  selftests/mount_setattr: build with a 64-bit off_t
  selftests/statmount: fix format warnings on 32-bit and s390
  fs: use must_set_pos() in default_llseek()
  fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek()
  pidfd: restrict task access ioctls to the caller's pid namespace
  fs: clamp FIONREAD result to int range
  eventpoll: wake the next waiter when a woken waiter is killed
  statx: don't leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask
  vfs: preserve subsecond timestamps at filesystem time limits
  iov_iter: take an unsigned long segment count in import_iovec()
  lib/tests: errseq: add a concurrent check_and_advance test
  errseq: don't let errseq_check_and_advance() hide later errors
  backing-file: pass RWF_NOAPPEND to synchronous writes
  initrd: flush deferred fput() before mounting root
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'devm_kmalloc_obj-v7.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux</title>
<updated>2026-11-08T22:55:54+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-11-08T22:55:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e0d8e8de8bcb1ef7b749033b5af5518ba8df7bec'/>
<id>e0d8e8de8bcb1ef7b749033b5af5518ba8df7bec</id>
<content type='text'>
Pull devm_kmalloc_obj conversion from Kees Cook:

 - treewide refresh of kmalloc_obj() conversions

 - devm_kmalloc_obj conversion rules added to Coccinelle scripting

 - treewide conversion of devm_kmalloc() family to devm_kmalloc_obj()

* tag 'devm_kmalloc_obj-v7.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family
  coccinelle: kmalloc_obj: Include devm_kmalloc_obj conversion rules
  treewide: refresh kmalloc_obj() conversions
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull devm_kmalloc_obj conversion from Kees Cook:

 - treewide refresh of kmalloc_obj() conversions

 - devm_kmalloc_obj conversion rules added to Coccinelle scripting

 - treewide conversion of devm_kmalloc() family to devm_kmalloc_obj()

* tag 'devm_kmalloc_obj-v7.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family
  coccinelle: kmalloc_obj: Include devm_kmalloc_obj conversion rules
  treewide: refresh kmalloc_obj() conversions
</pre>
</div>
</content>
</entry>
<entry>
<title>ntfs: open the index allocation before reading or writing an index block</title>
<updated>2026-11-08T03:43:07+00:00</updated>
<author>
<name>Wahid Khan</name>
<email>wahidzk0091@gmail.com</email>
</author>
<published>2026-11-06T12:45:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bada7bbb11aaa6feba8904cf38ff833453f5b5d9'/>
<id>bada7bbb11aaa6feba8904cf38ff833453f5b5d9</id>
<content type='text'>
ntfs_ib_write() and ntfs_ib_read() use icx-&gt;ia_ni without checking it.
ntfs_ir_reparent() only opens the index allocation through
ntfs_ia_add() when the root is a small index. For a root that is already
marked as a large index it calls ntfs_ib_write() directly.

The lookup does not open the index allocation either when it ends in the
root. If the last entry of the root has no child node, ia_ni is still
NULL when the root has to be moved into an index block, and the write
dereferences it:

  Oops: general protection fault, KASAN: null-ptr-deref in range
        [0x0000000000000128-0x000000000000012f]
  RIP: 0010:ntfs_inode_attr_pwrite+0x52/0x1600
   ntfs_ir_make_space
   ntfs_ie_add
   ntfs_index_add_filename
   __ntfs_link
   ntfs_link
   vfs_link

A single byte of an image from mkntfs is enough. In a directory that has
one empty index block, clear INDEX_ENTRY_NODE (flags 3 -&gt; 2) of the last
entry of the $INDEX_ROOT and link() a file into the directory.

Commit 9365c4a1357e ("ntfs: fix NULL dereference on index allocation open failure")
covers the case where ntfs_ia_open() fails in the lookup. Here it was
never tried. Open the index allocation on demand in both
helpers and fail with -EIO if that does not work.

ntfs_ia_open() also succeeds for a directory that has no
$INDEX_ALLOCATION attribute. The inode it returns is then an empty resident
stub that does not describe an index allocation, so reject that case too.

Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Wahid Khan &lt;wahidzk0091@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ntfs_ib_write() and ntfs_ib_read() use icx-&gt;ia_ni without checking it.
ntfs_ir_reparent() only opens the index allocation through
ntfs_ia_add() when the root is a small index. For a root that is already
marked as a large index it calls ntfs_ib_write() directly.

The lookup does not open the index allocation either when it ends in the
root. If the last entry of the root has no child node, ia_ni is still
NULL when the root has to be moved into an index block, and the write
dereferences it:

  Oops: general protection fault, KASAN: null-ptr-deref in range
        [0x0000000000000128-0x000000000000012f]
  RIP: 0010:ntfs_inode_attr_pwrite+0x52/0x1600
   ntfs_ir_make_space
   ntfs_ie_add
   ntfs_index_add_filename
   __ntfs_link
   ntfs_link
   vfs_link

A single byte of an image from mkntfs is enough. In a directory that has
one empty index block, clear INDEX_ENTRY_NODE (flags 3 -&gt; 2) of the last
entry of the $INDEX_ROOT and link() a file into the directory.

Commit 9365c4a1357e ("ntfs: fix NULL dereference on index allocation open failure")
covers the case where ntfs_ia_open() fails in the lookup. Here it was
never tried. Open the index allocation on demand in both
helpers and fail with -EIO if that does not work.

ntfs_ia_open() also succeeds for a directory that has no
$INDEX_ALLOCATION attribute. The inode it returns is then an empty resident
stub that does not describe an index allocation, so reject that case too.

Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Wahid Khan &lt;wahidzk0091@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ntfs: do not read an index block outside $INDEX_ALLOCATION</title>
<updated>2026-11-08T03:43:06+00:00</updated>
<author>
<name>Wahid Khan</name>
<email>wahidzk0091@gmail.com</email>
</author>
<published>2026-11-06T12:45:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0ea30dd6eeabc09235d5c2cdb98ca4e0d593963f'/>
<id>0ea30dd6eeabc09235d5c2cdb98ca4e0d593963f</id>
<content type='text'>
A directory whose $INDEX_ROOT has a child node but whose
$INDEX_ALLOCATION is missing or damaged gets an empty index inode from
ntfs_read_locked_index_inode(): size 0 and not non-resident.
ntfs_lookup_inode_by_name() still follows the child node and reads a
folio from that inode while it holds the mft record lock of the
directory.

Since the resident iomap read started to take base_ni-&gt;mrec_lock, that
read waits for a lock the caller already holds:

  INFO: task init:1 is blocked on a mutex likely owned by task init:1.
   __mutex_lock
   __ntfs_read_iomap_begin
   ntfs_read_iomap_next
   iomap_read_folio
   ntfs_read_folio
   ntfs_lookup_inode_by_name
   ntfs_lookup

The task never returns, and neither does anything else that needs the
directory's mft record.

It takes one corrupted byte on an image from mkntfs: change the first
byte of the type of the $INDEX_ALLOCATION attribute header of a
directory with index blocks from 0xa0 to 0x00. The first lookup in that
directory hangs.

Check that the index inode is non-resident and that the vcn lies inside
it before every index block read, and fail with -EIO otherwise. This
also rejects a negative vcn, which was only checked on later descents.

Fixes: d9e00c457d4a ("ntfs: serialize resident iomap reads with mrec_lock")
Cc: stable@vger.kernel.org # v7.3+
Signed-off-by: Wahid Khan &lt;wahidzk0091@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A directory whose $INDEX_ROOT has a child node but whose
$INDEX_ALLOCATION is missing or damaged gets an empty index inode from
ntfs_read_locked_index_inode(): size 0 and not non-resident.
ntfs_lookup_inode_by_name() still follows the child node and reads a
folio from that inode while it holds the mft record lock of the
directory.

Since the resident iomap read started to take base_ni-&gt;mrec_lock, that
read waits for a lock the caller already holds:

  INFO: task init:1 is blocked on a mutex likely owned by task init:1.
   __mutex_lock
   __ntfs_read_iomap_begin
   ntfs_read_iomap_next
   iomap_read_folio
   ntfs_read_folio
   ntfs_lookup_inode_by_name
   ntfs_lookup

The task never returns, and neither does anything else that needs the
directory's mft record.

It takes one corrupted byte on an image from mkntfs: change the first
byte of the type of the $INDEX_ALLOCATION attribute header of a
directory with index blocks from 0xa0 to 0x00. The first lookup in that
directory hangs.

Check that the index inode is non-resident and that the vcn lies inside
it before every index block read, and fail with -EIO otherwise. This
also rejects a negative vcn, which was only checked on later descents.

Fixes: d9e00c457d4a ("ntfs: serialize resident iomap reads with mrec_lock")
Cc: stable@vger.kernel.org # v7.3+
Signed-off-by: Wahid Khan &lt;wahidzk0091@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ntfs: silence kmalloc/kvfree mismatch warning</title>
<updated>2026-11-08T03:43:06+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@kernel.org</email>
</author>
<published>2026-11-06T12:46:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ce5cdda498a9479b32ba1c7d68b1d97f3c840354'/>
<id>ce5cdda498a9479b32ba1c7d68b1d97f3c840354</id>
<content type='text'>
The temporary runlist is allocated with kmalloc(). Free it with kfree()
on merge failure to silence the Coccinelle warning.

Fixes: b041ca562526 ("ntfs: update iomap and address space operations")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/r/202611060717.0Na5FqQR-lkp@intel.com/
Reported-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The temporary runlist is allocated with kmalloc(). Free it with kfree()
on merge failure to silence the Coccinelle warning.

Fixes: b041ca562526 ("ntfs: update iomap and address space operations")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/r/202611060717.0Na5FqQR-lkp@intel.com/
Reported-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ntfs: check the file name against the key length of an index entry</title>
<updated>2026-11-08T03:43:06+00:00</updated>
<author>
<name>Wahid Khan</name>
<email>wahidzk0091@gmail.com</email>
</author>
<published>2026-11-06T11:27:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5e7143476219eac7cab7bdd341db68dab1649737'/>
<id>5e7143476219eac7cab7bdd341db68dab1649737</id>
<content type='text'>
ntfs_index_entry_inconsistent() checks that the file name of a
$FILE_NAME key fits in the index entry. It does not check that the name
fits in the key, which is what key_length describes. Code that works on
the key alone relies on that.

ntfs_readdir() copies key_length bytes of the key of the next entry to
resume the enumeration, and later uses the copy to search the index. If
file_name_length is larger than the key holds, the name comparison reads
past the copy:

  BUG: KASAN: slab-out-of-bounds in ntfs_file_compare_values+0x2d1/0x4b0
  Read of size 2 at addr ffff88800a4ef2ce by task init/1
   ntfs_file_compare_values
   ntfs_collate
   ntfs_ie_lookup
   ntfs_index_lookup
   ntfs_readdir
   iterate_dir
  Allocated by task 1:
   kmemdup_noprof
   ntfs_readdir
  The buggy address is located 0 bytes to the right of
  allocated 78-byte region

Two bytes of an image from mkntfs are enough: in an entry whose name has
six characters (key_length 78), change file_name_length from 6 to 7, so
the key claims 80 bytes. The entry itself is 96 bytes, so the existing
check lets it pass. The next readdir of the directory reads the extra
bytes.

Check the name against key_length, and check that the key is large
enough to hold file_name_length in the first place.

Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Wahid Khan &lt;wahidzk0091@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ntfs_index_entry_inconsistent() checks that the file name of a
$FILE_NAME key fits in the index entry. It does not check that the name
fits in the key, which is what key_length describes. Code that works on
the key alone relies on that.

ntfs_readdir() copies key_length bytes of the key of the next entry to
resume the enumeration, and later uses the copy to search the index. If
file_name_length is larger than the key holds, the name comparison reads
past the copy:

  BUG: KASAN: slab-out-of-bounds in ntfs_file_compare_values+0x2d1/0x4b0
  Read of size 2 at addr ffff88800a4ef2ce by task init/1
   ntfs_file_compare_values
   ntfs_collate
   ntfs_ie_lookup
   ntfs_index_lookup
   ntfs_readdir
   iterate_dir
  Allocated by task 1:
   kmemdup_noprof
   ntfs_readdir
  The buggy address is located 0 bytes to the right of
  allocated 78-byte region

Two bytes of an image from mkntfs are enough: in an entry whose name has
six characters (key_length 78), change file_name_length from 6 to 7, so
the key claims 80 bytes. The entry itself is 96 bytes, so the existing
check lets it pass. The next readdir of the directory reads the extra
bytes.

Check the name against key_length, and check that the key is large
enough to hold file_name_length in the first place.

Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Wahid Khan &lt;wahidzk0091@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ntfs: fix out-of-bounds write race in NTFS_IOC_LIST_STREAMS</title>
<updated>2026-11-08T03:43:06+00:00</updated>
<author>
<name>Xingyuan Mo</name>
<email>hdthky0@gmail.com</email>
</author>
<published>2026-11-05T07:34:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=84f4cc8d41744f103d6fa7e87739b2be5a2d27b0'/>
<id>84f4cc8d41744f103d6fa7e87739b2be5a2d27b0</id>
<content type='text'>
NTFS_IOC_LIST_STREAMS walks the base inode's MFT attributes twice:
a first pass sizes the output buffer, a second pass fills it, both
times filtering out streams that ntfs_stream_unlinked() reports as
unlinked.  That filter is the culprit: it treats a stream inode that
is no longer in the inode hash as live, which is precisely the state
a stream being deleted ends up in.

When a base file is deleted while one of its named streams is still
open, ntfs_cleanup_deleted_inode() sets NInoStreamUnlinked on the
stream inode and removes it from the inode hash after dropping the
MFT record lock.  Nothing serializes this against the ioctl's two
passes, so if the flag and the unhash land between them, the first
pass excludes the stream while the second pass includes it, and the
ioctl writes an entry the allocation never accounted for.

The per-entry bounds check cannot catch this divergence, because
"offset &gt; required - entry_size" underflows when entry_size exceeds
required.  With a 1-character stream sizing the buffer at 48 bytes and
a 250-character stream surfacing only in the second pass, a 544-byte
entry is written into the 48-byte kmalloc-64 allocation.

Close the hole in two steps:

- Reject base inodes that are being deleted before walking their
  attributes, like the other named stream entry points in this file
  already do.  This also stops the listing from reporting streams of a
  deleted base file as live, which is reproducible even without the
  race.

- Make the bounds check underflow-safe so any remaining divergence
  between the passes can only produce -EOVERFLOW, never an
  out-of-bounds write.

KASAN report from the reproducer (timestamps stripped):

BUG: KASAN: slab-out-of-bounds in ntfs_ioctl_list_streams+0x7a9/0xa00
Write of size 500 at addr ffff88800b1931a8 by task ntfs_ads_race/305
CPU: 2 UID: 0 PID: 305 Comm: ntfs_ads_race
Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 &lt;TASK&gt;
 dump_stack_lvl+0x73/0xb0
 print_report+0xd1/0x610
 kasan_report+0xff/0x130
 kasan_check_range+0x10c/0x1c0
 __asan_memcpy+0x3f/0x70
 ntfs_ioctl_list_streams+0x7a9/0xa00
 ntfs_ioctl+0x3b6/0x420
 __x64_sys_ioctl+0xd1/0x120
 x64_sys_call+0x2a5/0x2220
 do_syscall_64+0x109/0x5e0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 &lt;/TASK&gt;

Allocated by task 305:
 kasan_save_stack+0x3d/0x60
 kasan_save_track+0x18/0x40
 kasan_save_alloc_info+0x3b/0x50
 __kasan_kmalloc+0x9c/0xa0
 __kvmalloc_node_noprof+0x2dd/0x800
 ntfs_ioctl_list_streams+0x57f/0xa00
 ntfs_ioctl+0x3b6/0x420
 __x64_sys_ioctl+0xd1/0x120
 x64_sys_call+0x2a5/0x2220
 do_syscall_64+0x109/0x5e0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88800b193180
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 40 bytes inside of
 allocated 48-byte region [ffff88800b193180, ffff88800b1931b0)

Fixes: 48996054b706 ("ntfs: add named stream ioctls support")
Signed-off-by: Xingyuan Mo &lt;hdthky0@gmail.com&gt;
Reviewed-by: Baolin Liu &lt;liubaolin@kylinos.cn&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
NTFS_IOC_LIST_STREAMS walks the base inode's MFT attributes twice:
a first pass sizes the output buffer, a second pass fills it, both
times filtering out streams that ntfs_stream_unlinked() reports as
unlinked.  That filter is the culprit: it treats a stream inode that
is no longer in the inode hash as live, which is precisely the state
a stream being deleted ends up in.

When a base file is deleted while one of its named streams is still
open, ntfs_cleanup_deleted_inode() sets NInoStreamUnlinked on the
stream inode and removes it from the inode hash after dropping the
MFT record lock.  Nothing serializes this against the ioctl's two
passes, so if the flag and the unhash land between them, the first
pass excludes the stream while the second pass includes it, and the
ioctl writes an entry the allocation never accounted for.

The per-entry bounds check cannot catch this divergence, because
"offset &gt; required - entry_size" underflows when entry_size exceeds
required.  With a 1-character stream sizing the buffer at 48 bytes and
a 250-character stream surfacing only in the second pass, a 544-byte
entry is written into the 48-byte kmalloc-64 allocation.

Close the hole in two steps:

- Reject base inodes that are being deleted before walking their
  attributes, like the other named stream entry points in this file
  already do.  This also stops the listing from reporting streams of a
  deleted base file as live, which is reproducible even without the
  race.

- Make the bounds check underflow-safe so any remaining divergence
  between the passes can only produce -EOVERFLOW, never an
  out-of-bounds write.

KASAN report from the reproducer (timestamps stripped):

BUG: KASAN: slab-out-of-bounds in ntfs_ioctl_list_streams+0x7a9/0xa00
Write of size 500 at addr ffff88800b1931a8 by task ntfs_ads_race/305
CPU: 2 UID: 0 PID: 305 Comm: ntfs_ads_race
Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 &lt;TASK&gt;
 dump_stack_lvl+0x73/0xb0
 print_report+0xd1/0x610
 kasan_report+0xff/0x130
 kasan_check_range+0x10c/0x1c0
 __asan_memcpy+0x3f/0x70
 ntfs_ioctl_list_streams+0x7a9/0xa00
 ntfs_ioctl+0x3b6/0x420
 __x64_sys_ioctl+0xd1/0x120
 x64_sys_call+0x2a5/0x2220
 do_syscall_64+0x109/0x5e0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 &lt;/TASK&gt;

Allocated by task 305:
 kasan_save_stack+0x3d/0x60
 kasan_save_track+0x18/0x40
 kasan_save_alloc_info+0x3b/0x50
 __kasan_kmalloc+0x9c/0xa0
 __kvmalloc_node_noprof+0x2dd/0x800
 ntfs_ioctl_list_streams+0x57f/0xa00
 ntfs_ioctl+0x3b6/0x420
 __x64_sys_ioctl+0xd1/0x120
 x64_sys_call+0x2a5/0x2220
 do_syscall_64+0x109/0x5e0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88800b193180
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 40 bytes inside of
 allocated 48-byte region [ffff88800b193180, ffff88800b1931b0)

Fixes: 48996054b706 ("ntfs: add named stream ioctls support")
Signed-off-by: Xingyuan Mo &lt;hdthky0@gmail.com&gt;
Reviewed-by: Baolin Liu &lt;liubaolin@kylinos.cn&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: refresh kmalloc_obj() conversions</title>
<updated>2026-11-06T05:55:37+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees+treewide@kernel.org</email>
</author>
<published>2026-10-29T06:08:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0af298e62e5cff4ebf9bec47b8711177a7e2f115'/>
<id>0af298e62e5cff4ebf9bec47b8711177a7e2f115</id>
<content type='text'>
Refresh the tree with run of the existing Coccinelle rules in
scripts/coccinelle/api/kmalloc_objs.cocci, now that they also convert
arrays of multi-byte integers.

The conversions break down as:

	435	kzalloc_objs()
	169	kmalloc_objs()
	 52	kvzalloc_objs()
	 47	kzalloc_obj()
	 42	kvmalloc_objs()
	  8	kmalloc_obj()
	  2	kzalloc_flex()
	  2	kvmalloc_flex()

and 37 existing kmalloc_obj() family calls drop a redundant GFP_KERNEL.

Build tested with allmodconfig on x86_64 with GCC 16.2.0, and, together
with the devm_kmalloc_obj() conversion that follows, on x86_64, arm64,
i386, arm, riscv, s390, m68k, mips, parisc, sparc, loongarch, arc,
xtensa, and openrisc with GCC 16.2.0 with no new warnings.

Signed-off-by: Kees Cook &lt;kees+treewide@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refresh the tree with run of the existing Coccinelle rules in
scripts/coccinelle/api/kmalloc_objs.cocci, now that they also convert
arrays of multi-byte integers.

The conversions break down as:

	435	kzalloc_objs()
	169	kmalloc_objs()
	 52	kvzalloc_objs()
	 47	kzalloc_obj()
	 42	kvmalloc_objs()
	  8	kmalloc_obj()
	  2	kzalloc_flex()
	  2	kvmalloc_flex()

and 37 existing kmalloc_obj() family calls drop a redundant GFP_KERNEL.

Build tested with allmodconfig on x86_64 with GCC 16.2.0, and, together
with the devm_kmalloc_obj() conversion that follows, on x86_64, arm64,
i386, arm, riscv, s390, m68k, mips, parisc, sparc, loongarch, arc,
xtensa, and openrisc with GCC 16.2.0 with no new warnings.

Signed-off-by: Kees Cook &lt;kees+treewide@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iomap: pass iomap_iter_next_fn directly instead of struct iomap_ops</title>
<updated>2026-11-05T14:52:51+00:00</updated>
<author>
<name>Joanne Koong</name>
<email>joannelkoong@gmail.com</email>
</author>
<published>2026-10-27T21:53:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9e8fc16dc6b474b9a87843c3d3ee12fc83f2bdcc'/>
<id>9e8fc16dc6b474b9a87843c3d3ee12fc83f2bdcc</id>
<content type='text'>
Now that all filesystems implement -&gt;iomap_next() and the legacy
-&gt;iomap_begin()/-&gt;iomap_end() fallback is gone, struct iomap_ops only
wraps a single iomap_next function pointer. Drop the struct entirely and
pass the iomap_iter_next_fn directly to iomap_iter() and all the
iomap/dax entry points. Filesystems pass their iomap_iter_next_fn
callback directly instead of an ops struct. Several iomap_iter_next_fn
callbacks become non-static and gain header declarations since callers
now reference them directly.

The iomap_iter tracepoint's ops field is renamed to next to match. These
tracepoints are explicitly not stable ABI (see the note in iomap/trace.h).

No functional change intended other than the tracepoint field rename
noted above.

Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Link: https://patch.msgid.link/20261027215326.2693300-5-joannelkoong@gmail.com
Signed-off-by: Christian Brauner (Amutable) &lt;brauner@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that all filesystems implement -&gt;iomap_next() and the legacy
-&gt;iomap_begin()/-&gt;iomap_end() fallback is gone, struct iomap_ops only
wraps a single iomap_next function pointer. Drop the struct entirely and
pass the iomap_iter_next_fn directly to iomap_iter() and all the
iomap/dax entry points. Filesystems pass their iomap_iter_next_fn
callback directly instead of an ops struct. Several iomap_iter_next_fn
callbacks become non-static and gain header declarations since callers
now reference them directly.

The iomap_iter tracepoint's ops field is renamed to next to match. These
tracepoints are explicitly not stable ABI (see the note in iomap/trace.h).

No functional change intended other than the tracepoint field rename
noted above.

Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Link: https://patch.msgid.link/20261027215326.2693300-5-joannelkoong@gmail.com
Signed-off-by: Christian Brauner (Amutable) &lt;brauner@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
