<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/ext4, branch v2018.09</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>fs: ext4: fix crash on ext4ls</title>
<updated>2018-05-23T21:30:04+00:00</updated>
<author>
<name>Eugen Hristev</name>
<email>eugen.hristev@microchip.com</email>
</author>
<published>2018-05-09T13:28:37+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e71a969cea56eb3e93de3320df5ce44c9e4e1c53'/>
<id>e71a969cea56eb3e93de3320df5ce44c9e4e1c53</id>
<content type='text'>
Found a crash while issuing ext4ls with a non-existent directory.
Crash test:

=&gt; ext4ls mmc 0 1
** Can not find directory. **
data abort
pc : [&lt;3fd7c2ec&gt;]          lr : [&lt;3fd93ed8&gt;]
reloc pc : [&lt;26f142ec&gt;]    lr : [&lt;26f2bed8&gt;]
sp : 3f963338  ip : 3fdc3dc4     fp : 3fd6b370
r10: 00000004  r9 : 3f967ec0     r8 : 3f96db68
r7 : 3fdc99b4  r6 : 00000000     r5 : 3f96dc88  r4 : 3fdcbc8c
r3 : fffffffa  r2 : 00000000     r1 : 3f96e0bc  r0 : 00000002
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

Tested on SAMA5D2_Xplained board (sama5d2_xplained_mmc_defconfig)

Looks like crash is introduced by commit:
"fa9ca8a" fs/ext4/ext4fs.c: Free dirnode in error path of ext4fs_ls

Issue is that dirnode is not initialized, and then freed if the call
to ext4_ls fails. ext4_ls will not change the value of dirnode in this case
thus we have a crash with data abort.

I added initialization and a check for dirname being NULL.

Fixes: "fa9ca8a" fs/ext4/ext4fs.c: Free dirnode in error path of ext4fs_ls
Cc: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Cc: Tom Rini &lt;trini@konsulko.com&gt;
Signed-off-by: Eugen Hristev &lt;eugen.hristev@microchip.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Found a crash while issuing ext4ls with a non-existent directory.
Crash test:

=&gt; ext4ls mmc 0 1
** Can not find directory. **
data abort
pc : [&lt;3fd7c2ec&gt;]          lr : [&lt;3fd93ed8&gt;]
reloc pc : [&lt;26f142ec&gt;]    lr : [&lt;26f2bed8&gt;]
sp : 3f963338  ip : 3fdc3dc4     fp : 3fd6b370
r10: 00000004  r9 : 3f967ec0     r8 : 3f96db68
r7 : 3fdc99b4  r6 : 00000000     r5 : 3f96dc88  r4 : 3fdcbc8c
r3 : fffffffa  r2 : 00000000     r1 : 3f96e0bc  r0 : 00000002
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

Tested on SAMA5D2_Xplained board (sama5d2_xplained_mmc_defconfig)

Looks like crash is introduced by commit:
"fa9ca8a" fs/ext4/ext4fs.c: Free dirnode in error path of ext4fs_ls

Issue is that dirnode is not initialized, and then freed if the call
to ext4_ls fails. ext4_ls will not change the value of dirnode in this case
thus we have a crash with data abort.

I added initialization and a check for dirname being NULL.

Fixes: "fa9ca8a" fs/ext4/ext4fs.c: Free dirnode in error path of ext4fs_ls
Cc: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Cc: Tom Rini &lt;trini@konsulko.com&gt;
Signed-off-by: Eugen Hristev &lt;eugen.hristev@microchip.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>SPDX: Convert all of our single license tags to Linux Kernel style</title>
<updated>2018-05-07T13:34:12+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2018-05-06T21:58:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=83d290c56fab2d38cd1ab4c4cc7099559c1d5046'/>
<id>83d290c56fab2d38cd1ab4c4cc7099559c1d5046</id>
<content type='text'>
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from.  So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry.  Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents.  There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from.  So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry.  Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents.  There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ext4: Do not print mount fail message when not ext4 filesystem</title>
<updated>2018-03-09T17:31:07+00:00</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2018-03-07T23:26:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=51be47166319dfbf68828182cb57889bae4dc20b'/>
<id>51be47166319dfbf68828182cb57889bae4dc20b</id>
<content type='text'>
Other filesystem drivers don't do this.

Signed-off-by: Marek Behun &lt;marek.behun@nic.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Other filesystem drivers don't do this.

