net: dsa: Discard frames from unused ports
authorAndrew Lunn <[email protected]>
Sat, 7 Apr 2018 18:37:40 +0000 (20:37 +0200)
committerDavid S. Miller <[email protected]>
Sun, 8 Apr 2018 14:34:49 +0000 (10:34 -0400)
commitfc5f33768cca7144f8d793205b229d46740d183b
treed78a133561ac517c10aae6b2baa1d505388fd6df
parent6780db244d6b1537d139dea0ec8aad10cf9e4adb
net: dsa: Discard frames from unused ports

The Marvell switches under some conditions will pass a frame to the
host with the port being the CPU port. Such frames are invalid, and
should be dropped. Not dropping them can result in a crash when
incrementing the receive statistics for an invalid port.

Reported-by: Chris Healy <[email protected]>
Fixes: 91da11f870f0 ("net: Distributed Switch Architecture protocol support")
Signed-off-by: Andrew Lunn <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/dsa/dsa_priv.h