Skip to content

Commit c036859

Browse files
Colin Ian Kingdavem330
authored andcommitted
net: systemport: fix index check to avoid an array out of bounds access
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: bb9051a ("net: systemport: Add support for WAKE_FILTER") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9d0e0cd commit c036859

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ static int bcm_sysport_rule_set(struct bcm_sysport_priv *priv,
21352135
return -ENOSPC;
21362136

21372137
index = find_first_zero_bit(priv->filters, RXCHK_BRCM_TAG_MAX);
2138-
if (index > RXCHK_BRCM_TAG_MAX)
2138+
if (index >= RXCHK_BRCM_TAG_MAX)
21392139
return -ENOSPC;
21402140

21412141
/* Location is the classification ID, and index is the position

0 commit comments

Comments
 (0)