From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 102D0343D66; Mon, 20 Apr 2026 16:09:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776701399; cv=none; b=Wk1DwbE97jgEPmeLRmHIcpb03NioZ3JwsDVeIu/Gy/fzRIKfhqaJ0HDXAsH78ZqcWL3j5FnW4KPOFd87zDI+1Yi3tgJZGUauLttHxCnjPEx5JG9c+73gPnLiXVyDNPE3ev8L8W7ghS3FHC5T5nmAW3u9v9/0ciT3oWGjgpDipZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776701399; c=relaxed/simple; bh=JN6ih24G9fI9KtSU+MGtygPCv21y051mZhjv5arIoQE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OCVjKEtRkrrR2sWztYFnUwU8D73L1XxMIXXcaF9daHqHQhTUynSE/pdOZoKeaNVqrkBBSeluFfRg9EcwcmjiTVgp6DJDDsBtAgqI0KSBMYM5nyEN5DXAr7KaMrbgbuj0U3p6LEzX6Hcc8//Kq8mTLaOy/IqfejGWQwOPv+JHiyk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dv3Tf231; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="dv3Tf231" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93D0DC19425; Mon, 20 Apr 2026 16:09:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776701398; bh=JN6ih24G9fI9KtSU+MGtygPCv21y051mZhjv5arIoQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dv3Tf231HkiPuBoU0LsPeZRxvSNrzahoikigNfrfO935iNGAILsPjTnpSPJjQ1KHW K/o/lWE7QK2u1td7P6JTKHFGM88q37jn5U/p805Uc8FlW9VkLFs/wDoohioMAtHi4g NhlFbUjm8GOpZJjowc206jJ4Fx8argyLSLgJEtN0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , stable Subject: [PATCH 6.12 099/162] net: usb: cdc-phonet: fix skb frags[] overflow in rx_complete() Date: Mon, 20 Apr 2026 17:42:11 +0200 Message-ID: <20260420153930.624902557@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260420153927.006696811@linuxfoundation.org> References: <20260420153927.006696811@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greg Kroah-Hartman commit 600dc40554dc5ad1e6f3af51f700228033f43ea7 upstream. 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. Cc: Andrew Lunn Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: stable Assisted-by: gregkh_clanker_t1000 Signed-off-by: Greg Kroah-Hartman Link: https://patch.msgid.link/2026041134-dreamboat-buddhism-d1ec@gregkh Fixes: 87cf65601e17 ("USB host CDC Phonet network interface driver") Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/cdc-phonet.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c @@ -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 */