Eugeniu Rosca
e63bf1b13b
common: image-android-dt: Fix out-of-bounds access
Currently, 'dtimg' allows users to check indexes equal to
dt_entry_count [1]. Forbid that [2].
[1] Behavior w/o the patch:
=> ext2load mmc 0:1 0x48000000 dtb.img
105695 bytes read in 5 ms (20.2 MiB/s)
=> dtimg dump 0x48000000
dt_table_header:
magic = d7b7ab1e
total_size = 105695
header_size = 32
dt_entry_size = 32
dt_entry_count = 2
dt_entries_offset = 32
page_size = 4096
version = 0
dt_table_entry[0]:
dt_size = 105599
dt_offset = 96
id = 0b779520
rev = 00000000
custom[0] = 00000000
custom[1] = 00000000
custom[2] = 00000000
custom[3] = 00000000
(FDT)size = 105599
(FDT)compatible = shimafuji,kingfisher
dt_table_entry[1]:
dt_size = 105599
dt_offset = 96
id = 0b779530
rev = 00000000
custom[0] = 00000000
custom[1] = 00000000
custom[2] = 00000000
custom[3] = 00000000
(FDT)size = 105599
(FDT)compatible = shimafuji,kingfisher
=> dtimg size 0x48000000 0 z; print z
z=19c7f
=> dtimg size 0x48000000 1 z; print z
z=19c7f
=> dtimg size 0x48000000 2 z; print z
z=d00dfeed
=> dtimg size 0x48000000 3 z
Error: index > dt_entry_count (3 > 2)
[2] Behavior with the patch:
=> dtimg size 0x48000000 0 z; print z
z=19c7f
=> dtimg size 0x48000000 1 z; print z
z=19c7f
=> dtimg size 0x48000000 2 z
Error: index >= dt_entry_count (2 >= 2)
Fixes: c044733457
("common: Add support for Android DT image")
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
2019-03-22 12:15:18 -04:00
..
2018-11-26 08:25:37 -05:00
2019-03-22 12:15:05 -04:00
2018-10-07 11:07:25 -04:00
2018-11-26 08:25:32 -05:00
2018-12-05 15:06:24 -05:00
2019-02-09 07:50:58 -05:00
2018-12-31 08:08:51 -05:00
2019-02-13 09:40:06 +01:00
2018-09-10 20:20:34 -04:00
2019-01-26 08:13:55 -05:00
2019-01-15 15:38:28 -05:00
2018-11-09 10:44:50 -05:00
2018-11-26 08:25:36 -05:00
2018-11-20 19:14:22 -07:00
2018-12-07 16:31:45 +01:00
2019-01-14 17:47:13 -07:00
2018-12-08 20:18:44 -05:00
2019-03-22 12:15:18 -04:00
2019-03-08 11:31:44 -05:00
2018-12-03 10:44:10 -05:00
2018-12-03 10:44:10 -05:00
2019-01-01 14:12:18 +01:00
2019-02-22 19:49:41 -05:00
2018-12-04 19:47:20 +01:00
2019-02-20 15:21:44 +08:00
2018-12-06 23:26:30 -05:00
2019-02-15 22:01:15 +01:00
2018-11-29 09:30:05 -07:00
2018-10-24 14:45:36 -05:00
2018-11-26 21:19:03 +01:00
2018-11-26 21:19:03 +01:00
2018-11-26 21:19:04 +01:00
2018-11-26 21:19:03 +01:00
2019-01-15 15:28:51 -05:00