[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAN+4W8j-s3YSj-Ct7pNiXkhVnsVkv_bWx22WCnkGYf3mjRf_Fw@mail.gmail.com>
Date: Wed, 7 May 2025 10:06:57 +0100
From: Lorenz Bauer <lmb@...valent.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Arnd Bergmann <arnd@...db.de>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>, Eduard Zingerman <eddyz87@...il.com>, Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>, John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>,
Jiri Olsa <jolsa@...nel.org>, Mykola Lysenko <mykolal@...com>, Shuah Khan <shuah@...nel.org>,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH bpf-next v3 1/3] btf: allow mmap of vmlinux btf
On Tue, May 6, 2025 at 10:39 PM Andrii Nakryiko
<andrii.nakryiko@...il.com> wrote:
>
> > + if (vma->vm_pgoff)
> > + return -EINVAL;
>
> any particular reason to not allow vm_pgoff?
Doesn't seem particularly useful because the header is at offset 0,
and I don't trust myself to get the overflow checks done right.
> it's certainly subjective, but I find this error handling with !err in
> for loop condition hard to follow. What's wrong with arguably more
> straightforward (and as you can see I'm not a big fan of mutated addr
> but calculated vma->vm_start + i * PAGE_SIZE: pick one style one
> follow it for both entities?):
Yeah that's nicer, I was just going off of what Alexei proposed.
Powered by blists - more mailing lists