From: Eric Biggers <ebiggers@kernel.org>
To: fsverity@lists.linux.dev
Cc: Eric Biggers <ebiggers@kernel.org>
Subject: [PATCH] fsverity: Update misleading comment in fsverity_ioctl_read_metadata()
Date: Wed, 21 Oct 2026 22:40:30 +0000 [thread overview]
Message-ID: <20261021224030.2346074-1-ebiggers@kernel.org> (raw)
The comment in fsverity_ioctl_read_metadata(), which justifies not
checking for FMODE_READ, doesn't consider that the nonstandard access
mode 3 (ioctl-only) exists.
It's reasonable to continue to allow this ioctl in that case, since this
*is* an ioctl, and opening a file with mode 3 checks for read (and
write) access. However, adjust the comment to not be misleading.
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
fs/verity/read_metadata.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/verity/read_metadata.c b/fs/verity/read_metadata.c
index b4c0892430cde..5e81847bdb036 100644
--- a/fs/verity/read_metadata.c
+++ b/fs/verity/read_metadata.c
@@ -170,8 +170,9 @@ int fsverity_ioctl_read_metadata(struct file *filp, const void __user *uarg)
if (!vi)
return -ENODATA; /* not a verity file */
/*
- * Note that we don't have to explicitly check that the file is open for
- * reading, since verity files can only be opened for reading.
+ * No need to check for FMODE_READ. Verity files can't be open for
+ * writing, and opening with access mode 3 (ioctl-only) requires read
+ * (and write) permission, so the opener has read permission either way.
*/
if (copy_from_user(&arg, uarg, sizeof(arg)))
base-commit: ccc4d9f8912a5d9f519a34c3633fe53c8f9b429e
--
2.56.0.218.g1ec904b173-goog
next reply other threads:[~2026-10-21 22:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 22:40 Eric Biggers [this message]
2026-10-22 9:17 ` [PATCH] fsverity: Update misleading comment in fsverity_ioctl_read_metadata() Andrey Albershteyn
2026-10-22 19:59 ` Eric Biggers
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=20261021224030.2346074-1-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=fsverity@lists.linux.dev \
/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.