Signed-off-by: Marek Behun &lt;marek.behun@nic.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: Migrate ext4 to Kconfig</title>
<updated>2018-01-22T21:43:30+00:00</updated>
<author>
<name>Tuomas Tynkkynen</name>
<email>tuomas@tuxera.com</email>
</author>
<published>2018-01-05T00:45:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3d22bae57f1e5f0f0d3f69216e8aae27e8a797c4'/>
<id>3d22bae57f1e5f0f0d3f69216e8aae27e8a797c4</id>
<content type='text'>
Migrate the following symbols to Kconfig:

CONFIG_FS_EXT4
CONFIG_EXT4_WRITE

The definitions in config_fallbacks.h can now be expressed in Kconfig.

Signed-off-by: Tuomas Tynkkynen &lt;tuomas@tuxera.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Migrate the following symbols to Kconfig:

CONFIG_FS_EXT4
CONFIG_EXT4_WRITE

The definitions in config_fallbacks.h can now be expressed in Kconfig.

Signed-off-by: Tuomas Tynkkynen &lt;tuomas@tuxera.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: recover from filesystem corruption when reading</title>
<updated>2017-11-20T08:58:31+00:00</updated>
<author>
<name>Ian Ray</name>
<email>ian.ray@ge.com</email>
</author>
<published>2017-11-08T15:35:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ecdfb4195b20eb2dcde3c4083170016c13c69e8b'/>
<id>ecdfb4195b20eb2dcde3c4083170016c13c69e8b</id>
<content type='text'>
Some fixes when reading EXT files and directory entries were identified
after using e2fuzz to corrupt an EXT3 filesystem:

 - Stop reading directory entries if the offset becomes badly aligned.

 - Avoid overwriting memory by clamping the length used to zero the buffer
   in ext4fs_read_file.  Also sanity check blocksize.

Signed-off-by: Ian Ray &lt;ian.ray@ge.com&gt;
Signed-off-by: Martyn Welch &lt;martyn.welch@collabora.co.uk&gt;
Reviewed-by: Stefano Babic &lt;sbabic@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some fixes when reading EXT files and directory entries were identified
after using e2fuzz to corrupt an EXT3 filesystem:

 - Stop reading directory entries if the offset becomes badly aligned.

 - Avoid overwriting memory by clamping the length used to zero the buffer
   in ext4fs_read_file.  Also sanity check blocksize.

Signed-off-by: Ian Ray &lt;ian.ray@ge.com&gt;
Signed-off-by: Martyn Welch &lt;martyn.welch@collabora.co.uk&gt;
Reviewed-by: Stefano Babic &lt;sbabic@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ext4/ext4fs.c: Free dirnode in error path of ext4fs_ls</title>
<updated>2017-10-06T15:28:22+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2017-09-27T02:43:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fa9ca8a5d271e0533f61222df2bd6fd512687dbd'/>
<id>fa9ca8a5d271e0533f61222df2bd6fd512687dbd</id>
<content type='text'>
As reported by Coverity, we did not free dirnode in the case of failure.
Do so now.

Reported-by: Coverity (CID: 131221)
Cc: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As reported by Coverity, we did not free dirnode in the case of failure.
Do so now.

Reported-by: Coverity (CID: 131221)
Cc: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ext4: Fix group descriptor checksum calculation</title>
<updated>2017-10-06T15:28:18+00:00</updated>
<author>
<name>Tuomas Tynkkynen</name>
<email>tuomas.tynkkynen@iki.fi</email>
</author>
<published>2017-09-25T19:06:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=385b73185596cfc9e2acb74ab66abe91c06177f3'/>
<id>385b73185596cfc9e2acb74ab66abe91c06177f3</id>
<content type='text'>
The current code doesn't compute the group descriptor checksum correctly
for the filesystems that e2fsprogs 1.43.4 creates (they have
'Group descriptor size: 64' as reported by tune2fs). Extend the checksum
calculation to be done as ext4_group_desc_csum() does in Linux.

This fixes these errors in dmesg from running fs-test.sh and makes it
succeed again:

[1671902.620699] EXT4-fs (loop1): ext4_check_descriptors: Checksum for group 0 failed (35782!=10965)
[1671902.620706] EXT4-fs (loop1): group descriptors corrupted!

Signed-off-by: Tuomas Tynkkynen &lt;tuomas.tynkkynen@iki.fi&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current code doesn't compute the group descriptor checksum correctly
for the filesystems that e2fsprogs 1.43.4 creates (they have
'Group descriptor size: 64' as reported by tune2fs). Extend the checksum
calculation to be done as ext4_group_desc_csum() does in Linux.

