Article View: linux.kernel.netdev
Article #26463Re: [PATCH net-next v6 02/14] selftests: dpll: add test library and device lifecycle tests
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 15:36
Date: Thu, 03 Dec 2026 15:36
209 lines
15455 bytes
15455 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2
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] After a device has been removed, its name stays recorded in
DPLLSIM_CREATED_NAME, and the exit cleanup deletes whatever directory…
- [Low] The header of tools/testing/selftests/drivers/dpll/dpll_stress.sh
(lines 4-5) says "Uses dpllsim to put the DPLL core under load, the…
- [Low] dpll_lib_run_dir() in
tools/testing/selftests/drivers/dpll/dpll_lib.sh (lines 70-72) makes…
--
selftests: dpll: add test library and device lifecycle tests
This adds a shell library for DPLL selftests. It wraps the iproute2 dpll
tool and the dpllsim configfs interface, and the patch adds two scripts
built on it. dpll_basic.sh checks the mandatory netlink attributes of a
hardware or simulated device. dpll_stress.sh drives dpllsim devices
through repeated create/delete and register/unregister cycles.
> 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..0b75220d7d0bc
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/dpll/dpll_lib.sh
> @@ -0,0 +1,448 @@
[ ... ]
> +# Create DPLL_RUN_DIR private when it is missing and make an existing
> +# one private too, whatever the umask, others that can write to it
> +# could plant a symlink in place of the lock file. Skip when that fails.
> +dpll_lib_run_dir()
> +{
> + mkdir -m 0700 "$DPLL_RUN_DIR" 2>/dev/null
> + if ! [ -d "$DPLL_RUN_DIR" ] ||
> + ! chmod 0700 "$DPLL_RUN_DIR" 2>/dev/null; then
> + echo "SKIP: cannot set up $DPLL_RUN_DIR"
> + exit "$ksft_skip"
> + fi
> +}
> +
> +dpll_lib_lock()
> +{
> + if ! command -v flock &> /dev/null; then
> + echo "SKIP: flock not found"
> + exit "$ksft_skip"
> + fi
> + dpll_lib_run_dir
> + # A redirection that fails makes exec return non-zero here, bash
> + # exits the shell for it only in POSIX mode.
> + if ! { exec {DPLL_LOCK_FD}> "$DPLL_LOCK_FILE"; } 2>/dev/null; then
[Severity: Low]
Does dpll_lib_run_dir() fully provide the protection the commit message
describes?
"Its directory is made private whatever the umask, for the same reason."
mkdir -m 0700 sets the mode atomically only when it creates the directory.
If /run/dpll-selftest already exists, the code falls through to [ -d ] and
chmod 0700. Both of those follow symlinks, and neither checks the owner.
If the existing directory belongs to a non-root user, chmod 0700 leaves
that owner with write access. The owner can then replace lock with a
symlink, and the truncating redirection in dpll_lib_lock() opens it as
root and truncates the target.
If /run/dpll-selftest is itself a symlink to a directory, chmod changes
the mode of the target, and the lock file is opened inside it.
/run is normally root:root 0755, so only a privileged process could set
this up.
Would a check such as [ ! -L "$DPLL_RUN_DIR" ] && [ -O "$DPLL_RUN_DIR" ],
plus opening the lock file with >> or <> instead of >, close this? The
code is the same at the end of the series, where this directory also
holds the ref_tracker snapshot files.
> + echo "SKIP: cannot open $DPLL_LOCK_FILE"
> + exit "$ksft_skip"
> + fi
[ ... ]
> +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
> +
> + if ! mkdir "$dev_path" 2>/dev/null; then
> + return 1
> + fi
[ ... ]
> + DPLLSIM_CREATED_NAME=$name
> + if ! echo "$clock_id" 2>/dev/null > "$dev_path/clock_id"; then
> + rmdir "$dev_path" 2>/dev/null && DPLLSIM_CREATED_NAME=""
> + return 1
> + fi
> +}
[ ... ]
> +dpllsim_delete_device()
> +{
> + local dev_path="$DPLLSIM_CFG/$1"
> + local ret=0
> +
> + [ -d "$dev_path" ] || return 0
> +
> + dpllsim_undeploy "$1" || ret=1
> + rmdir "$dev_path" || ret=1
> +
> + return "$ret"
> +}
[Severity: Medium]
Is DPLLSIM_CREATED_NAME left stale once the device it names is gone?
dpllsim_delete_device() removes the directory but leaves the record
alone. dpllsim_create_device() only clears it on the failed clock_id
write path.
None of the callers clear it after a successful delete either:
test_rapid_create_delete() and test_deploy_cycle() only call
untrack_device "$name".
create_stress_device() deletes on a deploy failure and returns.
dpllsim_setup_standard_device() deletes on a deploy or netlink wait
failure and returns 1.
The early returns in dpllsim_create_device() (the [ -e ] check and a
failed mkdir) also leave the previous, already deleted name in place.
Both cleanup() handlers then run:
tools/testing/selftests/drivers/dpll/dpll_stress.sh:cleanup() {
...
if [ -n "$DPLLSIM_CREATED_NAME" ]; then
dpllsim_delete_device "$DPLLSIM_CREATED_NAME" ||
log_info "cannot delete device $DPLLSIM_CREATED_NAME"
fi
...
}
dpll_basic.sh has the same lines. dpllsim_delete_device() checks only
[ -d ] before it writes 0 to live and calls rmdir.
After test_rapid_create_delete() ends, the record names the last
"st<clock-id>" device for the rest of the run. Suppose something outside
this run creates a dpllsim item with that name before exit. Would
cleanup() then undeploy and remove it? The lock file only keeps out
other dpll selftest runs. This looks the same at the end of the series,
where more tests run between the first test and the cleanup at exit.
The commit message says:
"A device name is recorded only once its directory exists, so that the
cleanup cannot remove a directory another user created in between."
The cleanup comment also says "a double delete of a tracked one is
harmless". Both seem to hold only while the directory still belongs to
this run.
Could dpllsim_delete_device() clear DPLLSIM_CREATED_NAME when it removes
that name, or could the callers clear it after a successful delete?
> 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 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# DPLL subsystem stress test. Uses dpllsim to put the DPLL core under
> +# load, the tests below say what each of them exercises.
[Severity: Low]
This isn't a bug, but neither test has the description this header
points to. test_rapid_create_delete() has no comment. The only comment
in test_deploy_cycle() explains why the busywait timeouts cannot add up,
not what the test exercises.
The same holds at the end of the series for test_rapid_create_delete,
test_pin_state_flooding and test_many_devices.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202153223.2725780-1-poros%40redhat.com
Technical Details
Message-ID:
<179631216428.3146.5011387728926987110@kernel.org>Path:
mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376715-linux-kernel-netdev=dewy.ruReferences:
<20261202153223.2725780-3-poros@redhat.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376715-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v6 02/14] selftests: dpll: add test library and device lifecycle tests Date: Thu, 03 Dec 2026 15:36:04 +0000 Organization: Usenet Network Message-ID: <179631216428.3146.5011387728926987110@kernel.org> References: <20261202153223.2725780-3-poros@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2529364"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:aYOoCvU92bK/5ds5121dFm4i8U8= sha256:eTJ0PHtkqwrx1pD8tW/EdSptobVKO9r404S7aniKCx8= sha1:iGaXuOSuImokTGtoxr77rQlih2U= sha256:u2ixQKQTIg2pb0zuSQWTHYQsd/6bupDxcGjA7Hxix3Y= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 37DC51179B0; Thu, 3 Dec 2026 18:36:21 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.64 X-Spam-Status: No, score=-3.64 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oZTxtTft-wMW; Thu, 3 Dec 2026 18:36:17 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376715-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 8D99E1179A9; Thu, 3 Dec 2026 18:36:08 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 28EEC28C5E; Thu, 3 Dec 2026 15:36:07 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796312167; b=D8rcGlA89lgXuiLQIjvQJ9mxMhbdV1+sv0Jaqr+6p+GSIi820ZL/53v6YEjtjyJHx8cv exLIr2gagDHzLnynjnosBpVv6h+dbPweV14ygsMul1YFT2zU+rhWty1XzJihWt9cn2k9Y iJgBcvVYeo9DS4Wxca2Cy/gRwwWl9suCXFamRR/j0uKbI0RnEQtbiLK2RC3LcIV6LoWA1 HCrbkDUSJuordtI0KidkrfAL6mvdQVkGDR0VHnCF+zR9/tn4x3AoT/LOAbrUrTYhsuGA6 kSRDl1sQ08Pgvq05xRjchrgEEadsiBUt1Ateq3PoE98Xf84ibp6NLmXoeOoYpPm26tg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796312167; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=UriS/Lu73Bto7cpVEACXQgiExojtkfQnsBm3a1tCwbM=; b=1SP/GAhukUQO9w0sCz7x06mOEjPxcxGOrhfaq0S6vpM2CCmxMrz2wcc285Bn0a1wz5qN T0YR5ZTCcU0k7SKw/zwxsvU2q3eXkUCvPRZOVGsZBxEtNsDhZDXggZPu+ZPsgFMrH+iUU kmdX1TsxM/vPk6NFllBeMtN9H7BLtmbvr/e5zVyuF3JhiY3iI6rEwyePenLDEjAOGDXcu jyf+F/IVXp/BrqIi0Dhgo0shawAy4k9EHP3u1Yjl8C2GLacQklJmTQv4/9gzqvTrYiIB4 Q5/SE4hpxpgpMlExSlHznXL/e1ikPjWHcsN1q8as84FRINS2FMkzCuTZ9iziqV8/r9A== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=iQ5vzGM8; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0CCD606A339; Thu, 3 Dec 2026 15:36:06 +0000 (UTC) X-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=iQ5vzGM8 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796312166; b=jDcQmq1L8h6zZgd5linwj6WYvQGUVItP4ERJlvVBy4In+ia4/TClMPfq5kMK1KRU8bqV NFlTfSO0fkf2bDvi8gZb7+2T5CemnoAon4lCYUnETtw59H0w91VNNHA/oczuA8N8iEpHT aXsEbp368y/uJml0ypGlS0D3SNuCnyU4bwaAv8YfHXZ4ZWaNTgFGDz3DCBLBOmy2b2Tp3 zbBO+45PiaR/798/8dRUSbHUI+WMhmIDNMeyMNtpC/OlKYcQY4XtRPvu9aaomOYc3d+wY bZSPdbb0ZUMY+B8U8JdcNaOHjkYKbQYM69DVFocN82i/KWTmhAvrnj6JjO4HCOZOY7Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796312166; 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=UriS/Lu73Bto7cpVEACXQgiExojtkfQnsBm3a1tCwbM=; b=A6281sOes2QpHGbGeREB/juhmoWmJTNBPzgYEik9dR1sBuTuIRwjGxyJQX7RCqTxQ2nX B7kC/upNY3bR7C94ymdW49m+h8C2ttyOeY22VpWb1SJ1wpF/5wXb5t/HXtmAKAcahWJ9l pkoSngT0tzrzUM3c3v2fM3YWHV90qlqEud9TlrIgg7hGI7kb3FRHDjL9CI72pMdLY0pIv h3tdPPVE4nrjGuseCEnk9+4N0VQdtjWvO/oPsiRhbooey2s1shCJIdKaGVEGXyzA0ky2M hXmSRj8egtXh0lbYDEoPEqo4WQN/Kzzn0Q3bfuIrQmrNyXT/0AxMljn8HQpEvYuqAFA== X-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=iQ5vzGM8; arc=none smtp.remote-ip=100.103.45.18 X-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 1C3CD606A332; Thu, 3 Dec 2026 15:36:05 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF7181F000C1; Thu, 3 Dec 2026 15:36:04 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796312165; bh=UriS/Lu73Bto7cpVEACXQgiExojtkfQnsBm3a1tCwbM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=iQ5vzGM8lu52u5cc6d8/r88W14ywT+FxdhgBkbYBAG/qLUsTeNOnUtAycQWHwJbD7 rSABnvJP5jykJU0yJxdougd0ooCYYTo9FzEamYW9fZG0GBuqLl6+aDrT35Na6CbGCt 9ohEoRKgSVgz62+93mGThDr98+KjmgE9LKvot7QgRB652O30IQPqVOSd49oF8ks4SX j/bbERWUfoHECNRaxp+X1MuQPVSRNAuALQsl71eGzP362GDu9I+RHznFry4fPqONyW /8lTy4DZ0znGpwI72fgdcu0Ilqzk3afYNY/keoYExh6/crM5WdVrZLO3eCpCunXRRL i4GcfNfsksAvg== X-Cc: netdev@vger.kernel.org, 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, ivecera@redhat.com, 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 X-In-Reply-To: <20261202153223.2725780-3-poros@redhat.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list