]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add bpf_strncmp helper
authorHou Tao <houtao1@huawei.com>
Fri, 10 Dec 2021 14:16:49 +0000 (22:16 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 12 Dec 2021 01:40:23 +0000 (17:40 -0800)
commitc41c34ba32d2f8155e5b379cb25e41b012b04243
tree3b6d784c20323c61580a632867415377c4dd4205
parent1be20f35cd03117824f7f4915f5ca618f30b7144
bpf: Add bpf_strncmp helper

The helper compares two strings: one string is a null-terminated
read-only string, and another string has const max storage size
but doesn't need to be null-terminated. It can be used to compare
file name in tracing or LSM program.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211210141652.877186-2-houtao1@huawei.com
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/bpf/helpers.c
tools/include/uapi/linux/bpf.h