From: Eric Biggers <ebiggers@kernel.org>
To: Yichong Chen <chenyichong@uniontech.com>
Cc: tytso@mit.edu, ast@kernel.org, song@kernel.org,
fsverity@lists.linux.dev, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fsverity: reject short BPF digest buffers
Date: Wed, 5 Aug 2026 12:50:13 -0700 [thread overview]
Message-ID: <20260805195013.GD3438@quark> (raw)
In-Reply-To: <20260805075655.950308-1-chenyichong@uniontech.com>
On Wed, Aug 05, 2026 at 03:56:55PM +0800, Yichong Chen wrote:
> bpf_get_fsverity_digest() reports the digest size as the full hash digest
> size. However, when the provided dynptr only has room for part of the
> digest, the helper currently copies the truncated digest and still returns
> success.
>
> Returning success with a digest_size that is larger than the actual copied
> digest is misleading for integrity policy code. Match the ioctl
> measurement path and reject too-small output buffers with -EOVERFLOW.
>
> Fixes: 67814c00de31 ("bpf, fsverity: Add kfunc bpf_get_fsverity_digest")
> Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
> ---
> fs/verity/measure.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Already handled by https://lore.kernel.org/bpf/20260803181232.14743-1-ebiggers@kernel.org/
- Eric
prev parent reply other threads:[~2026-08-05 19:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 7:56 [PATCH] fsverity: reject short BPF digest buffers Yichong Chen
2026-08-05 19:50 ` Eric Biggers [this message]
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=20260805195013.GD3438@quark \
--to=ebiggers@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=chenyichong@uniontech.com \
--cc=fsverity@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=song@kernel.org \
--cc=tytso@mit.edu \
/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