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 584B64E4C5E; Thu, 17 Sep 2026 15:44:48 +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=1789659894; cv=none; b=G5BCqDfHhFP7a1cG0WB7TVQ8fGeWvRHDqABbAN9NlUcpwiiX/7jw17fDrwsNfdr9ci+2N9FzMoJQKJVhXCaz0ltnHagcbs8l/1GF327Wytsuu+0ebIuMYVOumy03+T3QyaJ7oj7SyCfBiEaTouqdRE4h0Si0GxG866JyFQauc2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789659894; c=relaxed/simple; bh=nVy3LCn9xRHRFjWqGSEpOsEZLOWRZFqbC1aM9Rnco8E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X99xb4R/HOXK6N9AoaHOcfmICVL8eBGVLmyQBf/nUSqdgyjPosOMLEoGDq9JmcXbGLcELNhnyNeFACDNDxOyBfv4ZpfC9QExzJhS1By+nBxfNtsFpUN4BlbHcdYt2SW41AFhyvHf5Gxyb4BJoiIyi/a7ztmmbxdg8qJ/FL1Vk8c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fdohib6d; 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="fdohib6d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E4E91F00893; Thu, 17 Sep 2026 15:44:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789659887; bh=O2YMziWDZ6AhJ2mxDnG6Dk8X/ByhxENF06qSSyzTcVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fdohib6dPBVFd7+rd+QHng0mL/u8/Ym2zI49wjizwSUyEJjwiz3dS5BweGVmEoTvl QczLrUV/uO+THaGfzNR2KhvwQ2jk5FMgDLYUF2mJ9U4mqcg0kh3w7gdwvRN6fuf2vq rCVARBdj7glz5KsVGV3RTtRE7CpElcIRwwv/0dlk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Qingfang Deng , Eric Dumazet , Jakub Kicinski , Sasha Levin Subject: [PATCH 7.2 406/733] ppp_synctty: ensure a writeable skb header Date: Thu, 17 Sep 2026 16:11:54 +0100 Message-ID: <20260917151401.872163845@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151350.597953846@linuxfoundation.org> References: <20260917151350.597953846@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 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Qingfang Deng [ Upstream commit 8aaeb56aff2a557a88f83ae866da2c91ad247e59 ] ppp_sync_txmunge() checks headroom before prepending the address and control bytes, but does not ensure that the skb header is writable. A received skb can reach this function through PPP channel bridging without passing through ppp_start_xmit(), which calls skb_cow_head(). For example, a PPPoE frame may share its buffer with a clone queued to an AF_PACKET socket. If it is bridged to a synchronous tty channel, the address/control bytes can overwrite data still visible to that socket. Use skb_cow_head() to ensure both sufficient headroom and a writable header. Fixes: 4cf476ced45d ("ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls") Signed-off-by: Qingfang Deng Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20260908072135.877364-1-qingfang.deng@linux.dev Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ppp/ppp_synctty.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/net/ppp/ppp_synctty.c b/drivers/net/ppp/ppp_synctty.c index 0208e752ef1eb..1b64e610f9609 100644 --- a/drivers/net/ppp/ppp_synctty.c +++ b/drivers/net/ppp/ppp_synctty.c @@ -457,17 +457,9 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb) /* prepend address/control fields if necessary */ if ((ap->flags & SC_COMP_AC) == 0 || islcp) { - if (skb_headroom(skb) < 2) { - struct sk_buff *npkt = dev_alloc_skb(skb->len + 2); - if (npkt == NULL) { - kfree_skb(skb); - return NULL; - } - skb_reserve(npkt,2); - skb_copy_from_linear_data(skb, - skb_put(npkt, skb->len), skb->len); - consume_skb(skb); - skb = npkt; + if (skb_cow_head(skb, 2)) { + kfree_skb(skb); + return NULL; } skb_push(skb,2); skb->data[0] = PPP_ALLSTATIONS; -- 2.53.0