]> 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:28:06 +0000 (13:28 +0100)
commit11da8fc9bdf8235c049d64cd23106b2194d80895
tree63015e8466009dcbdfaa55d5c60456d9b5818aa3
parent1d7da490bae879679b1e8b78f4ca44214a5fe623
net: usb: smsc75xx: Move packet length check to prevent kernel panic in skb_pull

[ Upstream commit 43ffe6caccc7a1bb9d7442fbab521efbf6c1378c ]

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: d8b228318935 ("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