From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Andrii Nakryiko <andrii@kernel.org>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH bpf-next] libbpf: avoid reading past ELF data section end when copying license
Date: Tue, 14 Dec 2021 22:08:42 -0800 [thread overview]
Message-ID: <CAADnVQJwRwmjNHiiKiAK1ZCBC3cpKgn33KJkV2G9V=AdwLG5vw@mail.gmail.com> (raw)
In-Reply-To: <20211214232054.3458774-1-andrii@kernel.org>
On Tue, Dec 14, 2021 at 3:21 PM Andrii Nakryiko <andrii@kernel.org> wrote:
>
> Fix possible read beyond ELF "license" data section if the license
> string is not properly zero-terminated. Use the fact that libbpf_strlcpy
> never accesses the (N-1)st byte of the source string because it's
> replaced with '\0' anyways.
>
> If this happens, it's a violation of contract between libbpf and a user,
> but not handling this more robustly upsets CIFuzz, so given the fix is
> trivial, let's fix the potential issue.
>
> Fixes: 9fc205b413b3 ("libbpf: Add sane strncpy alternative and use it internally")
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Applied. Thanks
prev parent reply other threads:[~2021-12-15 6:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 23:20 [PATCH bpf-next] libbpf: avoid reading past ELF data section end when copying license Andrii Nakryiko
2021-12-15 6:08 ` Alexei Starovoitov [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='CAADnVQJwRwmjNHiiKiAK1ZCBC3cpKgn33KJkV2G9V=AdwLG5vw@mail.gmail.com' \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
/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;
as well as URLs for NNTP newsgroup(s).