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=1795948727; b=cYeqnbBGnLlcEtiMVwHM8FT97ODijQ5fM43jJsHo4n/xlvE+oYyn4QdBE8R/YzLQRqSv +PlTAMQSu5YIgGSZDJlS07lU/vpkCgT+UsmVTrU5C7azI1ybuGq/Z8GkaJ0yoHxj3dg4M 9NEttxJ1Tu0eDV15dh3LfvvP69QBmGU3UavtoTycdg44SoLJGjI3HaH6PDp9/xu/aYLN0 p8bESyH12eltDQItHZYZlWFFHnBmtC39x4vX5aQogGdty1FUZrlkb1/gNmzviETy5pBb2 GkGaawiI6jsoqsZEiwZkYJxfPMDMlGF1hS5CblT4SY+vceZ/t2DztyPJ1HiwRXoPG7A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795948727; 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=ggNJ98+QvgmcQtOlgCbmsQI79LuxBSqpefyFI6Z9/7M=; b=GhFphtyUFrKCtG2pgmmyb/8WEtAKxo4OPF/Dy/0CUESDxzVF5OkFJvNsRYja9O3Gq86j seuUJbpuNOg+aKdBzJ3+LKK4tC4u69dSblVu6LnwWCyzmRsNvpl73Jv/st+qzWtKTawKR 9VgQd+TVOqAWZCaq5nJrRCTIEpWPesPs+P+TZt8SE9iHrLa4Fpx3k5VeKLvG9aeelL3QT SUKkoiCBnik2KbpclGijtY9q+nwb1ZuuiwuQW2cmYcj0L3j31Ecj4qU4tRWIf65SetFx3 4h7kLZsTOH4YFW4pTCd0UiWhtevdRMSobMh56b/HOZqzj3rCHzB1D+WxeFkxcJ2A/fg== 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="Vppdo/Zu"; 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 782CE606A323; Sun, 29 Nov 2026 10:38:47 +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=Vppdo/Zu Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCE101F00897; Sun, 29 Nov 2026 10:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795948726; bh=ggNJ98+QvgmcQtOlgCbmsQI79LuxBSqpefyFI6Z9/7M=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Vppdo/ZuEfV7bUQ6sG/3D3DwPqpVnZSjPiMeWI6J0hiJSIXdtO28cx6ykAaZEQLam /+4A45pPZWmw2g2Bj9WBvawG1OwUZ2hXA2QLD5YemanOQYcNCmooh2yjKTmy4vwcD5 BMsZ27syS2H11PTvURskPYe66G0tKudKh5IEo4pfIXiPR13rlzIBPMs6PTO17l91BF t6tB/AxlXWsObhQl7E+nh9LH2tDqFaVMxAuthjR1FXQLtWtw/HwTz91a/UKazZ6bju /SJOn/KspIz0Hb54EZH1rR8Eur3nH7zfsb4kcET++jlUToeZnS7THYhhTuqkSKpvNs T8kwLT3UalXVQ== Subject: Re: [PATCH net-next v5 02/14] selftests: dpll: add test library and device lifecycle tests From: netdev-bot+sashiko@kernel.org To: poros@redhat.com Cc: netdev@vger.kernel.org, ivecera@redhat.com, jiri@nvidia.com, corbet@lwn.net, skhan@linuxfoundation.org, shuah@kernel.org, rdunlap@infradead.org, jani.nikula@intel.com, vadim.fedorenko@linux.dev, arkadiusz.kubalewski@intel.com, jiri@resnulli.us, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Date: Sun, 29 Nov 2026 10:38:45 +0000 Message-ID: <179594872531.3146.15166593667750636013@kernel.org> In-Reply-To: <20261125090522.3777494-3-poros@redhat.com> References: <20261125090522.3777494-3-poros@redhat.com> X-sashiko-severity: Low 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 more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] Signal race in dpllsim_create_device() (tools/testing/selftests/drivers/dpll/dpll_lib.sh) that can make a run… -- selftests: dpll: add test library and device lifecycle tests This adds a shell library for the DPLL selftests. It wraps the iproute2 dpll tool and the dpllsim configfs interface. It also adds two scripts: dpll_basic.sh checks the mandatory device attributes over netlink, and dpll_stress.sh repeatedly creates, deploys and deletes dpllsim devices. > diff --git a/tools/testing/selftests/drivers/dpll/dpll_lib.sh b/tools/testing/selftests/drivers/dpll/dpll_lib.sh > new file mode 100644 > index 0000000000000..467527a4343af > --- /dev/null > +++ b/tools/testing/selftests/drivers/dpll/dpll_lib.sh > @@ -0,0 +1,446 @@ [ ... ] > +dpllsim_create_device() > +{ > + local name=$1 > + local clock_id=$2 > + local dev_path="$DPLLSIM_CFG/$name" > + > + # A directory of that name was left behind by something else and > + # must never be recorded as a device of this run. > + [ -e "$dev_path" ] && return 1 > + > + # Record the name before the directory exists, so that a cleanup > + # run by a signal between the two still finds it. > + DPLLSIM_CREATED_NAME=$name > + if ! mkdir "$dev_path" 2>/dev/null; then > + DPLLSIM_CREATED_NAME="" > + return 1 > + fi [Severity: Low] Can the cleanup handler end up deleting a dpllsim device that this run did not create? The flock in dpll_lib_lock() only serializes the scripts in this directory. Other users of the shared dpllsim configfs directory are not serialized by it. Examples are a root user working by hand, or a run in a container that has its own /run but shares the global configfs. Suppose such a user creates a directory with the same name between the [ -e "$dev_path" ] check and the mkdir. The mkdir then fails with EEXIST. DPLLSIM_CREATED_NAME still holds the name in two windows: - between the assignment and the mkdir - after the failed mkdir returns, before DPLLSIM_CREATED_NAME="" bash runs a pending INT or TERM trap as soon as the foreground command finishes. A harness timeout or Ctrl-C in either window runs the trap below, and the trap exits before the reset happens: trap 'trap "" INT TERM; trap - EXIT; cleanup; exit 1' INT TERM [ ... ] > diff --git a/tools/testing/selftests/drivers/dpll/dpll_stress.sh b/tools/testing/selftests/drivers/dpll/dpll_stress.sh > new file mode 100755 > index 0000000000000..2c60ac9faefda > --- /dev/null > +++ b/tools/testing/selftests/drivers/dpll/dpll_stress.sh > @@ -0,0 +1,201 @@ [ ... ] > +cleanup() > +{ > + # A second signal must not abort the teardown half way. > + trap '' INT TERM > + > + local dev > + > + for dev in "${CREATED_DEVICES[@]}"; do > + dpllsim_delete_device "$dev" || > + log_info "cannot delete device $dev" > + done > + # The device whose creation a signal interrupted is recorded by the > + # library alone, a double delete of a tracked one is harmless. > + if [ -n "$DPLLSIM_CREATED_NAME" ]; then > + dpllsim_delete_device "$DPLLSIM_CREATED_NAME" || > + log_info "cannot delete device $DPLLSIM_CREATED_NAME" > + fi > + dpll_lib_cleanup > +} [Severity: Low] In that case, dpllsim_delete_device() here finds the other user's directory and writes 0 to its live attribute. That unregisters the device from the DPLL core, and the directory is then removed with rmdir. cleanup() in dpll_basic.sh does the same, reached through dpllsim_setup_standard_device()->dpllsim_create_device(). The v4 changelog says a directory that existed before must never be recorded as a device of the run. Doesn't recording the name before an mkdir that can fail leave a window where the record points at a directory this run did not create? The window is narrow. It needs another root user to create the exact std/st/cycle name that was just picked, and a signal at the same moment. [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125090522.3777494-1-poros%40redhat.com