Article View: linux.kernel.netdev
Article #9599Re: [PATCH net v3] net/iucv: take a private, writable frame before rewriting it in place
From: Simon Horman
Date: Mon, 02 Nov 2026 11:35
Date: Mon, 02 Nov 2026 11:35
39 lines
10165 bytes
10165 bytes
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>
Technical Details
Message-ID:
<20261102113505.GY257209@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354631-linux-kernel-netdev=dewy.ruReferences:
<20261028-b4-disp-1edbbc34-v3-1-13495411f5b9@proton.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354631-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <20261102113505.GY257209@horms.kernel.org> References: <20261028-b4-disp-1edbbc34-v3-1-13495411f5b9@proton.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2912536"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:FsX3Qbt1RETt4/Rj0NCXEHzuUXo= sha256:FP8KDucCH6e80i7oWI6YhW54P9nEq/2QNKUf5Kd2EBU= sha1:fEqCqGb6i1+hi7HyqmAShu0U2Yk= sha256:V4Kbm0GVftJTNALJu4Zd43v8HMf5Nt3gdIrnUNdXN/8= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 5ED981124D5; Mon, 2 Nov 2026 14:41:57 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JL7N3bQDGuGO; Mon, 2 Nov 2026 14:41:54 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-354631-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 2592A1124B7; Mon, 2 Nov 2026 14:41:45 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 771C336E2F; Mon, 2 Nov 2026 11:35:13 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793619312; b=tg7rjhP/m4KJ2jbbo6Klwy5xQaAdFyF3ScrZ5d8dt4mBt5EiNg+Fkc8vahnmd7YCgic4 +x/pILd7kpk5CIRiGupV0Dnlac1X8FSc1AhHD16fxGn8tkZIIWZEFBDmO3uRKn2RD8E0r XoZi8VRGKm8JURa5AGO6VONHMIwwPtLoBonF9fAW+5u1vZU2Ob63tWF29M2e4Tv3G5odW y0EnpD7jG4tljgnQg3Kq5YkNueIJSDz8EFeBRvTC77uC0JkdzxXjbDqKZMIwR3QplI8Ok TTdy1SBRbasKwJaI+EZov0CruB3XCraOJxsPZduus99S9gNasg2TQfFK4L4UrzQ8X7A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793619312; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=vR0MOdE6VqWSATr+1Il0VzNgeR3rfufNqV+M7Kt2OcI=; b=Fms9m+9q3OwfHiXKM/r/kAjfw5sPanjq9RwMKqHqfTnW1Lg8Yc8RUyZj26+lY6ZprAjD tJ0gD6WIMj51B6XHuWnCSDjftgTVPXjxWwIP81535v0ZSq1hvDyRWmpOI8aapRMhoNTst vCFYMV62DCLzfbzQ8MtaI3ZjXf6SxThgjd4ryk+SPm1wdd+Ie/gCAf36yuIoVNo0AXXxc jVthDPKsDDyVK4OpEjihNCxq3BAKIJ+gezzz1gudp6P4v5XJQ81asBwXzVvym+3mXm7E4 Ua9JyXDiyvKl2JTXtSNLp6jMsfZ4zAHmoJhHlEiprypxtgPXuX3ebmA4DILhPdUq3vw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=g6zkhLwA; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78A83606A337; Mon, 2 Nov 2026 11:35:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=g6zkhLwA X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793619311; b=NruqolSh8B9Kju1vcQAoWUUY3X23Vqi7aQ3il0bQ25UmXopIh0MNQNZ9prECScJJdip6 h8NhvdJfUXcHcsM+LHIt9OCgWTb4pNBgOdmfO2Yc3kDcz5Hn/wgAK6pfjti0tqKEA2tBG 1rK3yNmRsSgVjWbYG+hhZWEjoaR7rk2Tm1Ue5LfzOyxtX+/K7OfSfcZHJ72jkpgPyVOZT q1hm+hSpQ4wKtcZ8Bkq6Wgtd9wjdHicDsh/0QiZJigcGlorVNUVtovjKpUSBwFgKvPcJh jMeLB48/bxbuEEKbN/YD4j3u8b6HPI/4MIrWQZOceVWh6u3k1PAn1qXTPYhWWKyi0qg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793619311; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=vR0MOdE6VqWSATr+1Il0VzNgeR3rfufNqV+M7Kt2OcI=; b=DeQYnusgWxkjrXdefl/6wHVu6YorMPeKsYLZypuCOLtZxRWqfMyL6ixHYUxEr9UF7Z7b sutRPHHpezoL5MmyORbrQxNBPzEHNupxt5OTC3ewydQm7kbQpThY0IItyyahKnbay5qiz uKXXVLQjQs0/lEzIf9ln7sRJDwt9B7ic67nj9vVzkM1QSsxEkjQWWim2WWiiw1sdOZ5Mk gjXIBWVBNS3DVF5z+Q97b5iOLW0zfWKubMGwiwK+om/tEyt/GjpvzKRGuzDPqxR7T+dXC SbsosW5EbvsUFYop7LyIh3nQlB0fzrf31yfrdifG6pn2Ykc95ErVrosTa7dked4FAGQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=g6zkhLwA; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C238606A324; Mon, 2 Nov 2026 11:35:10 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 579401F00A16; Mon, 2 Nov 2026 11:35:08 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793619310; bh=vR0MOdE6VqWSATr+1Il0VzNgeR3rfufNqV+M7Kt2OcI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=g6zkhLwAnoufeUkSHBbY1muUICbYtYW0myU8YFpk0XArDOylrRviClHs9P29yaRNS gYSF+H1Xj7pHMFjecDJkFkggIPjZtB+IouV9m6J3/v/Nwt0BXEE9CSt/9yVpxGTYLA M0i3HkmQsVAy7s6U/D/AUMJorCPb4vWxAhaR4/XDTxnP4DgdmyyquhZ0u43X/M21r2 z9ktjFgecvp8tA2LL0I2z9XgCY1qH+SYoxzURQK41xoygeVUSyUzx2qFMpLlakYczz P8isBcP44v1vbCFNHuUDXmnmxKiNXRC29Rwb9tDSiL1LlUF4FQlIfi/yD51Rmq4P0g JF7HKHAxyd5mw== X-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 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261028-b4-disp-1edbbc34-v3-1-13495411f5b9@proton.me>