From: Daniel Borkmann <daniel@iogearbox.net>
To: ast@kernel.org
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, joe@wand.net.nz,
john.fastabend@gmail.com, yhs@fb.com, andrii.nakryiko@gmail.com,
jakub.kicinski@netronome.com, tgraf@suug.ch, lmb@cloudflare.com,
Daniel Borkmann <daniel@iogearbox.net>
Subject: [PATCH rfc v3 bpf-next 4/9] bpf, obj: allow . char as part of the name
Date: Mon, 11 Mar 2019 22:51:20 +0100 [thread overview]
Message-ID: <20190311215125.17793-5-daniel@iogearbox.net> (raw)
In-Reply-To: <20190311215125.17793-1-daniel@iogearbox.net>
Trivial addition to allow '.' aside from '_' as "special" characters
in the object name. Used to allow for substrings in maps from loader
side such as ".bss", ".data", ".rodata", but could also be useful for
other purposes.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
kernel/bpf/syscall.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index b5ba138351e1..04279747c092 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -456,10 +456,10 @@ static int bpf_obj_name_cpy(char *dst, const char *src)
const char *end = src + BPF_OBJ_NAME_LEN;
memset(dst, 0, BPF_OBJ_NAME_LEN);
-
- /* Copy all isalnum() and '_' char */
+ /* Copy all isalnum(), '_' and '.' chars. */
while (src < end && *src) {
- if (!isalnum(*src) && *src != '_')
+ if (!isalnum(*src) &&
+ *src != '_' && *src != '.')
return -EINVAL;
*dst++ = *src++;
}
--
2.17.1
next prev parent reply other threads:[~2019-03-11 21:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-11 21:51 [PATCH rfc v3 bpf-next 0/9] BPF support for global data Daniel Borkmann
2019-03-11 21:51 ` [PATCH rfc v3 bpf-next 1/9] bpf: implement lookup-free direct value access for maps Daniel Borkmann
2019-03-14 18:11 ` Andrii Nakryiko
2019-03-11 21:51 ` [PATCH rfc v3 bpf-next 2/9] bpf: add program side {rd,wr}only support " Daniel Borkmann
2019-03-11 23:06 ` Alexei Starovoitov
2019-03-11 23:34 ` Daniel Borkmann
2019-03-14 19:27 ` Andrii Nakryiko
2019-03-14 19:26 ` Andrii Nakryiko
2019-03-11 21:51 ` [PATCH rfc v3 bpf-next 3/9] bpf: add syscall side map lock support Daniel Borkmann
2019-03-11 21:51 ` Daniel Borkmann [this message]
2019-03-14 19:40 ` [PATCH rfc v3 bpf-next 4/9] bpf, obj: allow . char as part of the name Andrii Nakryiko
2019-03-11 21:51 ` [PATCH rfc v3 bpf-next 5/9] bpf: sync bpf.h uapi header from tools infrastructure Daniel Borkmann
2019-03-11 21:51 ` [PATCH rfc v3 bpf-next 6/9] bpf, libbpf: refactor relocation handling Daniel Borkmann
2019-03-14 21:05 ` Andrii Nakryiko
2019-03-11 21:51 ` [PATCH rfc v3 bpf-next 7/9] bpf, libbpf: support global data/bss/rodata sections Daniel Borkmann
2019-03-14 22:14 ` Andrii Nakryiko
2019-03-11 21:51 ` [PATCH rfc v3 bpf-next 8/9] bpf, selftest: test {rd,wr}only flags and direct value access Daniel Borkmann
2019-03-19 18:18 ` Andrii Nakryiko
2019-03-11 21:51 ` [PATCH rfc v3 bpf-next 9/9] bpf, selftest: test global data/bss/rodata sections Daniel Borkmann
2019-03-19 18:28 ` Andrii Nakryiko
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=20190311215125.17793-5-daniel@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=jakub.kicinski@netronome.com \
--cc=joe@wand.net.nz \
--cc=john.fastabend@gmail.com \
--cc=lmb@cloudflare.com \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
--cc=yhs@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).