<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/ext4/ext4fs.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>Merge patch series "fs: ext4fs: Fix some issues found by Smatch"</title>
<updated>2025-07-11T17:33:25+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2025-07-11T16:44:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c29dfc2bb2aed7159b429b210694e2cba17867de'/>
<id>c29dfc2bb2aed7159b429b210694e2cba17867de</id>
<content type='text'>
Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt; says:

Smatch reported some issues in the ext4fs code. This includes a
suggestion to use an unwind goto, to not negate a return value and to
ensure that a NULL check happens before the pointer is dereferenced.

Link: https://lore.kernel.org/r/20250704-ext4fs_fix-v1-0-5c6acf4bf839@linaro.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt; says:

Smatch reported some issues in the ext4fs code. This includes a
suggestion to use an unwind goto, to not negate a return value and to
ensure that a NULL check happens before the pointer is dereferenced.

Link: https://lore.kernel.org/r/20250704-ext4fs_fix-v1-0-5c6acf4bf839@linaro.org
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ext4fs: Do not negate error before returning it</title>
<updated>2025-07-11T16:44:29+00:00</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-07-04T12:32:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a7e44898b4d2484a9fd3226f44bc9b51d174f1e3'/>
<id>a7e44898b4d2484a9fd3226f44bc9b51d174f1e3</id>
<content type='text'>
In ext4fs_readdir it calls ext4fs_read_file and checks the return value
for non-zero to detect an error. This return value should be returned as
is rather than being negated.

This issue found by Smatch

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In ext4fs_readdir it calls ext4fs_read_file and checks the return value
for non-zero to detect an error. This return value should be returned as
is rather than being negated.

This issue found by Smatch

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4fs: Fix: Read outside partition error (take 2)</title>
<updated>2025-06-12T19:22:26+00:00</updated>
<author>
<name>Tony Dinh</name>
<email>mibodhi@gmail.com</email>
</author>
<published>2025-05-28T19:48:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=53cc4332b3b37218a7cdab8bdb953da57eec2668'/>
<id>53cc4332b3b37218a7cdab8bdb953da57eec2668</id>
<content type='text'>
Use lbaint_t for blknr to avoid overflow in ext4fs_read_file().

Background:

blknr (block number) used in ext4fs_read_file() could be increased to a
very large value and causes a wrap around at 32 bit signed integer max,
thus becomes negative. This results in an out-of-normal range for sector
number (during the assignment delayed_start = blknr) where delayed_start
sector is typed uint64 lbaint_t. This causes the "Read outside partition"
error.

Looks like we also have this overflown problem in ext4_write.c that needs
to be addressed.

This patch was tested on the Synology DS116 (Armada 385) board, and a
4TB Seagate HDD.

Signed-off-by: Tony Dinh &lt;mibodhi@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use lbaint_t for blknr to avoid overflow in ext4fs_read_file().

Background:

blknr (block number) used in ext4fs_read_file() could be increased to a
very large value and causes a wrap around at 32 bit signed integer max,
thus becomes negative. This results in an out-of-normal range for sector
number (during the assignment delayed_start = blknr) where delayed_start
sector is typed uint64 lbaint_t. This causes the "Read outside partition"
error.

Looks like we also have this overflown problem in ext4_write.c that needs
to be addressed.

This patch was tested on the Synology DS116 (Armada 385) board, and a
4TB Seagate HDD.

Signed-off-by: Tony Dinh &lt;mibodhi@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'v2025.07-rc4' into next</title>
<updated>2025-06-09T22:28:28+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2025-06-09T22:28:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=59d00e20fced23e6463aa09db889dd548baee677'/>
<id>59d00e20fced23e6463aa09db889dd548baee677</id>
<content type='text'>
Prepare v2025.07-rc4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prepare v2025.07-rc4
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "ext4fs: Fix: Read outside partition error"</title>
<updated>2025-05-27T16:09:12+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2025-05-26T22:29:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e04d137231f2e9e14708a32448c879125b8e308f'/>
<id>e04d137231f2e9e14708a32448c879125b8e308f</id>
<content type='text'>
The issue here is that the function read_allocated_block() will report
problems via a negative return value. If we say the return value is
stored in an lbaint_t that can no longer happen (and Coverity discovered
this by reporting a no effect comparison and then dead code). The
problem being fixed by allowing for storing a larger block number will
have to be solved in some other manner.

This reverts commit df2ed552f0b05591090369a7fe7ddc92439dea5c.

Addresses-Coverity-ID: 131183
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The issue here is that the function read_allocated_block() will report
problems via a negative return value. If we say the return value is
stored in an lbaint_t that can no longer happen (and Coverity discovered
this by reporting a no effect comparison and then dead code). The
problem being fixed by allowing for storing a larger block number will
have to be solved in some other manner.

This reverts commit df2ed552f0b05591090369a7fe7ddc92439dea5c.

Addresses-Coverity-ID: 131183
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'v2025.07-rc3' into next</title>
<updated>2025-05-26T22:07:19+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2025-05-26T22:07:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=39b815d02d7ce6af32bcf023d20243c404b75a84'/>
<id>39b815d02d7ce6af32bcf023d20243c404b75a84</id>
<content type='text'>
Prepare v2025.07-rc3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prepare v2025.07-rc3
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4fs: Fix: Read outside partition error</title>
<updated>2025-05-23T16:42:49+00:00</updated>
<author>
<name>Tony Dinh</name>
<email>mibodhi@gmail.com</email>
</author>
<published>2025-05-23T05:02:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=df2ed552f0b05591090369a7fe7ddc92439dea5c'/>
<id>df2ed552f0b05591090369a7fe7ddc92439dea5c</id>
<content type='text'>
Use lbaint_t for blknr to avoid overflow in ext4fs_read_file().

Background:

blknr (block number) used in ext4fs_read_file() could be increased to a
very large value and causes a wrap around at 32 bit signed integer max,
thus becomes negative. This results in an out-of-normal range for sector
number (during the assignment delayed_start = blknr) where delayed_start
sector is typed uint64 lbaint_t. This causes the "Read outside partition"
error.

This patch was tested on the Synology DS116 (Armada 385) board, and a
4TB Seagate HDD.

Signed-off-by: Tony Dinh &lt;mibodhi@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use lbaint_t for blknr to avoid overflow in ext4fs_read_file().

Background:

blknr (block number) used in ext4fs_read_file() could be increased to a
very large value and causes a wrap around at 32 bit signed integer max,
thus becomes negative. This results in an out-of-normal range for sector
number (during the assignment delayed_start = blknr) where delayed_start
sector is typed uint64 lbaint_t. This causes the "Read outside partition"
error.

This patch was tested on the Synology DS116 (Armada 385) board, and a
4TB Seagate HDD.

Signed-off-by: Tony Dinh &lt;mibodhi@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4fs.c: Add missing include</title>
<updated>2025-05-13T17:30:08+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2025-05-01T16:47:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=720e0c0f1a14f034df3cc960e0924b74b3ba4fe2'/>
<id>720e0c0f1a14f034df3cc960e0924b74b3ba4fe2</id>
<content type='text'>
This file references rtc functions and implicitly includes &lt;rtc.h&gt;
today. Add this explicitly.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This file references rtc functions and implicitly includes &lt;rtc.h&gt;
today. Add this explicitly.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ext4: correct error handling</title>
<updated>2024-11-13T14:18:50+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2024-11-07T09:38:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9084e1b1b94c31d76ae7efd12f8828f3b4ed2255'/>
<id>9084e1b1b94c31d76ae7efd12f8828f3b4ed2255</id>
<content type='text'>
After calling strdup() check the returned pointer.

Avoid a memory leak if the directory is not found.

Reported-by: Michael Nazzareno Trimarchi &lt;michael@amarulasolutions.com&gt;
Fixes: 22fdac381f98 ("fs: ext4: implement opendir, readdir, closedir")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After calling strdup() check the returned pointer.

Avoid a memory leak if the directory is not found.

Reported-by: Michael Nazzareno Trimarchi &lt;michael@amarulasolutions.com&gt;
Fixes: 22fdac381f98 ("fs: ext4: implement opendir, readdir, closedir")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ext4: use fs_ls_generic</title>
<updated>2024-11-01T19:37:58+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2024-10-26T06:40:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=29e5a2e9597234700420e8e93055861eba3b409c'/>
<id>29e5a2e9597234700420e8e93055861eba3b409c</id>
<content type='text'>
Now that opendir, readir, closedir are implemented for ext4 we can use
fs_ls_generic() for implementing the ls command.

Adjust the unit tests:

* fs_ls_generic() produces more spaces between file size and name.
* The ext4 specific message "** Can not find directory. **\n" is not
  written anymore.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that opendir, readir, closedir are implemented for ext4 we can use
fs_ls_generic() for implementing the ls command.

Adjust the unit tests:

* fs_ls_generic() produces more spaces between file size and name.
* The ext4 specific message "** Can not find directory. **\n" is not
  written anymore.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
