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 95DCF399D0B; Thu, 17 Sep 2026 18:48:11 +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=1789670892; cv=none; b=A5FaPk2kgnjzs1+Rdb4Y2UF8/KqM6iOXLsb9GXe0MyNTQBj/pIMMLwG9LAT9O1ErlXj5RMJBpkzcSvQpqCgM/0YQdZ26crqjV9PNigL6sXgNhLT37/3VHYPo+DaF7Y/6oiqd/PRHeUQ6PWHrrMNh2HukUHc07aYlox31BdTIc3Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789670892; c=relaxed/simple; bh=KdFMhvyeFmoyWRrtw4EFTCEx6L7f2vlYtjlKdCBr0ac=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mOCM0/bpnzmsvYuo+IF5v06rYddGefVmqeCiUBJOgCgB5BwYd44xN3Qr48hs4bOEbZgqdT4DdPW7BWFdItPNfz/AKePpWAC3wPnBTsbaqpUkzWljYuyElZSfXjRn+rjZ6WDPuCcSAqUaCMKxl7iw4JKHU+5nOFSjWGuMFZQMTEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=E3o25xGn; 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="E3o25xGn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAFE41F000FF; Thu, 17 Sep 2026 18:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789670891; bh=MU7y+0BRF8ykk8uvK2sfOCj6ys4KWS7aQjD/tNmOPqs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E3o25xGnOuUNblp9Iv65hkOm5L2BgswB3eFoS64rIvc0T78w1kmUTvzQp87T/8leh zLRUzT5EPTHCNGs6TBixZxy4nzay9GSnkZaKizDpVV2c2Tr5kHO1j7aDfptopePKxT A7sKNdcxeibMZ7qOQniz6/EheT2qQV7qH3NaPaSE= 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 6.12 0766/1102] ppp_synctty: ensure a writeable skb header Date: Thu, 17 Sep 2026 16:11:49 +0100 Message-ID: <20260917151559.672937929@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151539.408551884@linuxfoundation.org> References: <20260917151539.408551884@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: 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 1a1eb029a531b..4514bcadd6eef 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