]> git.baikalelectronics.ru Git - uboot.git/commit
fs: cbfs: Fix out of bound access during CBFS walking through
authorBin Meng <bmeng.cn@gmail.com>
Sat, 22 Dec 2018 09:55:49 +0000 (01:55 -0800)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 31 Dec 2018 01:42:41 +0000 (09:42 +0800)
commit91a8f160e334ddbc2d293fa3a2ed090ffae46ac6
tree605ef95dea5e6c7fb3c5c535196120d0e88484a5
parent09fbad49c45bbe4cb2e656ba55be7b079c5a3ab5
fs: cbfs: Fix out of bound access during CBFS walking through

The call to file_cbfs_fill_cache() is given with the parameter
'start' pointing to the offset by the CBFS base address, but
with the parameter 'size' that equals to the whole CBFS size.
During CBFS walking through, it checks files one by one and
after it pass over the end of the CBFS which is 4GiB boundary
it tries to check files from address 0 and so on, until the
overall size the codes checked hits to the given 'size'.

Fix this by passing 'start' pointing to the CBFS base address.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
fs/cbfs/cbfs.c