<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/ntfs3/bitmap.c, branch v6.3</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>fs/ntfs3: Improve checking of bad clusters</title>
<updated>2022-11-14T16:50:48+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2022-10-11T17:19:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ec5fc72013762500867c9cef96fed89dc7161832'/>
<id>ec5fc72013762500867c9cef96fed89dc7161832</id>
<content type='text'>
Added new function wnd_set_used_safe.
Load $BadClus before $AttrDef instead of before $Bitmap.

Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added new function wnd_set_used_safe.
Load $BadClus before $AttrDef instead of before $Bitmap.

Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ntfs3: Add ntfs_bitmap_weight_le function and refactoring</title>
<updated>2022-11-14T16:50:42+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2022-10-06T16:42:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=08811ba59a61e8147c869e2d056c37ab8ca5ebde'/>
<id>08811ba59a61e8147c869e2d056c37ab8ca5ebde</id>
<content type='text'>
Added ntfs_bitmap_weight_le function.
Changed argument types of bits/bitmap functions.

Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added ntfs_bitmap_weight_le function.
Changed argument types of bits/bitmap functions.

Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ntfs3: Use _le variants of bitops functions</title>
<updated>2022-11-14T16:50:41+00:00</updated>
<author>
<name>Thomas Kühnel</name>
<email>thomas.kuehnel@avm.de</email>
</author>
<published>2021-12-07T10:24:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=095d8ce635c116bb7813d865adfbccde8094d920'/>
<id>095d8ce635c116bb7813d865adfbccde8094d920</id>
<content type='text'>
The functions from bitops.h already have _le variants so use them to
prevent invalid reads/writes of the bitmap on big endian systems.

Signed-off-by: Thomas Kühnel &lt;thomas.kuehnel@avm.de&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The functions from bitops.h already have _le variants so use them to
prevent invalid reads/writes of the bitmap on big endian systems.

Signed-off-by: Thomas Kühnel &lt;thomas.kuehnel@avm.de&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ntfs3: Add functions to modify LE bitmaps</title>
<updated>2022-11-14T16:50:41+00:00</updated>
<author>
<name>Thomas Kühnel</name>
<email>thomas.kuehnel@avm.de</email>
</author>
<published>2021-12-07T10:24:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=88a8d0d2482f60596eec875ba5ba62901d8274ff'/>
<id>88a8d0d2482f60596eec875ba5ba62901d8274ff</id>
<content type='text'>
__bitmap_set/__bitmap_clear only works with bitmaps in CPU order.
Define a variant of these functions in ntfs3 to handle modifying bitmaps
read from the filesystem.

Signed-off-by: Thomas Kühnel &lt;thomas.kuehnel@avm.de&gt;
Reviewed-by: Nicolas Schier &lt;n.schier@avm.de&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
__bitmap_set/__bitmap_clear only works with bitmaps in CPU order.
Define a variant of these functions in ntfs3 to handle modifying bitmaps
read from the filesystem.

Signed-off-by: Thomas Kühnel &lt;thomas.kuehnel@avm.de&gt;
Reviewed-by: Nicolas Schier &lt;n.schier@avm.de&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ntfs3: Use __GFP_NOWARN allocation at wnd_init()</title>
<updated>2022-11-12T17:59:41+00:00</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2022-10-02T14:39:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0d0f659bf713662fabed973f9996b8f23c59ca51'/>
<id>0d0f659bf713662fabed973f9996b8f23c59ca51</id>
<content type='text'>
syzbot is reporting too large allocation at wnd_init() [1], for a crafted
filesystem can become wnd-&gt;nwnd close to UINT_MAX. Add __GFP_NOWARN in
order to avoid too large allocation warning, than exhausting memory by
using kvcalloc().

Link: https://syzkaller.appspot.com/bug?extid=fa4648a5446460b7b963 [1]
Reported-by: syzot &lt;syzbot+fa4648a5446460b7b963@syzkaller.appspotmail.com&gt;
Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
syzbot is reporting too large allocation at wnd_init() [1], for a crafted
filesystem can become wnd-&gt;nwnd close to UINT_MAX. Add __GFP_NOWARN in
order to avoid too large allocation warning, than exhausting memory by
using kvcalloc().

Link: https://syzkaller.appspot.com/bug?extid=fa4648a5446460b7b963 [1]
Reported-by: syzot &lt;syzbot+fa4648a5446460b7b963@syzkaller.appspotmail.com&gt;
Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ntfs3: Fix slab-out-of-bounds read in ntfs_trim_fs</title>
<updated>2022-11-12T17:59:40+00:00</updated>
<author>
<name>Abdun Nihaal</name>
<email>abdun.nihaal@gmail.com</email>
</author>
<published>2022-10-01T07:00:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=557d19675a470bb0a98beccec38c5dc3735c20fa'/>
<id>557d19675a470bb0a98beccec38c5dc3735c20fa</id>
<content type='text'>
Syzbot reports an out of bound access in ntfs_trim_fs.
The cause of this is using a loop termination condition that compares
window index (iw) with wnd-&gt;nbits instead of wnd-&gt;nwnd, due to which the
index used for wnd-&gt;free_bits exceeds the size of the array allocated.

Fix the loop condition.

Fixes: 3f3b442b5ad2 ("fs/ntfs3: Add bitmap")
Link: https://syzkaller.appspot.com/bug?extid=b892240eac461e488d51
Reported-by: syzbot+b892240eac461e488d51@syzkaller.appspotmail.com
Signed-off-by: Abdun Nihaal &lt;abdun.nihaal@gmail.com&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Syzbot reports an out of bound access in ntfs_trim_fs.
The cause of this is using a loop termination condition that compares
window index (iw) with wnd-&gt;nbits instead of wnd-&gt;nwnd, due to which the
index used for wnd-&gt;free_bits exceeds the size of the array allocated.

Fix the loop condition.

Fixes: 3f3b442b5ad2 ("fs/ntfs3: Add bitmap")
Link: https://syzkaller.appspot.com/bug?extid=b892240eac461e488d51
Reported-by: syzbot+b892240eac461e488d51@syzkaller.appspotmail.com
Signed-off-by: Abdun Nihaal &lt;abdun.nihaal@gmail.com&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ntfs3: Use kmalloc_array for allocating multiple elements</title>
<updated>2022-09-30T14:39:51+00:00</updated>
<author>
<name>Kenneth Lee</name>
<email>klee33@uw.edu</email>
</author>
<published>2022-08-19T05:51:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=92f017c4aee6e2bb79593adeacccbea3afe62223'/>
<id>92f017c4aee6e2bb79593adeacccbea3afe62223</id>
<content type='text'>
Prefer using kmalloc_array(a, b) over kmalloc(a * b) as this
improves semantics since kmalloc is intended for allocating an
array of memory.

Signed-off-by: Kenneth Lee &lt;klee33@uw.edu&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prefer using kmalloc_array(a, b) over kmalloc(a * b) as this
improves semantics since kmalloc is intended for allocating an
array of memory.

Signed-off-by: Kenneth Lee &lt;klee33@uw.edu&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ntfs3: Remove unused function wnd_bits</title>
<updated>2022-08-10T16:12:48+00:00</updated>
<author>
<name>Jiapeng Chong</name>
<email>jiapeng.chong@linux.alibaba.com</email>
</author>
<published>2022-07-21T03:18:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=96964352e21962f5e51ecad87527ae9b6fec9670'/>
<id>96964352e21962f5e51ecad87527ae9b6fec9670</id>
<content type='text'>
Since the function wnd_bits is defined but not called in any file, it is
a useless function, and we delete it in view of the brevity of the code.

Remove some warnings found by running scripts/kernel-doc, which is
caused by using 'make W=1'.

fs/ntfs3/bitmap.c:54:19: warning: unused function 'wnd_bits' [-Wunused-function].

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Jiapeng Chong &lt;jiapeng.chong@linux.alibaba.com&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since the function wnd_bits is defined but not called in any file, it is
a useless function, and we delete it in view of the brevity of the code.

Remove some warnings found by running scripts/kernel-doc, which is
caused by using 'make W=1'.

fs/ntfs3/bitmap.c:54:19: warning: unused function 'wnd_bits' [-Wunused-function].

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Jiapeng Chong &lt;jiapeng.chong@linux.alibaba.com&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ntfs3: Added comments to frecord functions</title>
<updated>2022-08-03T15:25:07+00:00</updated>
<author>
<name>Konstantin Komarov</name>
<email>almaz.alexandrovich@paragon-software.com</email>
</author>
<published>2022-07-06T17:01:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=54033c135061b52d4405facba2e49177a5716a31'/>
<id>54033c135061b52d4405facba2e49177a5716a31</id>
<content type='text'>
Added some comments in frecord.c for more context.
Also changed run_lookup to static because it's an internal function.

Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added some comments in frecord.c for more context.
Also changed run_lookup to static because it's an internal function.

Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ntfs3: Remove a useless test</title>
<updated>2022-06-07T16:40:14+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2021-12-23T12:20:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=548744f84456946181ed6dc0ac6be8267f167d28'/>
<id>548744f84456946181ed6dc0ac6be8267f167d28</id>
<content type='text'>
'new_free' has just been allocated by kmalloc() and is known to be not
NULL.
So this pointer can't be equal to a previous memory allocation.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'new_free' has just been allocated by kmalloc() and is known to be not
NULL.
So this pointer can't be equal to a previous memory allocation.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Konstantin Komarov &lt;almaz.alexandrovich@paragon-software.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
