]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: Add a check for oversized packets
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 27 Jan 2023 00:08:19 +0000 (16:08 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:55 +0000 (16:43 +0100)
commit74acb090831ad60a77bbec8d32c9683c9219d7d4
treeb9a8bd9ffb4c1d15b7ec4bc25d42766cf66bcc8b
parenta2f777bb6eb5120157aaefc00e9b917979e72ff7
net: bcmgenet: Add a check for oversized packets

[ Upstream commit 5c0862c2c962052ed5055220a00ac1cefb92fbcd ]

Occasionnaly we may get oversized packets from the hardware which
exceed the nomimal 2KiB buffer size we allocate SKBs with. Add an early
check which drops the packet to avoid invoking skb_over_panic() and move
on to processing the next packet.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/genet/bcmgenet.c