All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>, ast@fb.com
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH bpf] libbpf: Sanitise internal map names so they are not rejected by the kernel
Date: Tue, 18 Feb 2020 15:40:29 +0100	[thread overview]
Message-ID: <9ddddbd6-aca2-61ae-b864-0f12d7fd33b4@iogearbox.net> (raw)
In-Reply-To: <20200217171701.215215-1-toke@redhat.com>

On 2/17/20 6:17 PM, Toke Høiland-Jørgensen wrote:
> The kernel only accepts map names with alphanumeric characters, underscores
> and periods in their name. However, the auto-generated internal map names
> used by libbpf takes their prefix from the user-supplied BPF object name,
> which has no such restriction. This can lead to "Invalid argument" errors
> when trying to load a BPF program using global variables.
> 
> Fix this by sanitising the map names, replacing any non-allowed characters
> with underscores.
> 
> Fixes: d859900c4c56 ("bpf, libbpf: support global data/bss/rodata sections")
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>

Makes sense to me, applied, thanks! I presume you had something like '-' in the
global var leading to rejection?

  reply	other threads:[~2020-02-18 14:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 17:17 [PATCH bpf] libbpf: Sanitise internal map names so they are not rejected by the kernel Toke Høiland-Jørgensen
2020-02-18 14:40 ` Daniel Borkmann [this message]
2020-02-18 16:19   ` Yonghong Song
2020-02-18 16:42     ` Toke Høiland-Jørgensen
2020-02-18 22:54       ` Daniel Borkmann
2020-02-19 10:28         ` Toke Høiland-Jørgensen
2020-02-19 16:45           ` Yonghong Song
2020-02-19 22:29             ` Toke Høiland-Jørgensen

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=9ddddbd6-aca2-61ae-b864-0f12d7fd33b4@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.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 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.