]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: ipmi: fix off-by-one bounds check that leads to a out-of-bounds write
authorColin Ian King <colin.king@canonical.com>
Tue, 14 Jan 2020 14:40:31 +0000 (14:40 +0000)
committerCorey Minyard <cminyard@mvista.com>
Mon, 20 Jan 2020 17:01:00 +0000 (11:01 -0600)
commitfba362b2d37a5103f28b1d4c9b765023d7eef8ed
tree8cfed2b3cc8af82ff6a424a19f70c3c18ba79bfc
parent3810faabc0e80568c1143ccf690531db591ca850
drivers: ipmi: fix off-by-one bounds check that leads to a out-of-bounds write

The end of buffer check is off-by-one since the check is against
an index that is pre-incremented before a store to buf[]. Fix this
adjusting the bounds check appropriately.

Addresses-Coverity: ("Out-of-bounds write")
Fixes: 79a53c1b3d0b ("Add support for IPMB driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Message-Id: <20200114144031.358003-1-colin.king@canonical.com>
Reviewed-by: Asmaa Mnebhi <asmaa@mellanox.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/ipmb_dev_int.c