🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6362

[BUG] net: ipvlan: failed newlink leaves shared port state changed

#6362
From: Cheng Yongkang
Date: Thu, 22 Oct 2026 09:17
52 lines
12580 bytes
Hi all,

Two failure paths in creation of a new ipvlan slave mutate shared
ipvl_port state even though the requested device is not created.

1. ipvlan_link_new() publishes the new mode/flags and existing slaves'
   IFF_NOARP/L3S state.  A later do_set_master() failure deletes only
   the new device.  The existing slave keeps the port alive, so none of
   the shared changes are rolled back.

2. If L3S hook registration fails inside ipvlan_set_port_mode(), the
   per-slave IFF_NOARP change is reverted, but the newly written shared
   port->flags value is not.

Observed on Linux v7.3, commit
08ab31164c55f20c7a2653de3186ae333470e2c1.

For the first path, an RTM_NEWLINK requesting L3S+VEPA with a nonexistent
IFLA_MASTER returned -EINVAL and no second link was created.  The
pre-existing slave nevertheless changed from:

  mode=L2 flags=0 noarp=0

to:

  mode=L3S flags=VEPA noarp=1

For the second path, fault injection in nf_hook_entries_grow() made hook
registration return -ENOMEM.  The failed request left the existing
slave's shared port at mode=L2 flags=VEPA while correctly restoring
IFF_NOARP.

The newlink operation should be transactional: defer shared-port
publication until all generic netlink steps can no longer fail, or
restore the full previous mode, flags, NOARP, hook, and l3mdev state if
the outer path deletes the new device.

The 2026-10-01 ipvlan review thread notices the narrower flags-ordering
problem, but does not cover the later do_set_master() failure or the
complete L3S/mode rollback.

Candidate BR-011 and BR-012 reproduce the two distinct failure sizes;
they are presented as one transactional-state bug here.

The PoCs, failslab runner, and logs are available on request.

This was found with a multi-agent workflow; both state
transitions were reproduced under QEMU.

