bpf: comment why dots in filenames under BPF virtual FS are not allowed
commit6d8cb045cde681e64a5ed80a2ab70be831a7f9b0
authorQuentin Monnet <quentin.monnet@netronome.com>
Fri, 9 Mar 2018 07:46:33 +0000 (8 23:46 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 9 Mar 2018 09:30:30 +0000 (9 10:30 +0100)
tree56d5def14c5a60f3b58a6f696ba1f5528b3c9403
parent75a141af68c5507727e0f4c41f8e3dd54de96fed
bpf: comment why dots in filenames under BPF virtual FS are not allowed

When pinning a file under the BPF virtual file system (traditionally
/sys/fs/bpf), using a dot in the name of the location to pin at is not
allowed. For example, trying to pin at "/sys/fs/bpf/foo.bar" will be
rejected with -EPERM.

This check was introduced at the same time as the BPF file system
itself, with commit b2197755b263 ("bpf: add support for persistent
maps/progs"). At this time, it was checked in a function called
"bpf_dname_reserved()", which made clear that using a dot was reserved
for future extensions.

This function disappeared and the check was moved elsewhere with commit
0c93b7d85d40 ("bpf: reject invalid names right in ->lookup()"), and the
meaning of the dot ban was lost.

The present commit simply adds a comment in the source to explain to the
reader that the usage of dots is reserved for future usage.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/inode.c