]> git.baikalelectronics.ru Git - kernel.git/commit
net: usb: smsc75xx: Move packet length check to prevent kernel panic in skb_pull
authorSzymon Heidrich <szymon.heidrich@gmail.com>
Thu, 16 Mar 2023 11:05:40 +0000 (12:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:33:50 +0000 (13:33 +0100)
commitcb5045b575eb0f4c04a9dfaec52bd4c1acb6c92d
tree8f0d3fea7d36a20aaad9aa327a09e66e3a58b69a
parent64a01f6753aac00766e9728de51a14ae3d37fd82
net: usb: smsc75xx: Move packet length check to prevent kernel panic in skb_pull

[ Upstream commit 8a72cdee7e247e0fc3472d33ad34746d0b3e132a ]

Packet length check needs to be located after size and align_count
calculation to prevent kernel panic in skb_pull() in case
rx_cmd_a & RX_CMD_A_RED evaluates to true.

Fixes: 3c2ba0569ebc ("net: usb: smsc75xx: Limit packet length to skb->len")
Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Link: https://lore.kernel.org/r/20230316110540.77531-1-szymon.heidrich@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/usb/smsc75xx.c