Re: [PATCH bpf v2 2/2] fsverity: Fix silent truncation in bpf_get_fsverity_digest()
From: Song Liu
Date: Tue Aug 04 2026 - 01:42:10 EST
On Mon, Aug 3, 2026 at 11:13 AM Eric Biggers <ebiggers@xxxxxxxxxx> wrote:
>
> bpf_get_fsverity_digest() silently truncates the digest if the provided
> buffer is too small. This is a footgun, and it doesn't match the
> semantics of the equivalent UAPI (FS_IOC_MEASURE_VERITY).
>
> Change it to return -EOVERFLOW instead, matching FS_IOC_MEASURE_VERITY.
>
> Fixes: 67814c00de31 ("bpf, fsverity: Add kfunc bpf_get_fsverity_digest")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
Acked-by: Song Liu <song@xxxxxxxxxx>