bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Alexei Starovoitov <ast@fb.com>,
	bpf@vger.kernel.org, Networking <netdev@vger.kernel.org>,
	joe@wand.net.nz, john.fastabend@gmail.com, tgraf@suug.ch,
	Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>,
	lmb@cloudflare.com
Subject: Re: [PATCH bpf-next v2 3/7] bpf, obj: allow . char as part of the name
Date: Fri, 1 Mar 2019 10:04:54 +0100	[thread overview]
Message-ID: <82f6d64a-efac-07cb-47a6-5c7e238ff0ea@iogearbox.net> (raw)
In-Reply-To: <CAEf4BzYKj6KtAUN8Zisvvp95429cqGgdo4d54LWDtN85_8W3Rw@mail.gmail.com>

On 03/01/2019 06:52 AM, Andrii Nakryiko wrote:
> On Thu, Feb 28, 2019 at 3:31 PM Daniel Borkmann <daniel@iogearbox.net> wrote:
>>
>> Trivial addition to allow '.' aside from '_' as "special" characters
>> in the object name. Used to name maps from loader side as ".bss",
>> ".data", ".rodata".
>>
>> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> 
> Acked-by: Andrii Nakryiko <andriin@fb.com>
> 
>>  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 d3ef45e01d7a..90044da3346e 100644
>> --- a/kernel/bpf/syscall.c
>> +++ b/kernel/bpf/syscall.c
>> @@ -440,10 +440,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. */
> 
> Is there any reason names are so restrictive? Say, why not '-' as
> well? It's perfectly safe even in filenames. Or even '/' and '\'? Is
> this name used by anything else in the system, except for
> introspection?

Could be done, presumably it was more restrictive in case one might
need some reserved names in unforeseeable future, but looks so far
noone run into the need to extend it further than this. :)

>>         while (src < end && *src) {
>> -               if (!isalnum(*src) && *src != '_')
>> +               if (!isalnum(*src) &&
>> +                   *src != '_' && *src != '.')
>>                         return -EINVAL;
>>                 *dst++ = *src++;
>>         }
>> --
>> 2.17.1
>>


  reply	other threads:[~2019-03-01  9:04 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28 23:18 [PATCH bpf-next v2 0/7] BPF support for global data Daniel Borkmann
2019-02-28 23:18 ` [PATCH bpf-next v2 1/7] bpf: implement lookup-free direct value access Daniel Borkmann
2019-03-01  3:33   ` Jann Horn
2019-03-01  3:58   ` kbuild test robot
2019-03-01  5:46   ` Andrii Nakryiko
2019-03-01  9:49     ` Daniel Borkmann
2019-03-01 18:50       ` Jakub Kicinski
2019-03-01 19:35       ` Andrii Nakryiko
2019-03-01 20:08         ` Jakub Kicinski
2019-03-01 17:18   ` Yonghong Song
2019-03-01 19:51     ` Daniel Borkmann
2019-03-01 23:02       ` Yonghong Song
2019-03-04  6:03   ` Andrii Nakryiko
2019-03-04 15:59     ` Daniel Borkmann
2019-03-04 17:32       ` Andrii Nakryiko
2019-02-28 23:18 ` [PATCH bpf-next v2 2/7] bpf: add program side {rd,wr}only support Daniel Borkmann
2019-03-01  3:51   ` Jakub Kicinski
2019-03-01  9:01     ` Daniel Borkmann
2019-02-28 23:18 ` [PATCH bpf-next v2 3/7] bpf, obj: allow . char as part of the name Daniel Borkmann
2019-03-01  5:52   ` Andrii Nakryiko
2019-03-01  9:04     ` Daniel Borkmann [this message]
2019-02-28 23:18 ` [PATCH bpf-next v2 4/7] bpf, libbpf: refactor relocation handling Daniel Borkmann
2019-02-28 23:18 ` [PATCH bpf-next v2 5/7] bpf, libbpf: support global data/bss/rodata sections Daniel Borkmann
2019-02-28 23:41   ` Stanislav Fomichev
2019-03-01  0:19     ` Daniel Borkmann
2019-03-02  0:23       ` Yonghong Song
2019-03-02  0:27         ` Daniel Borkmann
2019-03-01  6:53   ` Andrii Nakryiko
2019-03-01 10:46     ` Daniel Borkmann
2019-03-01 18:10       ` Stanislav Fomichev
2019-03-01 18:46       ` Andrii Nakryiko
2019-03-01 18:11   ` Yonghong Song
2019-03-01 18:48     ` Andrii Nakryiko
2019-03-01 18:58       ` Yonghong Song
2019-03-01 19:10         ` Andrii Nakryiko
2019-03-01 19:19           ` Yonghong Song
2019-03-01 20:06             ` Daniel Borkmann
2019-03-01 20:25               ` Yonghong Song
2019-03-01 20:33                 ` Daniel Borkmann
2019-03-05  2:28               ` static bpf vars. Was: " Alexei Starovoitov
2019-03-05  9:31                 ` Daniel Borkmann
2019-03-01 19:56     ` Daniel Borkmann
2019-02-28 23:18 ` [PATCH bpf-next v2 6/7] bpf, selftest: test " Daniel Borkmann
2019-03-01 19:13   ` Andrii Nakryiko
2019-03-01 20:02     ` Daniel Borkmann
2019-02-28 23:18 ` [PATCH bpf-next v2 7/7] bpf, selftest: test {rd,wr}only flags and direct value access Daniel Borkmann

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=82f6d64a-efac-07cb-47a6-5c7e238ff0ea@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --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).