From: Shuai Liu <847807867@qq.com>
To: netdev@vger.kernel.org
Cc: ms@dev.tdt.de, linux-x25@vger.kernel.org,
syzbot+300375dfd44665f063a6@syzkaller.appspotmail.com,
847807867@qq.com
Subject: Re: [PATCH v3] x25: defer socket cleanup on link termination to process context
Date: Mon, 23 Nov 2026 18:39:22 +0800 [thread overview]
Message-ID: <tencent_72DC05B1DB892BF77B6916964DF9A3263907@qq.com> (raw)
In-Reply-To: <mid:11>
Hi Martin,
Thanks for the detailed test report - it settles the discussion. The
stalled-owner case is what I had missed: the deferred worker blocks in
lock_sock() until the owner releases the socket, so the window is as
long as the send buffer takes to fault in, not microseconds. My
"runs within microseconds" argument assumed nobody had the socket
locked, and the workqueue approach is the wrong tool here.
Please drop this patch. I will not send another version of it, and I'll
leave the fix to Thang's series.
The bh_lock_sock() pattern is clearly the better fit: clear immediately
when the socket is not owned, otherwise set X25_KILL_FLAG and disconnect
from release_cb, skip flagged sockets in __x25_find_socket() and in the
transmit path, and keep a sleeping sweep for NETDEV_DOWN, where the
device can be freed right after.
One thing that may be worth keeping in mind when you post it: in the
October thread sashiko pointed out that x25_make_new() copies the
parent's flags word (x25->flags = ox25->flags, af_x25.c:607) and only
clears X25_INTERRUPT_FLAG. If X25_KILL_FLAG lives in that word, a child
created while the parent is flagged inherits it, and the
__x25_find_socket() skip and the transmit block would then apply to the
child as well. The current posting may already handle this; I could not
tell from the thread.
I have the syzbot repro for this report (extid 300375dfd44665f063a6)
and a QEMU setup where it reproduces in under two minutes on current
mainline. If a Tested-by from that setup would be useful when you post
Thang's series, I'm happy to run it.
And noted, my mistake: new versions as a new thread with the version in
the patch subject, not as a reply to the previous posting.
Thanks,
Shuai
next prev parent reply other threads:[~2026-11-23 10:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 15:01 [PATCH net] net/x25: don't call lock_sock() from softirq in x25_kill_by_neigh() Nguyen Ngoc Thang
2026-10-05 15:20 ` netdev-bot+sashiko
2026-11-23 7:57 ` Martin Schiller
2026-11-23 8:03 ` [PATCH] x25: defer socket cleanup on link termination to process context Martin Schiller
2026-11-23 10:39 ` Shuai Liu [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-10-11 0:03 [syzbot] [x25?] inconsistent lock state in x25_kill_by_neigh (2) syzbot
2026-11-16 0:34 ` [PATCH] x25: defer socket cleanup on link termination to process context Shuai Liu
2026-11-18 18:35 ` netdev-bot+sashiko
2026-11-19 1:24 ` Shuai Liu
2026-11-23 1:40 ` netdev-bot+sashiko
2026-11-23 3:47 ` Shuai Liu
2026-11-24 3:49 ` netdev-bot+sashiko
2026-11-23 3:48 ` [PATCH v3] " Shuai Liu
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_72DC05B1DB892BF77B6916964DF9A3263907@qq.com \
--to=847807867@qq.com \
--cc=linux-x25@vger.kernel.org \
--cc=ms@dev.tdt.de \
--cc=netdev@vger.kernel.org \
--cc=syzbot+300375dfd44665f063a6@syzkaller.appspotmail.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