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-09-07 08:49:03 -04:00
2016-01-19 22:26:12 +00:00
2016-09-22 16:51:19 -04:00
2016-09-06 13:18:19 -04:00
2016-09-21 15:04:32 +02:00
2016-01-27 08:13:10 -08:00
2016-09-22 07:32:22 -06:00
2016-07-27 14:15:07 -06:00
2016-04-01 17:18:12 -04:00
2016-08-20 11:35:07 -04:00
2016-03-14 19:18:07 -04:00
2016-07-26 17:34:28 -04:00
2016-03-22 12:16:13 -04:00
2016-01-19 08:31:21 -05:00
2016-01-12 10:19:09 -07:00
2016-03-24 09:47:43 +01:00
2016-05-21 01:25:50 +02:00
2016-06-12 23:49:38 +02:00
2016-06-20 05:19:09 -04:00
2016-03-31 17:03:52 +02:00
2016-05-25 17:52:39 +02:00
2016-05-25 17:52:39 +02:00
2016-05-25 17:52:39 +02:00
2016-01-21 20:42:36 -07:00
2016-01-24 12:07:19 +08:00
2016-05-17 09:54:43 -06:00
2016-06-09 13:53:08 -04:00
2016-01-20 19:06:23 -07:00
2016-06-19 17:05:55 -06:00
2016-09-22 15:39:11 -04:00
2016-04-01 17:17:40 -04:00
2016-01-19 08:31:21 -05:00
2016-09-16 17:03:39 -04:00
2016-09-07 08:49:06 -04:00
2016-05-17 09:54:43 -06:00
2016-06-24 17:24:41 -04:00
2016-08-20 11:35:08 -04:00
2016-05-17 09:54:43 -06:00
2016-07-26 09:01:43 -07:00
2016-04-25 15:09:40 -04:00
2016-05-24 11:42:04 -05:00
2016-03-17 10:27:22 +08:00
2016-03-14 19:18:42 -04:00
2016-01-19 08:31:21 -05:00
2016-03-14 15:34:50 -06:00
2016-02-24 19:12:32 +01:00
2016-03-14 22:01:26 +01:00
2016-02-23 16:14:45 +05:30
2016-01-19 08:31:21 -05:00
2016-07-14 20:40:24 -06:00
2016-06-04 00:43:51 +02:00
2016-08-05 14:04:46 +09:00
2016-01-21 20:42:36 -07:00
2016-05-20 17:02:07 -04:00
2016-05-20 17:02:07 -04:00
2016-06-06 13:39:15 -04:00
2016-06-06 13:39:16 -04:00
2016-09-07 08:49:07 -04:00
2016-06-24 17:23:11 -04:00
2016-05-03 17:52:11 -05:00
2016-07-05 13:19:08 -07:00
2016-01-28 12:22:19 -06:00
2016-09-23 09:02:34 -04:00
2016-09-23 09:02:04 -04:00
2016-05-25 13:25:18 +09:00
2016-06-27 16:37:38 -04:00
2016-09-23 08:55:56 -04:00
2016-06-27 16:37:38 -04:00
2016-06-27 16:37:38 -04:00
2016-08-12 09:20:27 -06:00
2016-09-14 22:54:19 +09:00
2016-05-21 01:25:50 +02:00
2016-01-27 15:55:54 +01:00
2016-01-19 08:31:21 -05:00
2016-01-19 08:31:21 -05:00
2016-05-17 09:26:53 -07:00
2016-01-19 08:31:21 -05:00
2015-12-13 18:27:28 -08:00
2016-06-28 12:08:53 -07:00
2016-02-24 08:51:13 -08:00
2016-01-28 12:22:49 -06:00
2016-08-02 09:46:02 -07:00
2016-02-24 08:51:13 -08:00
2016-05-18 08:51:46 -07:00
2016-03-29 08:46:20 -07:00
2016-03-29 08:46:19 -07:00
2016-06-13 15:16:46 +02:00
2016-07-21 11:09:23 -07:00
2016-01-07 17:54:53 +01:00
2016-07-22 14:46:21 -04:00
2016-01-13 21:05:08 -05:00
2016-07-22 09:52:59 -04:00
2016-06-10 13:44:58 -07:00
2016-03-17 10:27:24 +08:00
2016-05-17 09:54:43 -06:00
2016-06-27 16:37:39 -04:00
2016-08-15 18:46:38 -04:00
2016-05-17 09:54:43 -06:00
2016-01-24 00:38:40 +01:00
2016-08-20 11:35:00 -04:00
2016-08-20 11:35:04 -04:00
2016-05-25 13:25:18 +09: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-15 15:29:04 -05:00
2016-08-12 11:01:22 -06:00
2016-09-20 06:46:01 +09:00
2016-01-20 10:19:40 -05:00
2016-07-24 20:36:28 -05:00
2016-07-16 09:43:12 -04:00
2016-05-24 11:39:04 -05:00
2016-03-17 21:27:39 -06:00
2016-08-16 11:44:09 +08:00
2016-07-22 14:46:12 -04:00
2016-07-14 20:40:24 -06:00
2016-01-21 20:42:36 -07:00
2016-05-17 09:54:43 -06:00
2016-01-19 08:31:21 -05:00
2016-02-05 12:47:21 +08:00
2016-01-12 10:19:09 -07:00
2016-03-21 12:42:12 -07:00
2016-03-15 15:19:23 -04:00
2016-05-24 11:42:05 -05:00
2016-07-27 16:29:56 -06:00
2016-07-27 16:29:56 -06:00
2016-04-08 15:42:10 -07:00
2016-01-21 20:42:36 -07:00
2016-01-21 20:42:34 -07:00
2016-05-23 15:18:00 +08:00
2016-07-14 20:40:24 -06:00
2016-03-14 15:34:50 -06:00
2016-06-19 17:05:55 -06:00
2016-06-19 17:05:55 -06:00
2016-03-14 15:34:50 -06:00
2016-03-14 15:34:50 -06:00
2016-03-14 15:34:50 -06:00
2016-09-20 06:46:01 +09:00
2016-05-27 15:47:54 -04:00
2016-08-17 10:25:35 +09:00
2016-08-17 10:25:34 +09:00
2016-02-21 13:42:52 +08:00
2016-01-19 08:31:21 -05:00
2016-09-22 01:02:28 +05:30
2016-07-22 09:53:00 -04:00
2016-07-26 08:47:37 +02:00
2016-02-23 20:50:07 +01:00
2016-07-14 20:40:24 -06:00
2016-05-26 20:48:31 -06:00
2016-02-26 08:53:10 -07:00
2016-01-28 12:23:19 -06:00
2016-03-15 15:12:57 -04:00
2016-03-14 15:34:50 -06:00
2016-07-22 09:53:00 -04:00
2016-01-23 16:22:34 +01:00
2016-03-14 15:34:50 -06:00
2016-05-17 09:54:43 -06:00
2016-05-02 18:37:09 -04:00
2016-09-20 09:30:23 -04:00
2016-01-30 10:55:37 +01:00
2016-05-25 13:25:18 +09:00
2016-01-28 12:22:19 -06:00
2016-08-20 11:34:59 -04:00
2016-01-25 10:39:47 -05:00
2016-05-27 15:39:54 -04:00
2016-01-28 13:53:30 +08:00
2016-09-22 07:33:21 +02:00
2016-03-14 15:34:50 -06:00
2016-09-22 07:33:21 +02:00