From: Yu Gao <SuperSkidder@qq.com>
To: Martin Schiller <ms@dev.tdt.de>, netdev@vger.kernel.org
Cc: linux-x25@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Xie He <xie.he.0141@gmail.com>, Hillf Danton <hdanton@sina.com>,
syzbot+059a2795ad4cff2a2695@syzkaller.appspotmail.com,
syzbot+8328573e4d0514392471@syzkaller.appspotmail.com,
Yu Gao <SuperSkidder@qq.com>
Subject: [PATCH net 2/2] net: lapbether: use lockless TX
Date: Wed, 25 Nov 2026 12:59:09 +0800 [thread overview]
Message-ID: <tencent_1010BAB1E5DD6485DC34EE706951175FEE08@qq.com> (raw)
In-Reply-To: <20261125045909.77644-1-SuperSkidder@qq.com>
The core calls lapbeth_xmit() with the TX lock of the lapbeth device
held, and lapbeth_xmit() calls into LAPB, which looks up the device
under lapb_list_lock. lapb_unregister() takes lapb->lock with
lapb_list_lock held for writing, and LAPB transmits frames with
lapb->lock held. When the Ethernet device under a lapbeth device is a
tunnel whose packets are routed through a lapbeth device, such a frame
is passed to dev_queue_xmit() on that device, which takes its TX lock
under lapb->lock. With up_lock gone, the syzbot reproducer for a
possible deadlock in lapb_connect_request() still reports this cycle:
lapb_list_lock --> &lapb->lock --> _xmit_X25#2
lapbeth_xmit() does not need the TX lock. Data frames are handed to
LAPB, which serializes each device with lapb->lock, and connect and
disconnect notifications are queued on the locked rx_queue. Set lltx
so that the core does not take the TX lock around lapbeth_xmit().
Without the TX lock, the core no longer detects a frame that loops
back into the same lapbeth device on the TX path. If such a frame
reaches LAPB, it now deadlocks on lapb->lock, as it already does when
LAPB sends it from a timer or from the receive path. Only frames that
start with 0x00, 0x01 or 0x02 reach LAPB, so a frame looped back
through IPv4 or IPv6 routing is simply dropped.
Fixes: b491e6a7391e ("net: lapb: Add locking to the lapb module")
Reported-by: syzbot+8328573e4d0514392471@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=8328573e4d0514392471
Signed-off-by: Yu Gao <SuperSkidder@qq.com>
---
drivers/net/wan/lapbether.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index b4dde9b..c7496c7 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -364,6 +364,11 @@ static void lapbeth_setup(struct net_device *dev)
dev->hard_header_len = 0;
dev->mtu = 1000;
dev->addr_len = 0;
+ /* LAPB serializes transmission under its own lock and may transmit
+ * through another lapbeth device while holding it, so the TX lock
+ * must not be taken around lapbeth_xmit().
+ */
+ dev->lltx = true;
}
/* Setup a new device.
--
2.54.0 (Apple Git-157)
next prev parent reply other threads:[~2026-11-25 4:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261125045909.77644-1-SuperSkidder@qq.com>
2026-11-25 4:59 ` [PATCH net 1/2] net: lapbether: don't hold up_lock while calling into LAPB Yu Gao
2026-11-25 9:27 ` Martin Schiller
2026-11-25 4:59 ` Yu Gao [this message]
2026-11-25 9:28 ` [PATCH net 2/2] net: lapbether: use lockless TX Martin Schiller
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=tencent_1010BAB1E5DD6485DC34EE706951175FEE08@qq.com \
--to=superskidder@qq.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hdanton@sina.com \
--cc=kuba@kernel.org \
--cc=linux-x25@vger.kernel.org \
--cc=ms@dev.tdt.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+059a2795ad4cff2a2695@syzkaller.appspotmail.com \
--cc=syzbot+8328573e4d0514392471@syzkaller.appspotmail.com \
--cc=xie.he.0141@gmail.com \
/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