]> git.baikalelectronics.ru Git - uboot.git/commit
Revert "i2c: fix stack buffer overflow vulnerability in i2c md command"
authorMarek Vasut <marex@denx.de>
Fri, 26 Aug 2022 21:15:55 +0000 (23:15 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 31 Aug 2022 16:21:31 +0000 (12:21 -0400)
commit35dcb8e5dab16bc5a668ea9ec4350b102acd37df
tree91c54c3e0915ee095705e9d203d1528dff423bed
parenta7edbf247341b4e6dcd5c5919296e8c0f7f300ce
Revert "i2c: fix stack buffer overflow vulnerability in i2c md command"

This reverts commit fa6d02c7221e1e25b482004ef839ad3cbb8b56c8.

The commit is largely wrong and breaks most of i2c command functionality.
The problem described in the aforementioned commit commit message is valid,
however the commit itself does many more changes unrelated to fixing that
one problem it describes. Those extra changes, namely the handling of i2c
device address length as unsigned instead of signed integer, breaks the
expectation that address length may be negative value. The negative value
is used by DM to indicate that address length of device does not change.

The actual bug documented in commit fa6d02c7221e1e25b482004ef839ad3cbb8b56c8
can be fixed by extra sanitization in separate patch.

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>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/i2c.c