]> 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>
Fri, 10 Mar 2023 08:33:51 +0000 (09:33 +0100)
commita0938e825552fa37426e0839f83a8cceba5a80c4
tree938ab0067752f6487471546d2b6a7338f5001055
parent4bf7654cf3199ca59ff68c657c772aadc24983e8
net: bcmgenet: Add a check for oversized packets

[ Upstream commit c34009f98b64271c5ef905aa4e8f6ee0cf5c1efc ]

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