From: Eric Biggers <ebiggers@kernel.org>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: fsverity@lists.linux.dev, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Emil Tsalapatis <emil@etsalapatis.com>,
Jiri Olsa <jolsa@kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH] fsverity: Fix bpf_get_fsverity_digest() dynptr assumptions
Date: Sat, 1 Aug 2026 13:18:30 -0700 [thread overview]
Message-ID: <20260801201830.GA9537@quark> (raw)
In-Reply-To: <DKDSGKU7WKI2.3UV1GEZW2VZWY@gmail.com>
On Sat, Aug 01, 2026 at 07:38:08PM +0200, Kumar Kartikeya Dwivedi wrote:
> On Sat Aug 1, 2026 at 7:35 PM CEST, Kumar Kartikeya Dwivedi wrote:
> > On Sat Aug 1, 2026 at 7:15 PM CEST, Eric Biggers wrote:
> >> On Sat, Aug 01, 2026 at 06:52:45PM +0200, Kumar Kartikeya Dwivedi wrote:
> >>> > Also correctly handle sizes over INT_MAX, which previously caused an
> >>> > integer overflow and crash. __bpf_dynptr_size() returns a u64.
> >>> >
> >>>
> >>> I guess this occurs when using file dynptrs? Otherwise the size is capped to
> >>> DYNPTR_SIZE_MASK.
> >>
> >> Yes, though it looks like __bpf_dynptr_data_rw() excludes file dynptrs.
> >> So this particular issue might be unreachable. Still seems like a good
> >> idea to match the u64 type that __bpf_dynptr_size() returns though.
> >>
> >
> > I don't see this in patchwork, so you might have to resend this with [PATCH
> > bpf-next] subject again to trigger CI if you want this to go through bpf tree.
> >
>
> Sorry, [PATCH bpf], rather.
Sure I can do that.
Would it be okay to also make this function return -EOVERFLOW if
out_digest_sz is too small, similar to FS_IOC_MEASURE_VERITY, instead of
silently truncating? The silent truncation is a footgun.
- Eric
next prev parent reply other threads:[~2026-08-01 20:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 0:39 [PATCH] fsverity: Fix bpf_get_fsverity_digest() dynptr assumptions Eric Biggers
2026-08-01 16:52 ` Kumar Kartikeya Dwivedi
2026-08-01 17:15 ` Eric Biggers
2026-08-01 17:35 ` Kumar Kartikeya Dwivedi
2026-08-01 17:38 ` Kumar Kartikeya Dwivedi
2026-08-01 20:18 ` Eric Biggers [this message]
2026-08-01 20:47 ` Kumar Kartikeya Dwivedi
2026-08-01 21:02 ` Song Liu
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=20260801201830.GA9537@quark \
--to=ebiggers@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=fsverity@lists.linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=song@kernel.org \
--cc=stable@vger.kernel.org \
--cc=yonghong.song@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