]> 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)
commit5ce7bfee067fe3f2d1547dded27606d29bdcd540
tree76373179f27fac7fc28f5cadf60546fe9750f9af
parent386a22f2fa6ad73e7aaea84545caa6ba2a1ac615
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: 4feae69f130b ("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