1
0
mirror of https://xff.cz/git/u-boot/ synced 2026-01-08 14:09:18 +01:00
Files
u-boot-megous/tools
Marek Vasut 20a154f95b mkimage: fit: Do not tail-pad fitImage with external data
There is no reason to tail-pad fitImage with external data to 4-bytes,
while fitImage without external data does not have any such padding and
is often unaligned. DT spec also does not mandate any such padding.

Moreover, the tail-pad fills the last few bytes with uninitialized data,
which could lead to a potential information leak.

$ echo -n xy > /tmp/data ; \
	./tools/mkimage -E -f auto -d /tmp/data /tmp/fitImage ; \
	hexdump -vC /tmp/fitImage | tail -n 3

before:
00000260  61 2d 6f 66 66 73 65 74  00 64 61 74 61 2d 73 69  |a-offset.data-si|
00000270  7a 65 00 00 78 79 64 64                           |ze..xydd|
                   ^^       ^^ ^^
after:
00000260  61 2d 6f 66 66 73 65 74  00 64 61 74 61 2d 73 69  |a-offset.data-si|
00000270  7a 65 00 78 79                                    |ze.xy|

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Tom Rini <trini@konsulko.com>
2020-05-04 07:26:57 -04:00
..
2020-04-26 14:25:21 -06:00
2020-04-26 14:25:21 -06:00
2020-04-26 14:25:21 -06:00
2019-10-08 16:35:59 +02:00
2020-04-26 14:25:21 -06:00
2019-12-06 16:44:20 -05:00
2019-07-29 00:20:31 +02:00
2020-04-26 14:25:21 -06:00
2009-04-28 01:16:46 +02:00
2019-11-04 18:15:32 -07:00
2020-04-26 14:25:21 -06:00