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=1796418579; b=cC/93Y1kppmmFCaIo98FkTF2bqBH+1j+sVOO18LbUS0P9w32Ce4BQei/FaHXo4w0StYl jC+MSbPxKyKYNwxpDbOyd3Gu1QMS4kYo84l4ZOS5/UjvYZbuMut8E+bk3k33eYWMWUvYZ I9y9n6qp7oe6WT678cxePI9Jg58c+DPtnMTR8oDhP7Bqcu6PzBRBal7S1SAGbN+udOdu5 dTRzxXwTA/L58PC73IWXv3eQKGmTstnM7AF2CXhIVxE/142F7MnTQS4C4Vzi08vMsWw8z r7+IK4aJItpgKqsLTgAmNauspQUBuePMZzCUB97S2OOva8NTVmDUkgynXmHVNT2wHVQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796418579; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=+xKnu8sphr1FBw1Yn3o+aaCbros4QA9aasypMjqlt1w=; b=r2+UW9EzJibLT7GjJ8FN1wWxPDrXulFfwtaD5SMolNzklU0dfI48FvuvhINRzkGKYPvQ eni3NG/9m2uv1oLKhdYAL3UNYqSggJfM6gsGCxHnR4xFGIa0oxWtfB4lMqYuiRXQoqQ1X 93qz+aTMsN+q27QZkqqqeddG35u0hHd9LMs2lAMOslShf9zgLY5fICWTOdxxwJw3I/ri6 DNkSqpenvbqAfbRJ7udEqBvmsa6o2SPv33pAsPQNN/3dA1nwi4zZqwfU0f0upzHhQ9qQU ii1elOZkESxwdyAo4VjcbdfGfLJ1WbL4ROVnt9UdFztCUvZB62ws8IybiR5WeRgU0Mg== 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=oOwD2ogn; 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 389A4606A334 for ; Fri, 4 Dec 2026 21:09: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=oOwD2ogn Received: by smtp.kernel.org (Postfix) with ESMTPSA id B79911F0093B; Fri, 4 Dec 2026 21:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796418578; bh=+xKnu8sphr1FBw1Yn3o+aaCbros4QA9aasypMjqlt1w=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=oOwD2ogneRGPzeNVm3d737IjZg0LMbbVQ44Q6TXy/TPfOArL+cjw9/OTuq8Q4sjEL j5VtSn7XFFZ+sMnCr9vsAyEg/SYOJ+nmKAs4RIfY8d4OSi90O8X90TjLily6eu7Hxo PbUczlTrLV05FthK5k9cVAM3xa13FNR3NlsojTRcsiPkX8UUqznMYipLG+mj/Vw2Iw 5fHMx/kHsXlLLZ17SaMEaKjTtUE5894102LGPNyk2PbB6HYIKZd+1NFzL+FGc/DXvm hLQGmRH4N4HINtVE6v3bK0j54rAf9apXmMo6qjIh/aVFY0YfVoWrG8jEeIo5RDs7WR QlKR6rPFhBTSg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net 09/10] selftests: drv-net: devmem: test unreadable kTLS RX Reply-To: sashiko-reviews@lists.linux.dev To: "Octavian Purdila" Cc: bpf@vger.kernel.org In-Reply-To: <62d1a0251d6eef295df7215f274cce53dec2d6e9.1796329894.git.tavip@google.com> References: <62d1a0251d6eef295df7215f274cce53dec2d6e9.1796329894.git.tavip@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 21:09:38 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [Medium] selftests: drv-net: hardcoded UDMABUF_CREATE breaks non-generic arches - [Low] selftests: drv-net: devmem: check_rx_tls() missing ksft_disruptive decorator - [Low] selftests: drv-net: unchecked cm.exception.errno in run_rx_tls() - [Low] selftests: drv-net: missing/late netlink close in _setup_devmem_rx_queue() -- commit 410173c7bfe04f4674fa99cc975e15cce6f0d840 Author: Octavian Purdila selftests: drv-net: devmem: test unreadable kTLS RX This commit adds an end-to-end devmem.py regression test that binds a devmem RX queue from Python and verifies that configuring kTLS TLS_RX on a socket with queued unreadable devmem fragments rejects the record with EFAULT. > diff --git a/tools/testing/selftests/drivers/net/hw/devmem.py b/tools/tes= ting/selftests/drivers/net/hw/devmem.py > index 82c11ffc4add7..d15118060d261 100755 > --- a/tools/testing/selftests/drivers/net/hw/devmem.py > +++ b/tools/testing/selftests/drivers/net/hw/devmem.py [ ... ] > @@ -36,12 +36,17 @@ def check_rx_large_niov(cfg) -> None: > run_rx_large_niov(cfg) > =20 > =20 > +def check_rx_tls(cfg) -> None: > + """Run the unreadable kTLS RX test.""" > + run_rx_tls(cfg) [Severity: Low] Should check_rx_tls() be annotated with @ksft_disruptive? run_rx_tls() -> _setup_devmem_rx_queue() reconfigures ring HDS parameters via ethnl.rings_set(), which bounces the interface on drivers like bnxt (bnxt_set_ringparam() -> bnxt_close_nic()). Without @ksft_disruptive, running devmem.py with DISRUPTIVE=3DFalse on a single-interface host still executes this test and can disconnect NETIF. [ ... ] > diff --git a/tools/testing/selftests/drivers/net/hw/devmem_lib.py b/tools= /testing/selftests/drivers/net/hw/devmem_lib.py > index 71b916c161969..75199a01ca3fc 100644 > --- a/tools/testing/selftests/drivers/net/hw/devmem_lib.py > +++ b/tools/testing/selftests/drivers/net/hw/devmem_lib.py [ ... ] > @@ -314,3 +320,203 @@ def run_rx_hds(cfg): [ ... ] > +UDMABUF_FLAGS_CLOEXEC =3D 0x01 > +UDMABUF_CREATE =3D 0x40187542 [Severity: Medium] Will hardcoding UDMABUF_CREATE =3D 0x40187542 break on architectures that do not use asm-generic/ioctl.h? include/uapi/linux/udmabuf.h defines UDMABUF_CREATE with _IOW(), which evaluates to 0x80187542 on PowerPC, MIPS, SPARC, Alpha, and PA-RISC. On those architectures, udmabuf_ioctl() rejects 0x40187542 with ENOTTY in _Udmabuf.__init__(). [ ... ] > +def _setup_devmem_rx_queue(cfg): > + """Isolate and bind one devmem RX queue; return its queue ID.""" > + require_devmem(cfg) > + ethnl =3D EthtoolFamily() > + channels =3D ethnl.channels_get({'header': {'dev-index': cfg.ifindex= }}) > + qcnt =3D channels.get('rx-count', 0) + channels.get('combined-count'= , 0) > + if qcnt < 2: > + raise KsftSkipEx("Test requires at least 2 RX queues") [ ... ] > + netdevnl =3D NetdevFamily() > + netdevnl.bind_rx({ > + "ifindex": cfg.ifindex, > + "fd": ubuf.dmabuf_fd, > + "queues": [{"type": "rx", "id": rxq}], > + }) > + defer(netdevnl.close) > + return rxq [Severity: Low] Can _setup_devmem_rx_queue() leak the netlink sockets or fail to restore HDS on error? ethnl never registers defer(ethnl.close), and YnlFamily.__init__() creates a reference cycle via functools.partial(), so the socket stays open past scope exit until cyclic GC runs. Similarly, defer(netdevnl.close) runs too late if netdevnl.bind_rx() fails after the kernel binds the queue: the socket stays open during teardown, causing _restore_hds() to fail with EINVAL in ethnl_set_rings(). Registering defer(ethnl.close) and defer(netdevnl.close) right after each constructor ensures deterministic close and unbinding before teardown. [ ... ] > + with ksft_raises(OSError) as cm: > + conn.recv(64) > + ksft_eq(cm.exception.errno, errno.EFAULT) > + ksft_eq(conn.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR), 0) > + conn.close() [Severity: Low] Will cm.exception.errno raise AttributeError if conn.recv(64) does not fail? When no exception is raised, ksft_raises.__exit__() records a failure and leaves cm.exception as None. Dereferencing cm.exception.errno then aborts the test with AttributeError, skipping the SO_ERROR check and conn.close() before exiting the _remote_py() context; guarding with if cm.exception is not None avoids this. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796329894.gi= t.tavip@google.com?part=3D9