<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/ntfs3/record.c, branch linux-7.1.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-02-21T09:02:28+00:00</updated>
<entry>
<title>treewide: Replace kmalloc with kmalloc_obj for non-scalar types</title>
<updated>2026-02-21T09:02:28+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees@kernel.org</email>
</author>
<published>2026-02-21T07:49:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=69050f8d6d075dc01af7a5f2f550a8067510366f'/>
<id>urn:sha1:69050f8d6d075dc01af7a5f2f550a8067510366f</id>
<content type='text'>
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs/ntfs3: correct attr_collapse_range when file is too fragmented</title>
<updated>2025-11-17T08:08:49+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2025-10-30T20:35:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2109b080240ca0e1a3ebe28cf7577ebb00a5d887'/>
<id>urn:sha1:2109b080240ca0e1a3ebe28cf7577ebb00a5d887</id>
<content type='text'>
Fix incorrect VCN adjustments in attr_collapse_range() that caused
filesystem errors or corruption on very fragmented NTFS files when
performing collapse-range operations.

Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
</entry>
<entry>
<title>fs/ntfs3: Mark inode as bad as soon as error detected in mi_enum_attr()</title>
<updated>2024-12-30T08:37:39+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2024-12-30T07:33:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2afd4d267e6dbaec8d3ccd4f5396cb84bc67aa2e'/>
<id>urn:sha1:2afd4d267e6dbaec8d3ccd4f5396cb84bc67aa2e</id>
<content type='text'>
Extended the `mi_enum_attr()` function interface with an additional
parameter, `struct ntfs_inode *ni`, to allow marking the inode
as bad as soon as an error is detected.

Reported-by: syzbot+73d8fc29ec7cba8286fa@syzkaller.appspotmail.com
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
</entry>
<entry>
<title>fs/ntfs3: Add more checks in mi_enum_attr (part 2)</title>
<updated>2024-11-01T08:19:51+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2024-10-21T11:49:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a8f659ce14f8f734894227ba2c5ca78c8451501e'/>
<id>urn:sha1:a8f659ce14f8f734894227ba2c5ca78c8451501e</id>
<content type='text'>
Add offset check before access to attr-&gt;non_res field as mentioned in [1].

[1] https://lore.kernel.org/ntfs3/20241010110005.42792-1-llfamsec@gmail.com/

Suggested-by: lei lu &lt;llfamsec@gmail.com&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
</entry>
<entry>
<title>fs/ntfs3: Sequential field availability check in mi_enum_attr()</title>
<updated>2024-10-01T09:19:07+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2024-09-05T12:03:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=090f612756a9720ec18b0b130e28be49839d7cb5'/>
<id>urn:sha1:090f612756a9720ec18b0b130e28be49839d7cb5</id>
<content type='text'>
The code is slightly reformatted to consistently check field availability
without duplication.

Fixes: 556bdf27c2dd ("ntfs3: Add bounds checking to mi_enum_attr()")
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
</entry>
<entry>
<title>fs/ntfs3: Add rough attr alloc_size check</title>
<updated>2024-09-03T13:58:43+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2024-08-19T13:26:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c4a8ba334262e9a5c158d618a4820e1b9c12495c'/>
<id>urn:sha1:c4a8ba334262e9a5c158d618a4820e1b9c12495c</id>
<content type='text'>
Reported-by: syzbot+c6d94bedd910a8216d25@syzkaller.appspotmail.com
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
</entry>
<entry>
<title>ntfs3: Add bounds checking to mi_enum_attr()</title>
<updated>2024-09-03T13:58:38+00:00</updated>
<author>
<name>lei lu</name>
<email>llfamsec@gmail.com</email>
</author>
<published>2024-08-23T13:39:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=556bdf27c2dd5c74a9caacbe524b943a6cd42d99'/>
<id>urn:sha1:556bdf27c2dd5c74a9caacbe524b943a6cd42d99</id>
<content type='text'>
Added bounds checking to make sure that every attr don't stray beyond
valid memory region.

Signed-off-by: lei lu &lt;llfamsec@gmail.com&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
</entry>
<entry>
<title>fs/ntfs3: Taking DOS names into account during link counting</title>
<updated>2024-04-23T06:34:20+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2024-04-17T07:33:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=110b24eb1a749bea3440f3ca2ff890a26179050a'/>
<id>urn:sha1:110b24eb1a749bea3440f3ca2ff890a26179050a</id>
<content type='text'>
When counting and checking hard links in an ntfs file record,

  struct MFT_REC {
    struct NTFS_RECORD_HEADER rhdr; // 'FILE'
    __le16 seq;		    // 0x10: Sequence number for this record.
&gt;&gt;  __le16 hard_links;	// 0x12: The number of hard links to record.
    __le16 attr_off;	// 0x14: Offset to attributes.
  ...

the ntfs3 driver ignored short names (DOS names), causing the link count
to be reduced by 1 and messages to be output to dmesg.

For Windows, such a situation is a minor error, meaning chkdsk does not report
errors on such a volume, and in the case of using the /f switch, it silently
corrects them, reporting that no errors were found. This does not affect
the consistency of the file system.

Nevertheless, the behavior in the ntfs3 driver is incorrect and
changes the content of the file system. This patch should fix that.

PS: most likely, there has been a confusion of concepts
MFT_REC::hard_links and inode::__i_nlink.

Fixes: 82cae269cfa95 ("fs/ntfs3: Add initialization of super block")
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>fs/ntfs3: Fixed overflow check in mi_enum_attr()</title>
<updated>2024-01-29T07:48:34+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2024-01-26T08:14:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=652cfeb43d6b9aba5c7c4902bed7a7340df131fb'/>
<id>urn:sha1:652cfeb43d6b9aba5c7c4902bed7a7340df131fb</id>
<content type='text'>
Reported-by: Robert Morris &lt;rtm@csail.mit.edu&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
</entry>
<entry>
<title>fs/ntfs3: Correct hard links updating when dealing with DOS names</title>
<updated>2023-12-06T14:46:08+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2023-11-24T08:26:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1918c10e137eae266b8eb0ab1cc14421dcb0e3e2'/>
<id>urn:sha1:1918c10e137eae266b8eb0ab1cc14421dcb0e3e2</id>
<content type='text'>
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
</entry>
</feed>
