From patchwork Thu Aug 27 14:47:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Edoardo Canepa X-Patchwork-Id: 2293516 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hW4BZ0xgQz1xxY for ; Fri, 28 Aug 2026 00:48:06 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1wzbOY-0001L7-AA; Thu, 27 Aug 2026 14:47:58 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1wzbOW-0001Ju-UR for kernel-team@lists.ubuntu.com; Thu, 27 Aug 2026 14:47:56 +0000 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id CFA393F28A for ; Thu, 27 Aug 2026 14:47:56 +0000 (UTC) Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-499c41f0c46so2193655e9.2 for ; Thu, 27 Aug 2026 07:47:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787842076; x=1788446876; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=0Vowz/7GWHG+zQG5NXVPdmW+cA3nLlMwIAz1BjGqEeo=; b=pbba5DLIDzXswEhLvdsP33ohlCaFB1dgk7kc22S34iTlGt1f3i8zkZuSvrWJfVKukM ZVNAj2aDCa9uDVm5wO0aOXfKjhu5/P1uTWGpEGcqtRuJC1IekSWACpFRSrsZKvQbTfs6 5DfMt+Zue8PGxK8QWVfg5KidsYYVogdQwwyt/3poW7sF1Fu/cB7KjYNz2idjwo8S7b1B jVMrTWD7ceiZ4LeDPElxWAUQe82yLIfd+GFF4CQNF4/YsajyBKKGOBxkNI5QRaNrCjHE RvsztjSDB78EY/Pijo6Mr2bKeCExsdS5EIKxcTx84moBute3Fu3RxIroZSw7K0A+FBrW 8tRQ== X-Gm-Message-State: AFuF++lgbAUhE+F5yqH4d3E5uxoeJGnUyDW3Te7GAayrqXgfVezJOI40 5fcDEduXy9tly8gjxFvYAN6gXlyxwioxXUIjON9OjLzOgmfyH0UBW7uvFbpe8feihTt1ejtbL8x mPj2ibLxX7N5hbwpVLT7fEROcpqcxvnG6LlYbResgUXhyKh7QjTccqN1l01ciEwdXSxCXCdiIZw eNYgu5BqPAR2eA1ZRJ X-Gm-Gg: AR+sD11nTnQ4hPnkthLXvuVfpY+7totHys7XkYb8AfGfgJX3VS7ldiIuIcnX6jUaGCB m3N230pBHgAMkH8wWJO/8kij/XyiebjMpqnwSy/h0+MmmBnE3aI16fC5pfzz9IpMscGRy0Kow8c vj3rSJ9C8oRz/0lNLd9KjgLqAGZgMufRB9zhiiorkZUDKhyyvL2TQS9MOwzaSaJE4UIibmGUJSj tdDqN8ExtnH2Mu2SA0Zv0tW+dqs08eZix32cdvBHVxJSEl3FPclaRbVRBaKM53aMDoLoMvr3hhO QBiIKY+iC4tVYNom/PMHVoLfTfk/NqPRLGPzBxqy6+XSZshouMr0jSUZBUUk3kArdopoH6yR3ft jfs/VVMs= X-Received: by 2002:a05:600c:3e88:b0:498:1371:660c with SMTP id 5b1f17b1804b1-499dc6a3727mr99218175e9.0.1787842076270; Thu, 27 Aug 2026 07:47:56 -0700 (PDT) X-Received: by 2002:a05:600c:3e88:b0:498:1371:660c with SMTP id 5b1f17b1804b1-499dc6a3727mr99217525e9.0.1787842075820; Thu, 27 Aug 2026 07:47:55 -0700 (PDT) Received: from localhost ([151.18.46.120]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49b8d2ba486sm34687415e9.5.2026.08.27.07.47.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2026 07:47:55 -0700 (PDT) To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/2] selftests/net: Fix tun IPv6 test addresses to avoid 6to4 range Date: Thu, 27 Aug 2026 17:47:48 +0300 Message-ID: <20260827144751.97420-2-edoardo.canepa@canonical.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <178784100453.66359.11703988426858088454@ecanepa-zbook.public> References: <178784100453.66359.11703988426858088454@ecanepa-zbook.public> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Edoardo Canepa via kernel-team From: Edoardo Canepa Reply-To: Edoardo Canepa Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Ricardo B. Marlière BugLink: https://bugs.launchpad.net/bugs/2158217 The IPv6 addresses used for the tun_vnet_udptnl fixture currently fall in the 2002::/16 prefix, which is reserved for the 6to4 transition mechanism (RFC 3056). On systems where the sit module is loaded, the kernel automatically claims 2002::/16 as a 6to4 tunnel prefix. When the test assigns a 2002:: address to a TUN interface, sit registers a competing local route for the same address. This ambiguity breaks the GENEVE decapsulation path: packets injected via the TUN fd are not delivered to the test socket, causing the IPv6-outer gtgso send_gso_packet variants to fail. Replace all four IPv6 test addresses with addresses from the fd00:db8::/32 range, which is part of the ULA space (fc00::/7, RFC 4193) and carries no special kernel semantics. Fixes: 24e59f26eef2 ("selftest: tun: Add helpers for GSO over UDP tunnel") Signed-off-by: Ricardo B. Marlière Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260706-b4-net_tun_addr-v1-1-3d3cb2473560@suse.com Signed-off-by: Jakub Kicinski (cherry picked from commit ef01724fa235a228e3d3e8b117e89403cd8feb25) Signed-off-by: Edoardo Canepa --- tools/testing/selftests/net/tun.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/tun.c b/tools/testing/selftests/net/tun.c index cf106a49b55e..abe488bac50b 100644 --- a/tools/testing/selftests/net/tun.c +++ b/tools/testing/selftests/net/tun.c @@ -42,19 +42,19 @@ static struct in_addr param_ipaddr4_inner_src = { }; static struct in6_addr param_ipaddr6_outer_dst = { - { { 0x20, 0x02, 0x0d, 0xb8, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } }, + { { 0xfd, 0x00, 0x0d, 0xb8, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } }, }; static struct in6_addr param_ipaddr6_outer_src = { - { { 0x20, 0x02, 0x0d, 0xb8, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 } }, + { { 0xfd, 0x00, 0x0d, 0xb8, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 } }, }; static struct in6_addr param_ipaddr6_inner_dst = { - { { 0x20, 0x02, 0x0d, 0xb8, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } }, + { { 0xfd, 0x00, 0x0d, 0xb8, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } }, }; static struct in6_addr param_ipaddr6_inner_src = { - { { 0x20, 0x02, 0x0d, 0xb8, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 } }, + { { 0xfd, 0x00, 0x0d, 0xb8, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 } }, }; #ifndef BIT From patchwork Thu Aug 27 14:47:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edoardo Canepa X-Patchwork-Id: 2293517 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hW4Bb6gJQz1xtN for ; Fri, 28 Aug 2026 00:48:07 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1wzbOa-0001Ne-RP; Thu, 27 Aug 2026 14:48:00 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1wzbOZ-0001Li-2m for kernel-team@lists.ubuntu.com; Thu, 27 Aug 2026 14:47:59 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id CACA43F1DA for ; Thu, 27 Aug 2026 14:47:58 +0000 (UTC) Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4994981095eso2759785e9.1 for ; Thu, 27 Aug 2026 07:47:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787842078; x=1788446878; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=tSLn2UwttyB9Xtaed+4H0C82wsQe5J274fu2CQ92vDM=; b=r9bzyynCtsI++H4bsmOzZa8Nxblri1iwnKK32RusgrLxtjdd5QjZ+6s1VC6AgxEZmG /Ibx2aViKZRqyDqtunQ2h5anwb74ybRQfiKhKkXHuXOgkPHjFdKQe/nNE40e7dch3dEw PRO6qcqNOIPv0rJuWd/FWsmZHATw5ePP8I+RWMgSX5uaBZn/r32kf8u1Zr7o2NxDRWR+ gP9eNGV9nqILeH85KSEOOuICRhNgOfz0G7CDtzOZL3N9d8mremGYMd0xCt6UVLuL9meR CQGNuhHEMuIj9ne+aqzN4QxsZbxyUih9KOUp1Od4EaL1JBSV7RiEt3hMsvYE/D4sd1td +qvw== X-Gm-Message-State: AFuF++kHZMbenHbNwuiUXmKEuWd1U7yUvsXViFYwD7WrnMMvK2Uq/QNn ttHJd54oPScHT8EbG6uUp+X+jf6hEliV9opr15MgUVMJkoYIwg31zfHhs3GcaSl/LrR6lBRcWn8 vCu5JDxETXPItpzcLsR7JtwTqh/kLNMOVi7h2MvGS7MxElwax3jqjcGk6q4ggLAi211GJ0xdUif lkwlb3unoMmchHtHTe X-Gm-Gg: AR+sD10IeAWvR3I18ZOrmHi+nSjHw/FE5/7Whz67OiM9GIiTZMZwVOe4ihXyYl+d0og /GNsbQPXxkmFXm7l5aIp3XIYIvqP3D/MLYZHj++ohZRzLjxfz1CEX3JEw8Q32FmvkExV6PUvlyj PYDneLf5KMQiJ6Jovmopz0JT1agfez2QJsqTQlkqCTqoJd5lgBaZIyhOb26X3FIFVKxFtFpPOTH bzxfQltwt7jbX0SYkuCz2woE3v/INF8366MN88K7QDC0n/Oxjkue+8Szo9se6XO5w4OQ3ceoEi9 +x+feZhX5jDI/T7q8gXeED3k2KuuwsPZrhn2mJTjcSJCISwuX7EtDAgDwjFCBGnbVhdfCxsfxcT ut9myggo= X-Received: by 2002:a05:600c:c176:b0:492:4a7a:e415 with SMTP id 5b1f17b1804b1-499dc7253e3mr94108145e9.2.1787842078283; Thu, 27 Aug 2026 07:47:58 -0700 (PDT) X-Received: by 2002:a05:600c:c176:b0:492:4a7a:e415 with SMTP id 5b1f17b1804b1-499dc7253e3mr94107725e9.2.1787842077869; Thu, 27 Aug 2026 07:47:57 -0700 (PDT) Received: from localhost ([151.18.46.120]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49b4942298fsm59994805e9.1.2026.08.27.07.47.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2026 07:47:57 -0700 (PDT) To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2] UBUNTU: SAUCE: selftests/net: Run tun tests in a dedicated network namespace Date: Thu, 27 Aug 2026 17:47:49 +0300 Message-ID: <20260827144751.97420-3-edoardo.canepa@canonical.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <178784100453.66359.11703988426858088454@ecanepa-zbook.public> References: <178784100453.66359.11703988426858088454@ecanepa-zbook.public> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Edoardo Canepa via kernel-team From: Edoardo Canepa Reply-To: Edoardo Canepa Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2158217 The tun_vnet_udptnl fixture creates geneve tunnels that bind a UDP encap socket on port 4789. When the test runs in the default network namespace, other network activity (VPN tunnels, container networking, libvirt bridges, etc.) can interfere with the geneve decapsulation path, causing send_gso_packet variants to sporadically fail with zero bytes received: tun.c:947:send_gso_packet:Expected ret (0) == variant->data_size (1423) tun.c:948:send_gso_packet:Expected r_num_mss (0) == variant->r_num_mss (2) The failure pattern is non-deterministic: different variants fail on each run, all tunnel types (4in4, 4in6, 6in4, 6in6) are affected, and only the decap direction (TUN fd -> geneve -> socket) is impacted while the encap direction (socket -> geneve -> TUN fd) always succeeds. Fix by calling unshare(CLONE_NEWNET) at program startup so all TUN and geneve devices are created in a pristine, isolated namespace with no competing traffic. This follows the same pattern already used by several other net selftests (so_incoming_cpu, tcp_port_share, icmp_rfc4884, ipv6_fragmentation, so_netns_cookie, ipsec, tcp_ao). Fixes: 24e59f26eef2 ("selftest: tun: Add helpers for GSO over UDP tunnel") Signed-off-by: Edoardo Canepa --- tools/testing/selftests/net/tun.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/tun.c b/tools/testing/selftests/net/tun.c index abe488bac50b..7f118ba3ae0b 100644 --- a/tools/testing/selftests/net/tun.c +++ b/tools/testing/selftests/net/tun.c @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -985,4 +986,12 @@ XFAIL_ADD(tun_vnet_udptnl, 6in4_over_maxbytes, recv_gso_packet); XFAIL_ADD(tun_vnet_udptnl, 4in6_over_maxbytes, recv_gso_packet); XFAIL_ADD(tun_vnet_udptnl, 6in6_over_maxbytes, recv_gso_packet); -TEST_HARNESS_MAIN +int main(int argc, char **argv) +{ + if (unshare(CLONE_NEWNET) < 0) { + perror("unshare(CLONE_NEWNET)"); + return 1; + } + + return test_harness_run(argc, argv); +}