]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: bcm_sf2: Fix RX_CLS_LOC_ANY overwrite for last rule
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 15 May 2018 23:01:23 +0000 (16:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2018 18:11:22 +0000 (14:11 -0400)
commit6d64153469b95b4eceef5a2e9ae048162cab85bd
tree76373179f27fac7fc28f5cadf60546fe9750f9af
parent75e6f27cf74edf8ac6956406595030aef10d2001
net: dsa: bcm_sf2: Fix RX_CLS_LOC_ANY overwrite for last rule

When we let the kernel pick up a rule location with RX_CLS_LOC_ANY, we
would be able to overwrite the last rules because of a number of issues.

The IPv4 code path would not be checking that rule_index is within
bounds, and it would also only be allowed to pick up rules from range
0..126 instead of the full 0..127 range. This would lead us to allow
overwriting the last rule when we let the kernel pick-up the location.

Fixes: d45bbb01cbbd ("net: dsa: bcm_sf2: Move IPv4 CFP processing to specific functions")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2_cfp.c