Netdev List
 help / color / mirror / Atom feed
From: Bryam Vargas <hexlabsecurity@proton.me>
To: netdev-bot+sashiko@kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Alexandra Winter <wintera@linux.ibm.com>,
	Thorsten Winkler <twinkler@linux.ibm.com>
Cc: Simon Horman <horms@kernel.org>,
	Hidayath Khan <hidayath@linux.ibm.com>,
	Nagamani PV <nagamani@linux.ibm.com>,
	linux-s390@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 1/2] net/iucv: clear hs_dev before dropping its reference
Date: Thu, 29 Oct 2026 04:17:58 +0000	[thread overview]
Message-ID: <20261029041746.406667-1-hexlabsecurity@proton.me> (raw)
In-Reply-To: <179306942370.3134.2152050460964282662@kernel.org>

On Tue, 27 Oct 2026 02:50:23 +0000, netdev-bot+sashiko@kernel.org wrote:
> - [Medium] In afiucv_hs_callback_syn(), the child now takes a reference
>   on skb->dev every time, instead of copying the listener's hs_dev.

Right, that interleaving exists, and it is the orphan the notes below
the patch describe: a SYN that passes the IUCV_LISTEN check after
close() drained the accept queue leaves a child nobody accepts or
kills. Pre-existing: bh_lock_sock() in the callback does not exclude
lock_sock() in close(). The locking series [1] is what closes it (the
callback runs under the socket lock there, so a SYN sees the listener
or a closed socket, never the gap).

What 1/2 changes is which reference the orphan holds. Before, it held
the listener's device or nothing, depending on which side of the clear
the callback read; now it holds the ingress device, which after
80230a18c164 is the same device. IOW the device leak was already there
in one of the two interleavings and 1/2 extends it to the other. Yes,
an unregister of that device then waits in netdev_wait_allrefs() for a
reference nothing drops. Both go away with the series, and I'd rather
not add a state re-check in the callback that the series removes
again. 1/2 is unchanged in v2.

The three pre-existing items: the notifier's unlocked walk and its
iucv_send_ctrl() with hs_dev cleared (Nagamani PV's patch [2] and
Haoran Wang's [3]), the child leaked on every refused SYN (Hidayath
Khan's [4]), and the child published before its parent is set (the
series).

[1] https://lore.kernel.org/netdev/20261022-b4-disp-1d26b87a-v2-0-7ee1264d812a@proton.me/
[2] https://lore.kernel.org/netdev/20260917071706.23831-1-nagamani@linux.ibm.com/
[3] https://lore.kernel.org/netdev/179241612354.5916.12881323209252769976@whr/
[4] https://lore.kernel.org/netdev/5f88daf4-cd8e-4464-b132-ac45be205121@linux.ibm.com/

Thanks,
Bryam


  reply	other threads:[~2026-10-29  4:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  2:48 [PATCH net 0/2] net/iucv: two fixes in the HiperSockets receive path Bryam Vargas via B4 Relay
2026-10-23  2:48 ` [PATCH net 1/2] net/iucv: clear hs_dev before dropping its reference Bryam Vargas via B4 Relay
2026-10-27  2:50   ` netdev-bot+sashiko
2026-10-29  4:17     ` Bryam Vargas [this message]
2026-10-23  2:48 ` [PATCH net 2/2] net/iucv: do not count the SHT frame against the receive window Bryam Vargas via B4 Relay
2026-10-27  2:50   ` netdev-bot+sashiko
2026-10-29  4:18     ` Bryam Vargas

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=20261029041746.406667-1-hexlabsecurity@proton.me \
    --to=hexlabsecurity@proton.me \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --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=nagamani@linux.ibm.com \
    --cc=netdev-bot+sashiko@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