Thanks,
Cheng Yongkang
Technical Details
Message-ID: <20261022091704.3652547-1-teel4res@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350466-linux-kernel-netdev=dewy.ru

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-350466-linux-kernel-netdev=dewy.ru
From: teel4res@gmail.com (Cheng Yongkang)
Newsgroups: linux.kernel.netdev
Subject: [BUG] net: ipvlan: failed newlink leaves shared port state changed
Date: Thu, 22 Oct 2026 02:17:04 -0700
Organization: Usenet Network
Message-ID: <20261022091704.3652547-1-teel4res@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="174342"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:IdErrfpI0jGrKada/uBTEZhpMmk= sha256:ACKunHRqt2i+oE9Tf398fVixDS5eYhndYkwV6VAT/JA=
	sha1:S0Qr7feaTAEmNDm0/I+kC3YmLJI= sha256:bYI9mA0ofR1l0w0oH2E83sKbbkPWKF+RZR+LIpj1V/Q=
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 C0C71111208; Thu, 22 Oct 2026 12:26:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
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 F8J0etO-s7at;
	Thu, 22 Oct 2026 12:26:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350466-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 03C8C1111F7; Thu, 22 Oct 2026 12:26:46 +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 7E1E3445DA; Thu, 22 Oct 2026 09:17:50 +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=1792660633;
	b=ZxCp4GO/SjBnvh1t6jfZYhaagC749tuzOARYkjFTxtrmm164cZoPMZMNIyZImQiwBefO
	 tfRVF53qATQ8sMHChUu3ZMGwsE5m1Q4772IcEGVdlvTxrlBjz6hdHxZSy1KgF+/f2u7or
	 jA+wmgpw6LjxL+3ZzCBAHQeet6PDn8Z2jwEq3HtZiQBp+gNFdBcd149h5LQ2PWaRA4t11
	 hcKu8vihjKIsUo6iaw1TLMu/AplGQmWt3tiMPLNM6ekmOFoX2YTG1+ihDU7McrTDUMFFf
	 z/ORRcVFPate7InYEjx2f2Q32CtCNr1bk/Wo/dHIFQKaGPAhlS3BRoFrecdkxHDDQFA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792660633;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-Id:
	 X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=sI+0nhto7gjQ/pA9pTOXfHoPEuc8oDO28HfBE2X7SBY=;
	b=BLyUZZ7CPDx9CwCC9l27IH+ZkM3xU0fJiKlGDie/lWmoDm4Ch0xghMz7ZSCIcPj/dv68
	 pAWtW9yGjo2Ur1hVOm18+ngdAcxkG8cBRzeD5UgU4AgsdXKa4/I5wOAgKNCcZt8QIaO/G
	 Pk6AZhLdF5/XBPEH2Jz377avvm6KfrgBCznMXt7weCDsVt+mDL2dJX3GRg96fGvKOlWgD
	 52LghCPYK+FkOIvt3WVUQ0cmri5fY4CHo2G02rtgXMUfv6rjtbb1lF//NW55u3u0VERzO
	 qwv58aGZVGXYGWw7Nf0s0koIXj5Lakr3i52NbcNxczlpra2ryShno5+tDQ2y4v7GCFQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=GGeP4B3q;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	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 12D5460A3822;
	Thu, 22 Oct 2026 09:17:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=GGeP4B3q
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.178
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792660632;
	b=ZONnwTb9RqMPRO4E9BwBtl1G/UO522NnnMM8sNQX+3pKTZfPiB0zdy2oT5lyNjgP9ony
	 jEIbtQHFp2OR8MsUHNYKWKTg0P9BP+5fs6ooQbwPPD5VR0SFQ1nwNTIVw6NEHNQIwpbJR
	 wCNNnzcod1tSlazlmh1jn/m98mJ/zqQu7OEztJsdx6ATgfH251jKFW79LMl9Yb5pyclB/
	 P2u4JBTQOvkrn3CtiAbVsDxC7AmaeSZ9rj6ziQSmjE9+euT7HcZn8zKevaLHnnHYMmL3w
	 LBSSkppxBdMv+c+JWBcfrcHA7ZtonZqZ7hNmXtbA0BJz7FdHB0c1nd/Ep9ImeU2jBXQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792660632;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 From:To:Cc:Subject:Date:Message-Id:X-Mailer:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=sI+0nhto7gjQ/pA9pTOXfHoPEuc8oDO28HfBE2X7SBY=;
	b=wNmFTiw1TFYamca2ntiQASRBxjSFE9YF3J3xQPE2vy0efJA9nMtHt9aYvdz+jTvJoL1l
	 ZFp2mTigzO6wjmcRSNIOpLALSTBaWllf/V195bOOvQn0Hx4tV59gstQWg85K2PI65fDIl
	 1PTpBUhgY2WV2Ytb/1aQ1+dvrXS6dbMMOpIUNTaaFv2QAnrZLsr1UExS4OHU3SI2wLJgw
	 +XVNYGKqXCalFmCyIGuJxYjx99ID7wiyZ8tzOwH/6HImHKLLEQEdvE8BPz4VxPdZ1tESJ
	 /IEvP0A4gJ0EPP3yd+ZxIX+JEP5NbgUOhPKWjXRrMZ4LW17Mp4glPM8NVcB+CzvGawg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=GGeP4B3q;
	arc=none smtp.remote-ip=74.125.82.178
