]> git.dujemihanovic.xyz Git - u-boot.git/commit
i2c: fix stack buffer overflow vulnerability in i2c md command
authorMarek Vasut <marex@denx.de>
Fri, 26 Aug 2022 21:15:56 +0000 (23:15 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 31 Aug 2022 16:21:47 +0000 (12:21 -0400)
commite4573fef7701afc2df22924ce0a445b923475afc
tree20d34ecf4bfa236f68695afac4fff5dc57384b67
parent1aa9a04ff687b8d55b0fb68ae2a688c8705665cc
i2c: fix stack buffer overflow vulnerability in i2c md command

This reinstates fix from commit 8f8c04bf1ebb ("i2c: fix stack buffer
overflow vulnerability in i2c md command") without the changes unrelated
to the actual fix. Avoid the underflow by setting only nbytes and
linebytes as unsigned integers.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Nicolas Iooss <nicolas.iooss+uboot@ledger.fr>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tim Harvey <tharvey@gateworks.com>
Acked-by: Tim Harvey <tharvey@gateworks.com>
cmd/i2c.c