[U-Boot] [PATCH] net: tftp: Fix tftp store address check in store_block()

Bin Meng bmeng.cn at gmail.com
Sat Nov 16 06:19:37 UTC 2019


On Sat, Nov 16, 2019 at 2:17 PM Bin Meng <bmeng.cn at gmail.com> wrote:
>
> During testing of qemu-riscv32 with a 2GiB memory configuration,
> tftp always fails with a error message:
>
>   Load address: 0x84000000
>   Loading: #
>   TFTP error: trying to overwrite reserved memory...
>
> It turns out the result of 'tftp_load_addr + tftp_load_size' just
> overflows (0x100000000) and the test logic in store_block() fails.
> Fix this by adjusting the end address to ULONG_MAX when overflow
> is detected.
>
> Fixes: a156c47e39ad ("tftp: prevent overwriting reserved memory")
> Signe-off-by: Bin Meng <bmeng.cn at gmail.com>

Oops, not sure how this was messed up. Will resend.

> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> ---
>
>  net/tftp.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>

Regards,
Bin


More information about the U-Boot mailing list