This fixes these errors in dmesg from running fs-test.sh and makes it
succeed again:

[1671902.620699] EXT4-fs (loop1): ext4_check_descriptors: Checksum for group 0 failed (35782!=10965)
[1671902.620706] EXT4-fs (loop1): group descriptors corrupted!

Signed-off-by: Tuomas Tynkkynen &lt;tuomas.tynkkynen@iki.fi&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: Create a common fs_devread for ext4/reiserfs/zfs</title>
<updated>2017-10-03T01:51:50+00:00</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2017-09-03T15:00:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5994e8b6432d1c6df1cad44771f02054dba893ff'/>
<id>5994e8b6432d1c6df1cad44771f02054dba893ff</id>
<content type='text'>
The ext4, reiserfs and zfs filesystems all have their own implementation
of the same function, *_devread. Generalize this function into fs_devread
and put the code into fs/fs_internal.c.

Signed-off-by: Marek Behun &lt;marek.behun@nic.cz&gt;
[trini: Move fs/fs_internal.o hunk to the end of fs/Makefile as all
cases need it]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ext4, reiserfs and zfs filesystems all have their own implementation
of the same function, *_devread. Generalize this function into fs_devread
and put the code into fs/fs_internal.c.

Signed-off-by: Marek Behun &lt;marek.behun@nic.cz&gt;
[trini: Move fs/fs_internal.o hunk to the end of fs/Makefile as all
cases need it]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ext4: Fix journal overrun issue reported by Coverity</title>
<updated>2017-08-26T18:56:13+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2017-08-21T02:30:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=10b078d83674ab0ced812da490f3c6d2261e1b79'/>
<id>10b078d83674ab0ced812da490f3c6d2261e1b79</id>
<content type='text'>
While &amp;p_jdb[fs-&gt;blksz] is a valid expression (it points *one* char
sized element past the end of the array, e.g. &amp;p_jdb[fs-&gt;blksz + 1] is
invalid (according to the C standard (C99/C11)).

Changing this to tag = (struct ext3_journal_block_tag *)(p_jdb + ofs);

Cc: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Suggested-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Reported-by: Coverity (CID: 165117, 165110)
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While &amp;p_jdb[fs-&gt;blksz] is a valid expression (it points *one* char
sized element past the end of the array, e.g. &amp;p_jdb[fs-&gt;blksz + 1] is
invalid (according to the C standard (C99/C11)).

Changing this to tag = (struct ext3_journal_block_tag *)(p_jdb + ofs);

Cc: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Suggested-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
Reported-by: Coverity (CID: 165117, 165110)
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Stefan Brüns &lt;stefan.bruens@rwth-aachen.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: Fix comparision of unsigned expression with &lt; 0</title>
<updated>2017-04-27T20:49:09+00:00</updated>
<author>
<name>Lokesh Vutla</name>
<email>lokeshvutla@ti.com</email>
</author>
<published>2017-04-26T11:28:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=509b498a500afab1111d69f789b630c699b071a3'/>
<id>509b498a500afab1111d69f789b630c699b071a3</id>
<content type='text'>
In file ext4fs.c funtion ext4fs_read_file() compares an
unsigned expression with &lt; 0 like below

	lbaint_t blknr;
	blknr = read_allocated_block(&amp;(node-&gt;inode), i);
	if (blknr &lt; 0)
		return -1;

blknr is of type ulong/uint64_t. read_allocated_block() returns
long int. So comparing blknr with &lt; 0 will always be false. Instead
declare blknr as long int.

Similarly ext4/dev.c does a similar comparison. Drop the redundant
comparison.

Signed-off-by: Lokesh Vutla &lt;lokeshvutla@ti.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In file ext4fs.c funtion ext4fs_read_file() compares an
unsigned expression with &lt; 0 like below

	lbaint_t blknr;
	blknr = read_allocated_block(&amp;(node-&gt;inode), i);
	if (blknr &lt; 0)
		return -1;

blknr is of type ulong/uint64_t. read_allocated_block() returns
long int. So comparing blknr with &lt; 0 will always be false. Instead
declare blknr as long int.

Similarly ext4/dev.c does a similar comparison. Drop the redundant
comparison.

Signed-off-by: Lokesh Vutla &lt;lokeshvutla@ti.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
