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=1796525619; b=dXJLncBCBrctwfQKzlSE6yji3t8vTflMdEUrfDPiJ/B6MDvX3CILMdynUIsRmQDZZzsv H2jeY1+JeNYuCk3jrE59nWU7xEtIL+Z2zqK5f0gAjoa8fpzM/HNeoZvkqrJqTGtzLauCQ C7GCZwWZAs++GDg4xCXMmHTXj/luK8G7Rd0hvzH43tcn6Nxvk1f3wuj1Und7f57+PZRc4 k7pSfhxP0wyMdaAPRUr6tAZUFgZ6CVbfrS+F9hiosUDVe8jWjQkMNxmFMibh6QgUSoaMn hLdyzf65LdjX6idYQ8+76FvTYSOw6KkOY0UnOwH20k9pCOQwjqU7HfuUzoP2c3/csUw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796525619; 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=EU2EBKiEOwXK8VFZceq16DeAPho+TUAK4x5qkAPO7/s=; b=rVGeJZO92Wl3dIciDVsYYNRtoG8uElqtscYFBnYELAAjwT0tuU8xxI5S6F+1t8Lgsl/r XAnS5MHBb9qz2vJuHM2Cbka5mW7zXmx8z+rIAufYToww/e0CNLcS6vwxVS77QaZulAzq6 ALZTyCkak44CwWRw1FKdL95Ohl/MDHrX9KwTGmLdWw6M+4hdLlaSd3/GxY5/5NOJ9Gx62 Xjd1emrnxvX1NkvmIgqG+RfGan366/pO/ttEF9r7Ahl/OSbW7cXoZIR456VR9PzPShzLv 22EyFCtX9P3X9KjcYiyTOTXHLjJ29BSD+3yqy2WYfnvpMk6nGjDLhTj3gaVBrazUGJw== 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=ofXcqP+r; 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 474E5606A321; Sun, 6 Dec 2026 02:53:38 +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=ofXcqP+r Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11BA21F00A07; Sun, 6 Dec 2026 02:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796525618; bh=EU2EBKiEOwXK8VFZceq16DeAPho+TUAK4x5qkAPO7/s=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ofXcqP+rNHA5rQ7me1kxE4pgWjkRj+Evf9yGNYdu5EiuJD1Ts9JF6PvQTusiCTZR9 lTY/8obAZIpts47yKrcbooR7GTaJIyJPs64x+SQF0oO7MonLKciBPGaxCzxLq9XWHl Sc6Az5k1XbB6b4BaSOd64TTFnAoMVEBpGicshwtXPhEDJZy5vntPMctjfLiZNKB2y6 Y5ouSVYXAuzpJd4/MBy7tmW9UEbBkhWqdeFUXN8GTN3MiXBEzn8Er4bCUywLOcYgw9 sVw7xcEsMcA9OgKN0WUpqDhasUguvKCg2eALv9oqiTS4rpUH1COEerPctacEnMQ48w uosiL/kU+KXlQ== Subject: Re: [PATCH net-next] selftests: net: tcp_ao: test listen socket RST to a v4-mapped peer From: netdev-bot+sashiko@kernel.org To: dennylin0707@gmail.com Cc: edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, willemb@google.com, horms@kernel.org, shuah@kernel.org, 0x7f454c46@gmail.com, dsahern@kernel.org, rastislav.szabo@isovalent.com, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Date: Sun, 06 Dec 2026 02:53:37 +0000 Message-ID: <179652561759.3148.5987827821452714745@kernel.org> In-Reply-To: <20261205022210.49972-1-dennylin0707@gmail.com> References: <20261205022210.49972-1-dennylin0707@gmail.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@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] The only client-side check in test_client_listen_rst() (tools/testing/selftests/net/tcp_ao/rst.c) can never fail. - [Low] The file-level header comment of tools/testing/selftests/net/tcp_ao/rst.c says the test covers two… -- selftests: net: tcp_ao: test listen socket RST to a v4-mapped peer This adds a case to the tcp_ao rst selftest. A dual-stack listen socket must reply with an AO-signed RST to an IPv4 peer whose key was added with a v4-mapped address. The patch also makes __test_listen_socket() take the family from the address, and lets test_cmp_getsockopt_setsockopt() compare v4-mapped key addresses. Link: https://lore.kernel.org/all/CAL4WiiovxhEi8G4W9F7faF9COPTaUcjo_1VF2ObJpbUB0i1ibw@mail.gmail.com/ > diff --git a/tools/testing/selftests/net/tcp_ao/rst.c b/tools/testing/selftests/net/tcp_ao/rst.c > index 883cddf377cff..ce9d24ac6437b 100644 > --- a/tools/testing/selftests/net/tcp_ao/rst.c > +++ b/tools/testing/selftests/net/tcp_ao/rst.c > @@ -170,6 +170,74 @@ static void test_server_passive_rst(unsigned int port) [ ... ] > +static void test_server_listen_rst(unsigned int port) > +{ > + uint64_t before_cnt, after_cnt; > + int sk, lsk; [ ... ] > + sk = accept(lsk, NULL, NULL); > + if (sk < 0) > + test_error("accept()"); > + > + test_kill_sk(sk); > + before_cnt = netstat_get_one("OutRsts", NULL); > + > + synchronize_threads(); /* 2: accepted socket killed => send data */ > + synchronize_threads(); /* 3: client counters read => data sent */ > + synchronize_threads(); /* 4: client waited for the RST */ > + after_cnt = netstat_get_one("OutRsts", NULL); > + if (after_cnt <= before_cnt) > + test_fail("listen RST: OutRsts counter did not increase: %" PRIu64 " <= %" PRIu64, > + after_cnt, before_cnt); > + else > + test_ok("listen RST: counter OutRsts increased %" PRIu64 " => %" PRIu64, > + before_cnt, after_cnt); [Severity: Low] This isn't a bug, but the header comment at the top of rst.c still describes only the active reset and the passive (TIME-WAIT) reset: * In both cases TCP-AO signatures have to be correct, which is verified by * (1) checking that the TCP-AO connection was reset and (2) TCP-AO counters. In the new listen socket case the client is expected to reject the RST with a TCP_AO_MISMATCH instead of being reset. The case is checked with the OutRsts counter and a trace event, not with a reset plus TCP-AO counters. Should the header be updated to describe this third case? > + > + close(lsk); > +} [ ... ] > @@ -433,6 +503,32 @@ static void test_client_passive_rst(unsigned int port) > test_assert_counters("client passive RST", &cnt1, &cnt2, TEST_CNT_GOOD); > } > > +static void test_client_listen_rst(unsigned int port) > +{ [ ... ] > + trace_ao_event_expect(TCP_AO_MISMATCH, this_ip_dest, this_ip_addr, > + port, -1, 0, 0, 0, 1, 0, 0, 100, 100, -1); > + > + synchronize_threads(); /* 2: accepted socket killed => send data */ > + if (!test_skpair_client(sk, packet_sz, 1, TEST_CNT_BAD, &dummy)) > + test_fail("listen RST: client sock is yet connected"); [Severity: Medium] Can this test_fail() ever be reached? test_skpair_client() returns 0 only when test_client_loop() gets back all buf_sz bytes: tools/testing/selftests/net/tcp_ao/lib/sock.c:test_skpair_client() { ... ret = test_client_loop(sk, buf_sz, msg_len, &c, cond, err); test_tcp_counters_free(&c); if (ret < 0) return (int)ret; return ret != buf_sz ? -1 : 0; } test_server_listen_rst() calls test_kill_sk() on the accepted socket and never echoes anything back. Every outcome seems to give a non-zero return: - RST accepted: -ECONNRESET from __test_wait_fd() - RST rejected and the TEST_CNT_BAD condition met: -ETIMEDOUT - no RST at all: a real timeout, also -ETIMEDOUT - short recv(): -1 The condition-met case and the real timeout both end up here in __test_skpair_poll(): if (c && cond && __skpair_poll_should_stop(sk, c, cond)) break; ... if (err) *err = -ETIMEDOUT; So the caller cannot tell those two apart either. As a result, the client never asserts that its TCP-AO bad counters went up. Two checks remain. One is the server's netns-wide OutRsts counter, which goes up for any RST, signed or unsigned. The other is the TCP_AO_MISMATCH trace expectation, which is dropped on kernels without ftrace: tools/testing/selftests/net/tcp_ao/lib/ftrace-tcp.c:trace_ao_event_expect() { if (!kernel_config_has(KCONFIG_FTRACE)) return 0; ... } In that case the final trace check becomes test_skip(). The OutRsts check does catch the failure from the commit message, where no RST is sent at all. On a kernel without ftrace, though, would a regression where the listener sends an unsigned or wrongly keyed RST still pass? For comparison, test_client_passive_rst() checks err == -ECONNRESET and then calls test_assert_counters(). Could this case read the client counters before and after and assert that the bad counters increased? > + > + synchronize_threads(); /* 4: client waited for the RST */ > + test_kill_sk(sk); > +} [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261205022210.49972-1-dennylin0707%40gmail.com