1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00
Files
u-boot-megous/include
Stefan Brüns 76a29519ff ext4: fix possible crash on directory traversal, ignore deleted entries
The following command triggers a segfault in search_dir:
./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ;
    ext4write host 0 0 /./foo 0x10'

The following command triggers a segfault in check_filename:
./sandbox/u-boot -c 'host bind 0 ./sandbox/test/fs/3GB.ext4.img ;
    ext4write host 0 0 /. 0x10'

"." is the first entry in the directory, thus previous_dir is NULL. The
whole previous_dir block in search_dir seems to be a bad copy from
check_filename(...). As the changed data is not written to disk, the
statement is mostly harmless, save the possible NULL-ptr reference.

Typically a file is unlinked by extending the direntlen of the previous
entry. If the entry is the first entry in the directory block, it is
invalidated by setting inode=0.

The inode==0 case is hard to trigger without crafted filesystems. It only
hits if the first entry in a directory block is deleted and later a lookup
for the entry (by name) is done.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
2016-09-23 09:02:34 -04:00
..
2016-04-01 17:18:12 -04:00
2016-08-20 11:35:07 -04:00
2016-03-22 12:16:13 -04:00
2016-01-12 10:19:09 -07:00
2016-03-24 09:47:43 +01:00
2016-05-25 17:52:39 +02:00
2016-05-25 17:52:39 +02:00
2016-01-20 19:06:23 -07:00
2016-09-16 17:03:39 -04:00
2016-02-23 16:14:45 +05:30
2016-01-19 08:31:21 -05:00
2016-06-06 13:39:15 -04:00
2016-09-07 08:49:07 -04:00
2016-05-03 17:52:11 -05:00
2016-01-28 12:22:19 -06:00
2016-01-27 15:55:54 +01:00
2016-01-19 08:31:21 -05:00
2016-06-28 12:08:53 -07:00
2016-07-22 09:52:59 -04:00
2016-06-10 13:44:58 -07:00
2016-06-19 17:05:55 -06:00
2016-06-19 17:05:55 -06:00
2016-03-08 15:01:47 -05:00
2016-08-12 11:01:22 -06:00
2016-01-20 10:19:40 -05:00
2016-07-16 09:43:12 -04:00
2016-01-21 20:42:36 -07:00
2016-02-05 12:47:21 +08:00
2016-03-15 15:19:23 -04:00
2016-01-21 20:42:36 -07:00
2016-01-21 20:42:34 -07:00
2016-06-19 17:05:55 -06:00
2016-03-14 15:34:50 -06:00
2016-08-17 10:25:35 +09:00
2016-09-22 01:02:28 +05:30
2016-07-22 09:53:00 -04:00
2016-05-26 20:48:31 -06:00
2016-02-26 08:53:10 -07:00
2016-05-17 09:54:43 -06:00
2016-05-02 18:37:09 -04:00
2016-05-25 13:25:18 +09:00
2016-01-25 10:39:47 -05:00