net: systemport: fix index check to avoid an array out of bounds access
[ Upstream commitc0368595c1] 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:bb9051a2b2("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>
This commit is contained in:
parent
ba245652e1
commit
c8149165ac
1 changed files with 1 additions and 1 deletions
|
|
@ -2168,7 +2168,7 @@ static int bcm_sysport_rule_set(struct bcm_sysport_priv *priv,
|
|||
return -ENOSPC;
|
||||
|
||||
index = find_first_zero_bit(priv->filters, RXCHK_BRCM_TAG_MAX);
|
||||
if (index > RXCHK_BRCM_TAG_MAX)
|
||||
if (index >= RXCHK_BRCM_TAG_MAX)
|
||||
return -ENOSPC;
|
||||
|
||||
/* Location is the classification ID, and index is the position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue