All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Nandakumar Edamana <nandakumar@nandakumar.co.in>, bpf@vger.kernel.org
Subject: Re: Out-of-bound read suspected in libbpf.c
Date: Thu, 20 Feb 2025 13:20:51 -0800	[thread overview]
Message-ID: <eac572ada2fef3516cb1fb7977f721f738d76558.camel@gmail.com> (raw)
In-Reply-To: <fd84552e-be67-4a01-9d08-903e9481b8d3@nandakumar.co.in>

On Wed, 2025-02-19 at 20:43 +0530, Nandakumar Edamana wrote:

[...]

> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 194809da5172..1cc87dbd015d 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -2106,7 +2106,7 @@ static int set_kcfg_value_str(struct extern_desc 
> *ext, char *ext_val,
>          }
> 
>          len = strlen(value);
> -       if (value[len - 1] != '"') {
> +       if (len < 2 || value[len - 1] != '"') {

Makes sense to me, could you please send a formal patch?

>                  pr_warn("extern (kcfg) '%s': invalid string config '%s'\n",
>                          ext->name, value);
>                  return -EINVAL;
> 



  reply	other threads:[~2025-02-20 21:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-19 15:13 Out-of-bound read suspected in libbpf.c Nandakumar Edamana
2025-02-20 21:20 ` Eduard Zingerman [this message]
2025-02-21  0:41   ` [PATCH] fix: out-of-bound read " Nandakumar Edamana
2025-02-21 18:31     ` Andrii Nakryiko
2025-02-21 21:01       ` [PATCH bpf-next] libbpf: Fix out-of-bound read Nandakumar Edamana
2025-02-24 22:10         ` patchwork-bot+netdevbpf

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=eac572ada2fef3516cb1fb7977f721f738d76558.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=nandakumar@nandakumar.co.in \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.