From: Bryam Vargas <hexlabsecurity@proton.me>
To: Hidayath Khan <hidayath@linux.ibm.com>,
Alexandra Winter <wintera@linux.ibm.com>,
Thorsten Winkler <twinkler@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
linux-s390@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC] net/iucv: af_iucv socket locking - accounting, and a staged plan
Date: Fri, 28 Aug 2026 18:34:39 +0000 [thread overview]
Message-ID: <20260828183431.21830-1-hexlabsecurity@proton.me> (raw)
In-Reply-To: <5f88daf4-cd8e-4464-b132-ac45be205121@linux.ibm.com>
Hidayath,
> Let me know how you'd like to sequence it.
Don't sequence them behind me. Send the accept_q_lock patch now, and take
iucv_callback_connreq() back. I asked for it on the 21st assuming the rework
would move, and it won't for a while: I'm in the middle of a larger project and
have only a few hours a week for this at the moment. Holding two patches and a
leak fix for that is a bad trade for you.
One thing worth having before the walk fix goes out. The lock on the walk is
necessary and it isn't sufficient. Both producers link the child and set its
state afterwards: iucv_accept_enqueue() at af_iucv.c:1916, then
nsk->sk_state = IUCV_CONNECTED at :1917, and the same order at :1693 and :1696.
So the state store sits outside accept_q_lock, and a walker holding that lock
still reads sk_state at :1372 with nothing ordering the two. iucv_accept_poll()
tests exactly that field to decide EPOLLIN, so a poll landing between :1916 and
:1917 sees a child that is on the queue and not yet CONNECTED. Moving the state
store ahead of the enqueue in both producers closes it. The lock alone narrows
the window.
> while iucv_accept_enqueue() appends from the IUCV tasklet and the
> HiperSockets softirq under bh_lock_sock(parent)
Small correction that doesn't change your conclusion: the append's own lock is
spin_lock_irqsave(&par->accept_q_lock) at :516-518, not bh_lock_sock. The walk
takes neither, so the finding stands either way -- it matters only for where
the fix goes.
You're right about iucv_accept_dequeue() too. Its walk at :542 is equally
unlocked and can't be wrapped the same way, because the loop body sleeps in
lock_sock() at :544.
All of that is source plus a model, not a run. I have no Z.
Thanks,
Bryam
next prev parent reply other threads:[~2026-08-28 18:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 22:29 [RFC] net/iucv: af_iucv socket locking - accounting, and a staged plan Bryam Vargas
2026-07-28 12:52 ` Alexandra Winter
2026-08-09 1:49 ` Bryam Vargas
2026-08-10 7:47 ` Alexandra Winter
2026-08-22 19:08 ` Hidayath Khan
2026-08-28 18:34 ` Bryam Vargas [this message]
2026-08-21 15:28 ` Hidayath Khan
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=20260828183431.21830-1-hexlabsecurity@proton.me \
--to=hexlabsecurity@proton.me \
--cc=agordeev@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hidayath@linux.ibm.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=twinkler@linux.ibm.com \
--cc=wintera@linux.ibm.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