From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 4 May 2020 07:27:49 -0400 Subject: [PATCH V2] mkimage: fit: Do not tail-pad fitImage with external data In-Reply-To: <20200501154026.79169-1-marex@denx.de> References: <20200501154026.79169-1-marex@denx.de> Message-ID: <20200504112749.GE12564@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, May 01, 2020 at 05:40:25PM +0200, Marek Vasut wrote: > 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 > Reviewed-by: Simon Glass > Cc: Heinrich Schuchardt > Cc: Tom Rini Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: