OSDN Git Service

net: systemport: fix index check to avoid an array out of bounds access
authorColin Ian King <colin.king@canonical.com>
Thu, 12 Mar 2020 15:04:30 +0000 (15:04 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 06:14:13 +0000 (07:14 +0100)
commitc8149165ac27482b575620c55fc91afe8832d8ad
tree5ad13bf13ca50d0aa346512da189c78940e0d597
parentba245652e198d706887412982c17ec666dd46fa7
net: systemport: fix index check to avoid an array out of bounds access

[ Upstream commit c0368595c1639947839c0db8294ee96aca0b3b86 ]

Currently the bounds check on index is off by one and can lead to
an out of bounds access on array priv->filters_loc when index is
RXCHK_BRCM_TAG_MAX.

Fixes: bb9051a2b230 ("net: systemport: Add support for WAKE_FILTER")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bcmsysport.c