From: sashiko-bot@kernel.org
To: "Prashant Singh" <singhpra@juniper.net>
Cc: linux-rt-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] efivarfs: add nostatfs mount option to skip QueryVariableInfo()
Date: Mon, 28 Sep 2026 20:47:19 +0000 [thread overview]
Message-ID: <20260928204720.290F01F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928203445.72318-1-singhpra@juniper.net>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] vfs: missing READ_ONCE() for opts->nostatfs in efivarfs_show_options()
--
commit 8539129e21537b2431de520ca79339783ffada2d
Author: Prashant Singh <singhpra@juniper.net>
Subject: efivarfs: add nostatfs mount option to skip QueryVariableInfo()
This commit adds a negatable "nostatfs" mount option to efivarfs. It skips
the EFI QueryVariableInfo() call during statfs(2), which can take tens of
milliseconds and run with preemption disabled. The option can also be toggled
on a live mount via remount.
> diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
> index 8d33f11db2a1b..efeada6e314f4 100644
> --- a/fs/efivarfs/super.c
> +++ b/fs/efivarfs/super.c
> @@ -74,6 +74,9 @@ static int efivarfs_show_options(struct seq_file *m, struct dentry *root)
> if (!gid_eq(opts->gid, GLOBAL_ROOT_GID))
> seq_printf(m, ",gid=%u",
> from_kgid_munged(&init_user_ns, opts->gid));
> + /* Absence of nostatfs means statfs() reports real capacity. */
> + if (opts->nostatfs)
^^^^
[Severity: Low]
Is a READ_ONCE() needed here?
This plain C read of opts->nostatfs in efivarfs_show_options() can race with
the concurrent WRITE_ONCE() in efivarfs_reconfigure() during a remount.
A userspace process reading /proc/mounts calls efivarfs_show_options() holding
only namespace_sem for read, while a concurrent mount -o remount calls
efivarfs_reconfigure() holding only sb->s_umount for write. Because no common
lock serializes these two paths, missing the READ_ONCE() here could lead to a
KCSAN data race splat.
> + seq_puts(m, ",nostatfs");
> return 0;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260928203445.72318-1-singhpra@juniper.net?part=1
next prev parent reply other threads:[~2026-09-28 20:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 20:34 Prashant Singh
2026-09-28 20:47 ` sashiko-bot [this message]
2026-09-29 6:32 ` Ard Biesheuvel
2026-09-29 7:43 ` Sebastian Andrzej Siewior
2026-09-29 12:22 ` Ard Biesheuvel
2026-09-29 15:14 ` Sebastian Andrzej Siewior
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=20260928204720.290F01F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=singhpra@juniper.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®