From: Thorsten Blum <blum@kernel.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Song Liu <song@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Ihor Solodrai <ihor.solodrai@linux.dev>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
Yonghong Song <yonghong.song@linux.dev>,
Emil Tsalapatis <emil@etsalapatis.com>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v2] lib/buildid: Avoid wraparound when aligning ELF note sizes
Date: Sat, 5 Dec 2026 18:14:39 +0100 [thread overview]
Message-ID: <axRGf2GMfMC9acZD@kernel.org> (raw)
In-Reply-To: <DNCY0OKQZ0ZC.1KDUESVZLO2VK@gmail.com>
On Sat, Dec 05, 2026 at 04:34:44PM +0000, Alexei Starovoitov wrote:
> On Sat, Dec 05, 2026 at 05:11 AM Thorsten Blum <blum@kernel.org> wrote:
> > For u32 note sizes, ALIGN() wraps the values 0xfffffffd through
> > 0xffffffff to 0 before check_add_overflow() runs. Parsing can then
> > continue as if the affected size were 0.
> >
> > Use u64 for name_sz and desc_sz to avoid alignment wraparound, allowing
> > check_add_overflow() to reject these malformed notes early.
>
> The code is the same as in v1. Only the log changed.
> The reason for rejection is the same as before: nothing is broken.
> It doesn't harden anything either. The owner of the file writes 0
> instead of 0xffffffff and gets the same walk. Size 0 is valid.
> I don't think we need this patch.
OK, I misunderstood your first feedback then.
prev parent reply other threads:[~2026-12-05 17:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 13:11 [PATCH bpf-next v2] lib/buildid: Avoid wraparound when aligning ELF note sizes Thorsten Blum
2026-12-05 13:43 ` bot+bpf-ci
2026-12-05 16:34 ` Alexei Starovoitov
2026-12-05 17:14 ` Thorsten Blum [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=axRGf2GMfMC9acZD@kernel.org \
--to=blum@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@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=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