]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/net/dsa/bcm_sf2_cfp.c
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)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:29:58 +0000 (12:29 +0200)
commit3288e4f31b7714f5c804aa79229b3ee4acc56b5c
treec9dd9cfe7f2aed9d0584de8d41ba91d6cfac4994
parent00c3aa70c712c5f7758370e0cd719ac5e401305e
net: dsa: bcm_sf2: Fix RX_CLS_LOC_ANY overwrite for last rule

BugLink: http://bugs.launchpad.net/bugs/1783418
[ Upstream commit 43a5e00f38fe8933a1c716bfe5b30e97f749d94b ]

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: 3306145866b6 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/dsa/bcm_sf2_cfp.c