X-Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD096606A338
	for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 09:17:11 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DD096606A338
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy1-f178.google.com with SMTP id 5a478bee46e88-35d0be18c71so783875eec.1
        for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 02:17:11 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792660631; x=1793265431; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=sI+0nhto7gjQ/pA9pTOXfHoPEuc8oDO28HfBE2X7SBY=;
        b=GGeP4B3qkwTiZhwWcvqnzJSVW0R2IzkWw3Bf7cB64xWCiQndWBRC1DlZ6Ox5881tIm
         1s1waCMODbbT0DlQzy3RvnPxVXvo46TPSiI6opLRtgMv2PvWzBJ44kOtBr6vRsjLvCKI
         62PL3k6Mz+he2q4IW5cEcaZpXwyS3lVg0pML8eruurCZxMxZHkbbRr8Z8ZoxDuw62sR0
         zHNlh9ejWmOC/lTPqmD7fJOwVOZtN7mCSkqJdjrC900qrw73DgNu7W1VNHpET3fZpWJz
         Dtr/ZQPI4hLspTxGSLHAx8weG+fghbOdRNQLeO0aVoitAWz1xKCgxT4JP25FjQzKna83
         athg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792660631; x=1793265431;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=sI+0nhto7gjQ/pA9pTOXfHoPEuc8oDO28HfBE2X7SBY=;
        b=MRie1Z/vQ0JFcvDGB+ZKWvootFyvjtUHLYCvQqzgUhXHzUY70dim25uTdHZVOwhhqz
         6EKNY1FbiabO2PqX/kU5qk0Zo6Z0LHCIOiASJ0Gi87zUXxWSUDKNWRJSRc3/rSAMODQ6
         ei6/Ap2uqOdMuxJOsyX24fMjw73jXaQi+hWdT8/JwpBiU9YEt/W7vguAipvJemm6n7SZ
         TcoOllfZAY+ckjes6fjiB8G3G9Gr/6RZB8TRVtRrtNJZXYmraTibNINLlY8rOrRxIm4n
         XwNH44OC3yYS2KyfJbberxskQ6QjqEpE0DZoBZgdiKn0VDp3QM3c3C6cwekmJ00zMKz2
         y2Fw==
X-Forwarded-Encrypted: i=1; AKwUvBwRk3lHHJ+MkwSJqW7JU6wBbcRsY2o0lTKCzbCFQjZE25PNjUl8ruZrsPocbUm9+S0CF43nw40=@vger.kernel.org
X-Gm-Message-State: AFq9FYLB0NA7Lty6ulAskChHngWczpYetWpYUL1S7UJtkkCzm5S5Nn5B
	qu5aT7ok45hS2WFC6WLvRaWi+ZmKDOuIgZuCusEBfOi/yK4U1HcSf94d
X-Gm-Gg: AYBFou33aWxYMrpvmheI0BK3g5Bg6gAbE5SxnrHzJXWzkCXBdt6zPgV0Dw7RJT1R2GE
	zGmGRECTS1zKb0okOiuBhPc9Nprlv6TkWUpEbhQITOd7mV+u5XiTZRpRW7hynqs973R1Ja9GqFg
	FFG6TC4gXRvzmoMSW9HAzU0FmYuFs6EDX34yloD2Jen7VD4wJxszWxcNzBE/J4cn1COzfOLmdbQ
	5osuoDekId8L1wTC5LdEMayvsXxhZbwX92eXJ+90UizfPDN8TPF1tZMShAGT4srRJ8NNT09wwwX
	AZ9QaIxqHXL6RBwzdpvv+J6sWgR1M+fFushefhZWdpw0fn/X5nQgxjjZphgaZEVFyuFQ3TwYR3b
	ukA07I2WGV3CTa7Lbnw5F2js16YzCEJKlpTwtyVdS+xY6lvl8o5yK692UuDkJn3SqS5ubxlzzWC
	VlfNhiMUqZxCMvoaIVJJ3Xa/JgctMm4dUH4UpLhbbY1tiIY0ci9GDIJ6geZR/+BjYsX/mJdMaf8
	MhyGi0+A3RhigLMPrlvy+6EOrzhB1fTkndGoeC12ZFt+9CDUn9UlUCQagqDJTshG4FekcgSBFS1
	fVej978TrLVvG6BczgI=
X-Received: by 2002:a05:7022:ed0d:b0:182:d0a8:d1a9 with SMTP id a92af1059eb24-192e88a169dmr2506797c88.0.1792660631101;
        Thu, 22 Oct 2026 02:17:11 -0700 (PDT)
X-Received: from youngkk-vm.localdomain (67.216.200.102.16clouds.com. [67.216.200.102])
        by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3673e15353csm25692692eec.2.2026.10.22.02.17.08
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 22 Oct 2026 02:17:10 -0700 (PDT)
X-Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.34.1
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