mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
net: dsa: sja1105: Check return value
[ Upstream commit8948876335] Return NULL if we got unexpected value from skb_trim_rcsum() in sja1110_rcv_inband_control_extension() Fixes:4913b8ebf8("net: dsa: add support for the SJA1110 native tagging protocol") Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20221201140032.26746-3-artem.chernyshev@red-soft.ru Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b749cb7a8d
commit
e53e257f3c
@@ -665,7 +665,8 @@ static struct sk_buff *sja1110_rcv_inband_control_extension(struct sk_buff *skb,
|
||||
* padding and trailer we need to account for the fact that
|
||||
* skb->data points to skb_mac_header(skb) + ETH_HLEN.
|
||||
*/
|
||||
pskb_trim_rcsum(skb, start_of_padding - ETH_HLEN);
|
||||
if (pskb_trim_rcsum(skb, start_of_padding - ETH_HLEN))
|
||||
return NULL;
|
||||
/* Trap-to-host frame, no timestamp trailer */
|
||||
} else {
|
||||
*source_port = SJA1110_RX_HEADER_SRC_PORT(rx_header);
|
||||
|
||||
Reference in New Issue
Block a user