From: sashiko-bot@kernel.org
To: mbenes@suse.cz, joe.lawrence@redhat.com, jpoimboe@kernel.org,
pmladek@suse.com, song@kernel.org, jikos@kernel.org
Cc: "Yafang Shao" <laoar.shao@gmail.com>, live-patching@vger.kernel.org
Subject: Re: [PATCH v5 7/9] selftests: livepatch: Add provides/obsoletes test scenarios
Date: Sun, 09 Aug 2026 09:31:47 +0000 [thread overview]
Message-ID: <20260809093147.9D9081F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260809091954.22930-8-laoar.shao@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Race condition in test-provides-obsoletes.sh leading to flaky test failures.
--
--- Patch [7]: [PATCH v5 7/9] selftests: livepatch: Add provides/obsoletes test scenarios ---
commit b45263c641deb4b2b48bbe22a1f0bf862b20a22f
Author: Yafang Shao <laoar.shao@gmail.com>
selftests: livepatch: Add provides/obsoletes test scenarios
This commit adds test scenarios for the new provides/obsoletes mechanism in
livepatching. It introduces test-provides-obsoletes.sh to verify replacement,
coexistence, and obsolete features.
> diff --git a/tools/testing/selftests/livepatch/test-provides-obsoletes.sh b/tools/testing/selftests/livepatch/test-provides-obsoletes.sh
> new file mode 100755
> index 0000000000000..c740d463f556d
> --- /dev/null
> +++ b/tools/testing/selftests/livepatch/test-provides-obsoletes.sh
[ ... ]
> +start_test "provides 0 replaces provides 0"
> +
> +load_lp $MOD_LIVEPATCH provides=0
> +load_lp $MOD_ATOMIC provides=0
> +
> +mods=($SYSFS_KLP_DIR/*)
> +nmods=${#mods[@]}
> +if [[ "$nmods" -ne 1 ]]; then
> + die "Expecting one module listed, found $nmods"
> +fi
[Severity: Medium]
Could this directory check race with the asynchronous sysfs cleanup of the
replaced patch?
When load_lp returns, it polls until the new patch's sysfs transition file
reads '0'. However, in the kernel, klp_try_complete_transition() clears
klp_transition_patch before scheduling the asynchronous work to free replaced
patches (klp_free_replaced_patches_async).
If the test checks the directory count immediately, couldn't it sporadically
see the old patch before the async cleanup completes, causing the test to
flake with "Expecting one module listed, found 2"?
This same pattern appears in the "same provides replaces" and "obsoletes
replaces" test cases later in this script.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260809091954.22930-1-laoar.shao@gmail.com?part=7
next prev parent reply other threads:[~2026-08-09 9:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-09 9:19 [PATCH v5 0/9] livepatch: Introduce replace set support Yafang Shao
2026-08-09 9:19 ` [PATCH v5 1/9] livepatch: Fix wrong index in funcs cleanup error path Yafang Shao
2026-08-09 9:28 ` sashiko-bot
2026-08-09 9:36 ` Yafang Shao
2026-08-09 9:19 ` [PATCH v5 2/9] livepatch: Make klp_find_func() non static Yafang Shao
2026-08-09 9:32 ` sashiko-bot
2026-08-09 9:39 ` Yafang Shao
2026-08-09 9:19 ` [PATCH v5 3/9] livepatch: Call klp_init_patch_early() earlier Yafang Shao
2026-08-09 9:40 ` sashiko-bot
2026-08-09 9:19 ` [PATCH v5 4/9] livepatch: Implement replace set for scoped atomic replace Yafang Shao
2026-08-09 9:33 ` sashiko-bot
2026-08-09 9:19 ` [PATCH v5 5/9] livepatch: Deprecate stack_order Yafang Shao
2026-08-09 9:19 ` [PATCH v5 6/9] selftests: livepatch: Adapt atomic replace tests to provides/obsoletes Yafang Shao
2026-08-09 9:33 ` sashiko-bot
2026-08-09 9:45 ` Yafang Shao
2026-08-09 9:19 ` [PATCH v5 7/9] selftests: livepatch: Add provides/obsoletes test scenarios Yafang Shao
2026-08-09 9:31 ` sashiko-bot [this message]
2026-08-09 9:19 ` [PATCH v5 8/9] selftests: livepatch: Add test for state ID conflict across provides Yafang Shao
2026-08-09 9:19 ` [PATCH v5 9/9] selftests: livepatch: Add test for function " Yafang Shao
2026-08-09 9:49 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260809093147.9D9081F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@kernel.org \
--cc=laoar.shao@gmail.com \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=pmladek@suse.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=song@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.