net: usb: cdc-phonet: fix skb frags[] overflow in rx_complete()
Subsystems (4)
Greg Kroah-Hartman
maintainerPATCH 1/1 net: usb: cdc-phonet: fix skb frags[] overflow in rx_complete()
A malicious USB device claiming to be a CDC Phonet modem can overflow the skb_shared_info->frags[] array by sending an unbounded sequence of full-page bulk transfers.
Drop the skb and increment the length error when the frag limit is reached. This matches the same fix that commit f0813bcd2d9d ("net:
wwan: t7xx: fix potential skb->frags overflow in RX path") did for the t7xx driver.
--- drivers/net/usb/cdc-phonet.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/usb/cdc-phonet.c +6 -1
@@ -157,11 +157,16 @@ static void rx_complete(struct urb *req) PAGE_SIZE); page =NULL ; } - }else { + }else if (skb_shinfo (skb)->nr_frags <MAX_SKB_FRAGS ) {skb_add_rx_frag (skb,skb_shinfo (skb)->nr_frags, page,0 , req->actual_length,PAGE_SIZE ); page =NULL ; + }else { +dev_kfree_skb_any (skb); + pnd->rx_skb =NULL ; + skb =NULL ; + dev->stats.rx_length_errors++; }if (req->actual_length <PAGE_SIZE ) pnd->rx_skb =NULL ;/* Last fragment */
Signature · 1 line
2.53.0
Paolo Abeni
maintainerQuoted 9 lines · Greg Kroah-Hartman
A malicious USB device claiming to be a CDC Phonet modem can overflow the skb_shared_info->frags[] array by sending an unbounded sequence of full-page bulk transfers.
Drop the skb and increment the length error when the frag limit is reached. This matches the same fix that commit
f0813bcd2d9d("net:
wwan: t7xx: fix potentialskb->fragsoverflow in RX path") did for the t7xx driver.
Quoted 8 lines
Cc Andrew Lunn <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>Cc stable <[email protected]>Assisted-by gregkh_clanker_t1000Signed-off-by Greg Kroah-Hartman <[email protected]>
It looks like the fixes tag should be:
Right?
/P
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:
Quoted 10 lines · On Sat, 11 Apr 2026 13:01:35 +0200 you wrote:
A malicious USB device claiming to be a CDC Phonet modem can overflow the skb_shared_info->frags[] array by sending an unbounded sequence of full-page bulk transfers.
Drop the skb and increment the length error when the frag limit is reached. This matches the same fix that commit
f0813bcd2d9d("net:
wwan: t7xx: fix potentialskb->fragsoverflow in RX path") did for the t7xx driver.[...]
Here is the summary with links:
- [net] net: usb: cdc-phonet: fix skb frags[] overflow in rx_complete()
https://git.kernel.org/netdev/net/c/600dc40554dc
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html