From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796107587; b=lkx/Mcc7EzYtXKLRCcNRlcE8T3lS4R2E6Nux+VPulxRoVouZAfAyT4KnJqaixjLr7Sl+ tpAXPtdF2LY2YNU6U0rGfYeRjtqqL5Km927N1Wpjse19hdYm+Y0+NjrfTdZNeZ6eutL2l X8coBLHnJh8Z5LqyfQbJ3bz40cJwulHHR12VivNjRbDbRlqyp9R2otAmO/aFOofkY+u4a 60wB3dBZkRCKooZfq9o4qXyLXiNh92JNZuaMcQ8Jq/Bw2i8sxRfoem8YPfHRXJgABvDf3 LDp/crOmUvDobvFI1GAY3oKs4rl2aDxY7W6HT+6Z4R/wE7YdkkFuWZeqvw10gh/wRcw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107587; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=JRW/hi6pFxgu4cGwEU4hlIi2CVmr9JlGubzQMoZ1WcI=; b=pBagmhR51VCG74pMgCm2TV+iqJ72EiPrVjIYo/Xaf0qUcDF4PUzymvaYPC5rewwl3/jP QAibfy21MNQLVNKUuPEAVf8E6gNrNQEIEk7Co6H/rjA5ObIRHBpkfGMb/6pPe173TAWfB giUhPckWXc/WLfWbMJ548Sbz9roEQ0x3jLqY4DKDzf1zSE4iR+4V3XlRvDOcInEpcPQeP +CJyJGNnsc1NS1wgITHpe91MpTXu9L+uqBTadb27DVeaowsZfr66vBTnXksAjGEYRUK71 1mpzK94RE87WjuT3ByYzvJqXPm6vShmEaQ34RWR0JRva+MpoOVcm9/UW3Tb86DGrjPQ== 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=GFt21PIp; arc=none smtp.remote-ip=100.103.45.18 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 8A8BA606A69D; Tue, 1 Dec 2026 06:46:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GFt21PIp Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E3241F00A21; Tue, 1 Dec 2026 06:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796107587; bh=JRW/hi6pFxgu4cGwEU4hlIi2CVmr9JlGubzQMoZ1WcI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GFt21PIpUsSr39AB0LS67f3ztGvdb9tRex5b2fv6ZlK/aWhdER3wNm+9DxnpCO0/P SmXdCDXkEwBxL1gq8sahMiSGYAcVFFpUtSjFCaVkfmpX7XY3Gid93BLtz8xB+sbARn 30wVmHNqLc3bTyrgZHZxrNt54FkL8ygmfIwu5T39QbARFVFPGPRKf5J7KU/kkwmhCP 4H3HGN6oGAp5vQTwftPdITPo0pvbZmevh4Sf1CzwHbxYoBYaqCTx5Qs0X4qyXCo9Vo i+jZVqqU99cym5YpmA0XyKxpxIF0S3SAKw8qT7+YLo87Ba7jGSRWR2ofl0o/nM8oWY nCK2avsnh5m5g== Subject: Re: [PATCH net-next v5 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes From: netdev-bot+sashiko@kernel.org To: omar@blockcast.net Cc: ap420073@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, horms@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, willemb@google.com Date: Tue, 01 Dec 2026 06:46:25 +0000 Message-ID: <179610758587.3146.15824857978778400410@kernel.org> In-Reply-To: <20261130064249.1874523-13-omar@blockcast.net> References: <20261130064249.1874523-13-omar@blockcast.net> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 1 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] Four rejection cases in amt_gw_v6.sh only test the kernel rule they are named after if iproute2 sends an unspecified or multicast… - [Low] probe_v6_gateway() in amt_gw_v6.sh also skips on any probe- creation error containing "Operation not supported" (line 70). -- selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes This adds a netlink-only selftest for the AMT IPv6 attributes IFLA_AMT_LOCAL_IP6 and IFLA_AMT_DISCOVERY_IP6. It checks that IPv6 and IPv4 gateways and relays read back correctly through amt_fill_info(). It also checks that each new link-creation rule rejects bad input with the expected extack message, and a probe skips the test when iproute2 or the kernel lacks IPv6 AMT support. > diff --git a/tools/testing/selftests/net/amt_gw_v6.sh b/tools/testing/selftests/net/amt_gw_v6.sh > new file mode 100755 > index 0000000000000..f44e95051b74f > --- /dev/null > +++ b/tools/testing/selftests/net/amt_gw_v6.sh > @@ -0,0 +1,221 @@ [ ... ] > + if ! add_amt amtprobe mode gateway local "$V6_LOCAL" \ > + discovery "$V6_DISC"; then > + case "$ADD_ERR" in [ ... ] > + *"Local attribute is required"*|*"expected rather than"*|\ > + *"IPv6 support is disabled"*|*"Unknown device type"*|\ > + *"Operation not supported"*) > + echo "SKIP: no IPv6 AMT support: $ADD_ERR" > + exit "$ksft_skip" > + ;; > + esac > + echo "FAIL: cannot create an IPv6 gateway: $ADD_ERR" > + exit "$ksft_fail" [Severity: Low] Is the "Operation not supported" pattern in probe_v6_gateway() intended? The commit message lists the probe's skip conditions one by one and then says: "Any other failure to create the probe link is a FAIL." "Operation not supported" is not in that list. When amt is missing, __rtnl_newlink() already sets an extack, and the script matches that message separately: net/core/rtnetlink.c:__rtnl_newlink() { ... if (!ops) { NL_SET_ERR_MSG(extack, "Unknown device type"); return -EOPNOTSUPP; } ... } With an iproute2 that supports extended ACK, the strerror match mostly catches an EOPNOTSUPP that has no extack message. One example is a netdev notifier failing during register_netdevice() or netdev_upper_dev_link() in amt_newlink(). This is unlikely on a dummy device in a fresh netns. Still, wouldn't such a create failure become a SKIP instead of a FAIL? You could either drop the pattern or list it in the commit message. [ ... ] > +expect_reject() > +{ > + local desc=$1 want=$2; shift 2 > + > + RET=0 > + add_amt amtbad "$@" > + check_fail $? "link was created but should have been rejected" > + ip -n "$GW" link del amtbad 2>/dev/null > + grep -qi -- "$want" <<< "$ADD_ERR" > + check_err $? "rejected for the wrong reason: $ADD_ERR" > + log_test "$desc" > +} [ ... ] > +expect_reject "unspecified v6 local is rejected" \ > + "Invalid Local IPv6" \ > + mode relay local :: [ ... ] > +expect_reject "multicast v6 local is rejected" \ > + "Invalid Local IPv6" \ > + mode relay local ff02::1 > +expect_reject "multicast v6 discovery is rejected" \ > + "must be unicast" \ > + mode gateway local "$V6_LOCAL" discovery ff02::1 [ ... ] > +expect_reject "unspecified v6 discovery is rejected" \ > + "must be unicast" \ > + mode gateway local "$V6_LOCAL" discovery :: [Severity: Medium] Do these four cases only work if iproute2 passes :: or a multicast address to the kernel unchanged? expect_reject() passes only if ADD_ERR contains the kernel's extack text. amt_newlink() is the only source of "Invalid Local IPv6 address" and "discovery must be unicast". It emits them only when IFLA_AMT_LOCAL_IP6 or IFLA_AMT_DISCOVERY_IP6 actually reaches the kernel. The existing iproute2 amt parser follows the vxlan pattern and filters these addresses itself: - It rejects multicast addresses through is_addrtype_inet_not_multi(), with invarg("invalid local address") or invarg("invalid discovery address"). - It adds the attribute only when is_addrtype_inet_not_unspec() holds, so :: is quietly left out. Suppose the IPv6-capable iproute2 keeps that filtering. Then: local ff02::1, discovery ff02::1 fail with iproute2's own message local :: the attribute is left out and amt_validate() reports: drivers/net/amt.c:amt_validate() { ... if (!data[IFLA_AMT_LOCAL_IP] && !data[IFLA_AMT_LOCAL_IP6]) { NL_SET_ERR_MSG_MOD(extack, "Local attribute is required"); ... } discovery :: amt_validate() reports "Discovery attribute of the local family is required" None of these messages match the grep in expect_reject(). Each case would report "rejected for the wrong reason" and fail on a correct kernel. The kernel's unspecified and multicast checks would never run. The IPv6 iproute2 changes are not in this tree, so I could not confirm whether they keep the filtering. The commit message says the test checks: "an unspecified, loopback, multicast or IPv4-mapped IPv6 local or discovery address." It names only three cases that iproute2 "cannot express". Could the commit message or the script say which iproute2 behaviour these cases need? Another option is to skip them when the error comes from iproute2 or from the missing-attribute path. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130064249.1874523-1-omar%40blockcast.net