From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpbgbr1.qq.com (smtpbgbr1.qq.com [54.207.19.206]) (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 0DC861E492D for ; Tue, 12 May 2026 15:24:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.207.19.206 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778599503; cv=none; b=au8Elmcc2+TIE34PiQEyeyOfXwA/DF+QaT4Mtqiy3CiFjQjooEwDtXI6leDWF6MJvUhAOY4YdKENFInQ7at4XOrI2gMWraWlUsURIgIqLjBQXdi13E3brotX6cV3s1sBkLHkBrX7G70HvFnpTxiwLV1cFlmxuxnAabJorLtfm5k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778599503; c=relaxed/simple; bh=quxPGs9nzfnwYzvHhlGTKV1dPXCu/5sBJrYGsmupLS4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bX5c3ZdSlgQbqQolLC6h6B86vjnd5sdoM283rixf8qQMZDQ9caOdjuEPbco4bVbUg4IreRnAT3nDQWnrBnH8xna4IfWSPcDFq7DWdMWL1DCdm09SBV1YSYv4FHTl1ZqKqd3QFvQcWfC4HUto8d6dPkUvFCWlRKINq/+gDfnoc5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=YP5wdFNK; arc=none smtp.client-ip=54.207.19.206 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="YP5wdFNK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1778599435; bh=CmMW71TcGznMQd1FUH7r+qTpc8wT8PJeTCg1K5xQzN0=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=YP5wdFNK9/iE9NwfVv6mMO2iBkK/Xpm/UeSxX8nWr/02U6psf/we/XjTTZsnvMDtz FoFDvog9zi0tdEJl/J9+ENtN9k50dYFd4H0UxUCSpC0Ddhr+jwGENnnepidlqodHmK WyLViX/WptyO0Aue5Nq2TUpn7vJBKuW41JdVJ4Y0= X-QQ-mid: zesmtpip4t1778599430t016fe8a8 X-QQ-Originating-IP: huR6NJh4jYD4rEg+XI7X9vmhB1m7yOQQ0XblAWBOjMs= Received: from localhost.localdomain ( [localhost]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 12 May 2026 23:23:49 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 3217761544997056761 EX-QQ-RecipientCnt: 7 From: Wentao Guan To: gregkh@linuxfoundation.org Cc: dhowells@redhat.com, imv4bel@gmail.com, jiayuan.chen@linux.dev, stable@vger.kernel.org, torvalds@linux-foundation.org, Wentao Guan Subject: [PATCH 6.6.y 2/2] rxrpc: Also unshare DATA/RESPONSE packets when paged frags are present Date: Tue, 12 May 2026 23:22:31 +0800 Message-Id: <20260512152231.91032-1-guanwentao@uniontech.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <2026051113-sponge-uproar-1d30@gregkh> References: <2026051113-sponge-uproar-1d30@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: zesmtpip:uniontech.com:qybglogicsvrgz:qybglogicsvrgz3a-0 X-QQ-XMAILINFO: MMZ4zj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b+XuSEPszVD4EHDpYWume58pzE96tbtP0G6HzmnEbBi4= X-QQ-XMRINFO: Mp0Kj//9VHAxzExpfF+O8yhSrljjwrznVg== X-QQ-RECHKSPAM: 0 From: Hyunwoo Kim The DATA-packet handler in rxrpc_input_call_event() and the RESPONSE handler in rxrpc_verify_response() copy the skb to a linear one before calling into the security ops only when skb_cloned() is true. An skb that is not cloned but still carries externally-owned paged fragments (e.g. SKBFL_SHARED_FRAG set by splice() into a UDP socket via __ip_append_data, or a chained skb_has_frag_list()) falls through to the in-place decryption path, which binds the frag pages directly into the AEAD/skcipher SGL via skb_to_sgvec(). Extend the gate to also unshare when skb_has_frag_list() or skb_has_shared_frag() is true. This catches the splice-loopback vector and other externally-shared frag sources while preserving the zero-copy fast path for skbs whose frags are kernel-private (e.g. NIC page_pool RX, GRO). The OOM/trace handling already in place is reused. Fixes: d0d5c0cd1e71 ("rxrpc: Use skb_unshare() rather than skb_cow_data()") Cc: stable@vger.kernel.org Signed-off-by: Hyunwoo Kim Reviewed-by: Jiayuan Chen Acked-by: David Howells Signed-off-by: Linus Torvalds (cherry picked from commit aa54b1d27fe0c2b78e664a34fd0fdf7cd1960d71) Signed-off-by: Wentao Guan --- net/rxrpc/call_event.c | 4 +++- net/rxrpc/conn_event.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c index d6dfc7c08cf04..07b2d81145d62 100644 --- a/net/rxrpc/call_event.c +++ b/net/rxrpc/call_event.c @@ -461,7 +461,9 @@ bool rxrpc_input_call_event(struct rxrpc_call *call, struct sk_buff *skb) if (sp->hdr.type == RXRPC_PACKET_TYPE_DATA && sp->hdr.securityIndex != 0 && - skb_cloned(skb)) { + (skb_cloned(skb) || + skb_has_frag_list(skb) || + skb_has_shared_frag(skb))) { /* Unshare the packet so that it can be modified by * in-place decryption. */ diff --git a/net/rxrpc/conn_event.c b/net/rxrpc/conn_event.c index 6dcfaed1f7485..3a58fb9210383 100644 --- a/net/rxrpc/conn_event.c +++ b/net/rxrpc/conn_event.c @@ -231,7 +231,8 @@ static int rxrpc_verify_response(struct rxrpc_connection *conn, { int ret; - if (skb_cloned(skb)) { + if (skb_cloned(skb) || skb_has_frag_list(skb) || + skb_has_shared_frag(skb)) { /* Copy the packet if shared so that we can do in-place * decryption. */ -- 2.30.2