]> git.baikalelectronics.ru Git - kernel.git/commit
net/wan/fsl_ucc_hdlc: fix out of bounds write on array utdm_info
authorColin Ian King <colin.king@canonical.com>
Tue, 14 Jan 2020 14:54:48 +0000 (14:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jan 2020 22:05:54 +0000 (23:05 +0100)
commita452bb17e95017d6652534877143091346a118b5
tree59d5ba99ce47226a07c75cfacff06ea1c444a980
parentc1a69466d19fe46bdf65330d5450cca576bb9719
net/wan/fsl_ucc_hdlc: fix out of bounds write on array utdm_info

Array utdm_info is declared as an array of MAX_HDLC_NUM (4) elements
however up to UCC_MAX_NUM (8) elements are potentially being written
to it.  Currently we have an array out-of-bounds write error on the
last 4 elements. Fix this by making utdm_info UCC_MAX_NUM elements in
size.

Addresses-Coverity: ("Out-of-bounds write")
Fixes: 0e2bc9d1ba7f ("drivers/net: support hdlc function for QE-UCC")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/fsl_ucc_hdlc.c