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@xxxxxxxxxxxxx> --- 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. */ while (src < end && *src) { - if (!isalnum(*src) && *src != '_') + if (!isalnum(*src) && + *src != '_' && *src != '.') return -EINVAL; *dst++ = *src++; } -- 2.17.1