Linux Security Modules development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] fsverity: Explicitly require FMODE_READ to retrieve hashes
Date: Thu, 22 Oct 2026 21:18:58 +0000	[thread overview]
Message-ID: <sashiko-outbox-182056@kernel.org> (raw)
In-Reply-To: <20261022211522.1489943-1-ebiggers@kernel.org>

> 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.
> 
> Opening an ioctl-only fd generally requires read (and write) permission.
> However, there are gaps with certain LSMs: an ioctl-only fd requests
> read (and write) permission via security_inode_permission, but not
> security_file_open.  With certain LSMs relying on the latter, such as
> Landlock and AppArmor, an ioctl-only fd can be opened without the LSM
> granting read (and write) permission.
> 
> Since FS_IOC_READ_VERITY_METADATA returns hashes of file contents
> blocks, it should require read permission.  This also applies to
> FS_IOC_MEASURE_VERITY, which returns a hash for the whole file.
> 
> [ ... ]
> 
> Fixes: 4dd893d832cf ("fs-verity: implement FS_IOC_MEASURE_VERITY ioctl")
> Fixes: e17fe6579de0 ("fs-verity: add FS_IOC_READ_VERITY_METADATA ioctl")
> Cc: stable@vger.kernel.org
> Signed-off-by: Eric Biggers <ebiggers@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261022211522.1489943-1-ebiggers@kernel.org?part=1


  reply	other threads:[~2026-10-22 21:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 21:15 [PATCH] fsverity: Explicitly require FMODE_READ to retrieve hashes Eric Biggers
2026-10-22 21:18 ` sashiko-bot [this message]
2026-10-26 13:36 ` Andrey Albershteyn
2026-10-28 18:06 ` 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=sashiko-outbox-182056@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sashiko-reviews@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox