From: Simon Horman <horms@kernel.org>
To: Bryam Vargas <hexlabsecurity@proton.me>
Cc: Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Alexandra Winter <wintera@linux.ibm.com>,
Paolo Abeni <pabeni@redhat.com>,
Thorsten Winkler <twinkler@linux.ibm.com>,
"David S. Miller" <davem@davemloft.net>,
Hidayath Khan <hidayath@linux.ibm.com>,
Ursula Braun <ursula.braun@de.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH net v3] net/iucv: take a private, writable frame before rewriting it in place
Date: Mon, 2 Nov 2026 11:35:05 +0000 [thread overview]
Message-ID: <20261102113505.GY257209@horms.kernel.org> (raw)
In-Reply-To: <20261028-b4-disp-1edbbc34-v3-1-13495411f5b9@proton.me>
On Wed, Oct 28, 2026 at 11:47:13PM -0500, Bryam Vargas wrote:
> afiucv_hs_rcv() rewrites the frame in place -- EBCASC() on four name
> fields, then afiucv_swap_src_dest() swaps them and pushes an Ethernet
> header -- and can hand the same skb to dev_queue_xmit(), without making
> it private first, so a packet socket that also gets the frame reads the
> rewritten names. An ETH_P_ALL tap runs first and leaves af_iucv a
> cloned skb; a socket opened for ETH_P_AF_IUCV sits on a ptype_specific
> list, walked after ptype_base[], so deliver_skb() takes a reference and
> af_iucv runs on an skb that is shared but not cloned.
>
> Unshare, then cow, in that order: skb_cow() can reach
> pskb_expand_head(), which has BUG_ON(skb_shared()). skb_cow() tests
> skb_cloned(), which is what a rewrite of the data needs; skb_cow_head()
> tests only the header. Asking for ETH_HLEN also covers the unchecked
> push in afiucv_swap_src_dest(); on the ordinary path eth_type_trans()
> has already pulled that much, so it only compares.
>
> Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport")
> Closes: https://sashiko.dev/#/patchset/20260813-b4-disp-60433a46-v1-1-509e1200533e@proton.me?part=1
> Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
> ---
> v3: skb_cow() instead of skb_cow_head(), as Paolo and the netdev AI
> review asked: the rewrite is in the data, and skb_cow_head()'s
> skb_header_cloned() test would leave it shared with a nohdr holder
> (none reaches af_iucv today; still the wrong contract). One-word
> change, rebased on net. v2 carried Alexandra's Reviewed-by; v3
> changes the helper on Paolo's point, so it is not carried. Same
> s390x QEMU A/B as v2, re-run on v3: same eight boots, same table.
> Unpatched, the tap and the ETH_P_AF_IUCV socket both read the 48
> name bytes in ASCII and a SYN with no listener never reaches the
> socket; with this version every frame arrives as sent. Drop
> skb_share_check() and the socket is broken again; drop skb_cow() and
> both are.
>
> v2: https://lore.kernel.org/all/20261008-b4-disp-bf46f1ba-v2-1-46ff1ea9c40b@proton.me/
> v1: https://lore.kernel.org/all/20260815-b4-disp-dc82fde4-v1-0-e83b10b22ce9@proton.me/
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2026-11-02 11:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 4:47 Bryam Vargas via B4 Relay
2026-11-02 11:35 ` Simon Horman [this message]
2026-11-02 14:50 ` patchwork-bot+netdevbpf
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=20261102113505.GY257209@horms.kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hexlabsecurity@proton.me \
--cc=hidayath@linux.ibm.com \
--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=ursula.braun@de.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
all inboxes | Powered by JetHome®