From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4AC0933F8A4; Sat, 30 May 2026 16:29:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780158559; cv=none; b=mCHrDR+rlRzooCLqcrXACwdz5/f54kMSpTWh2Ljs+YTZ7eXer/twCElAOVjHiSSqoFU4Qf/FzyJSGC+AFpgw5kUdTBwM2ROaCzSPpN/uw+P7g2TBwsm5luPV9YEkJnJB5LXhOduhC7zeTK93IruHM0GfWIeKiza5qTOJFqo0N84= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780158559; c=relaxed/simple; bh=gSopnPRNNlRFcgWWs+ShXMeN75UsUE1PuPfb15AWCms=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CCe9BxdkGJQ1jh8bIU3VK5mvuBdVvk4b03rM2/jF4d9pZCCJx5TEYbgdZobZCthQmzehn5YX0Xe6Ucf2YYNUI9Fkr972HJnhWckJftEY7lFvA0jHnYAELnKGtmdx7gSs/DGSri2Fq6eTmGvnIYL+oFGnG0XW3uZ8WsFkVxOWKAc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NkTyNnhG; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NkTyNnhG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C9BE1F00893; Sat, 30 May 2026 16:29:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780158558; bh=x34wlP6I+PBV2D390VWGQdtSzkKBn0O4ahLDtsLD1/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NkTyNnhGl7a34xfO6CfmK74VGZ8svtFYy6aR8ZE/o+XcBrTkICGvc1YzvMIfE2qWG 5VTuzjzPuRGHdDcQVz9xo0OMli9Wzdjnp0eew4yg4fdcy0GKvmG0kljgkmQos6H1rh 2Bs6SSNnr1k8e2h+yOvbKHzYbalrsfC53XIpEibI= 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.1 062/969] net: usb: cdc-phonet: fix skb frags[] overflow in rx_complete() Date: Sat, 30 May 2026 17:53:06 +0200 Message-ID: <20260530160302.095398848@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@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.1-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 */