From: Tung Quang Nguyen <tung.quang.nguyen@est.tech>
To: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"horms@kernel.org" <horms@kernel.org>,
"tipc-discussion@lists.sourceforge.net"
<tipc-discussion@lists.sourceforge.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"syzbot+0017742620a9d06f06ef@syzkaller.appspotmail.com"
<syzbot+0017742620a9d06f06ef@syzkaller.appspotmail.com>,
"jmaloy@redhat.com" <jmaloy@redhat.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [PATCH] tipc: unshare skb in tipc_l2_rcv_msg() before decrypting
Date: Mon, 19 Oct 2026 05:01:56 +0000 [thread overview]
Message-ID: <AM7P189MB1137394C7B76344EB2EB5506C6982@AM7P189MB1137.EURP189.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20261018145928.58317-1-ngocthang2710.1999@gmail.com>
>Subject: [PATCH] tipc: unshare skb in tipc_l2_rcv_msg() before decrypting
net tree needs to be specified for bug fix.
>
>Packet taps such as AF_PACKET sockets bound to ETH_P_TIPC take an extra
>reference on the skb before handing it to the TIPC packet handler.
>tipc_l2_rcv_msg() passes it on as is, and for an encrypted message
>tipc_aead_decrypt() calls skb_cow_data(), which may end up in
>pskb_expand_head() and hit BUG_ON(skb_shared(skb)):
>
> kernel BUG at net/core/skbuff.c:2308!
> pskb_expand_head
> __pskb_pull_tail
> skb_cow_data
> tipc_aead_decrypt
> tipc_crypto_rcv
> tipc_rcv
> tipc_l2_rcv_msg
> __netif_receive_skb_core
>
>A packet_type handler must not modify a shared skb. Use
>skb_share_check() on entry, which clones a shared skb and frees the original
>reference.
>
>Reported-by: syzbot+0017742620a9d06f06ef@syzkaller.appspotmail.com
>Closes: https://syzkaller.appspot.com/bug?extid=0017742620a9d06f06ef
>Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication")
Fixes tag does not seem correct.
>Cc: stable@vger.kernel.org
>Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
>---
> net/tipc/bearer.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index
>05dcd2f9e887..5e7e220fa7f5 100644
>--- a/net/tipc/bearer.c
>+++ b/net/tipc/bearer.c
>@@ -659,6 +659,10 @@ static int tipc_l2_rcv_msg(struct sk_buff *skb, struct
>net_device *dev, {
> struct tipc_bearer *b;
>
>+ skb = skb_share_check(skb, GFP_ATOMIC);
This solution is incorrect and incomplete because:
1. skb_share_check() clones a new skb that shares data part with TIPC while TIPC needs to modify the data part.
2. Checking shared skb in ethernet bearer callback is not enough as we still have udp callback.
As I was working on this issue at the time you posted your patch, I will send the correct and complete patch.
>+ if (!skb)
>+ return NET_RX_DROP;
>+
> rcu_read_lock();
> b = rcu_dereference(dev->tipc_ptr) ?:
> rcu_dereference(orig_dev->tipc_ptr);
>--
>2.43.0
prev parent reply other threads:[~2026-10-19 5:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 14:59 Nguyen Ngoc Thang
2026-10-19 5:01 ` Tung Quang Nguyen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AM7P189MB1137394C7B76344EB2EB5506C6982@AM7P189MB1137.EURP189.PROD.OUTLOOK.COM \
--to=tung.quang.nguyen@est.tech \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jmaloy@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ngocthang2710.1999@gmail.com \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=syzbot+0017742620a9d06f06ef@syzkaller.appspotmail.com \
--cc=tipc-discussion@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®