From: sashiko-bot@kernel.org
To: "Bryam Vargas" <hexlabsecurity@proton.me>
Cc: "Christian Borntraeger" <borntraeger@linux.ibm.com>,
linux-s390@vger.kernel.org, "Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>
Subject: Re: [PATCH net-next] net/iucv: serialize HiperSockets receive with the socket lock
Date: Mon, 12 Oct 2026 19:08:28 +0000 [thread overview]
Message-ID: <sashiko-outbox-168567@kernel.org> (raw)
In-Reply-To: <20261011-b4-disp-410518f4-v1-1-753bf3258292@proton.me>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] net/iucv: NULL pointer dereference in iucv_send_ctrl() due to race with close()
--
commit 5321e38163a4ca2968c5ea02ef28664bf3a65a46
Author: Bryam Vargas <hexlabsecurity@proton.me>
net/iucv: serialize HiperSockets receive with the socket lock
This commit serializes the HiperSockets receive path and recvmsg() using the
socket lock. It introduces a per-socket backlog to defer frames while the
socket is owned by a user.
Link: https://lore.kernel.org/all/20260724222917.134769-1-hexlabsecurity@proton.me/
> diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
> index 5ba875798aa41..1fcb47a087551 100644
> --- a/net/iucv/af_iucv.c
> +++ b/net/iucv/af_iucv.c
[ ... ]
> @@ -374,26 +377,28 @@ static void iucv_sever_path(struct sock *sk, int with_user_data)
> static int iucv_send_ctrl(struct sock *sk, u8 flags)
> {
> struct iucv_sock *iucv = iucv_sk(sk);
> - int err = 0;
> int blen;
> struct sk_buff *skb;
> - u8 shutdown = 0;
> + bool force;
>
> blen = sizeof(struct af_iucv_trans_hdr) +
> LL_RESERVED_SPACE(iucv->hs_dev);
[Severity: High]
Can this code cause a regression by dereferencing a NULL iucv->hs_dev during a
concurrent close()?
If another thread concurrently calls close() on the socket,
__iucv_sock_close() runs under the socket lock and sets iucv->hs_dev to NULL:
net/iucv/af_iucv.c:__iucv_sock_close() {
...
if (iucv->hs_dev) {
dev_put(iucv->hs_dev);
iucv->hs_dev = NULL;
...
}
Meanwhile, afiucv_netdev_event() can asynchronously execute during netdev state
changes (such as NETDEV_GOING_DOWN) and call iucv_send_ctrl() without holding
lock_sock(sk):
net/iucv/af_iucv.c:afiucv_netdev_event() {
...
if (event == NETDEV_GOING_DOWN)
iucv_send_ctrl(sk, AF_IUCV_FLAG_FIN);
...
}
If this happens concurrently, evaluating LL_RESERVED_SPACE(iucv->hs_dev)
could dereference a NULL device pointer and cause a panic.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261011-b4-disp-410518f4-v1-1-753bf3258292@proton.me?part=1
next prev parent reply other threads:[~2026-10-12 19:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 19:08 [PATCH net-next] net/iucv: serialize HiperSockets receive with the socket lock Bryam Vargas via B4 Relay
2026-10-11 19:08 ` Bryam Vargas
2026-10-12 19:08 ` sashiko-bot [this message]
2026-10-12 19:45 ` netdev-bot+sashiko
2026-10-13 23:12 ` 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=sashiko-outbox-168567@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hexlabsecurity@proton.me \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.