]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Add bpf_copy_from_user_str kfunc
authorJordan Rome <linux@jordanrome.com>
Fri, 23 Aug 2024 19:51:00 +0000 (12:51 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 23 Aug 2024 22:40:01 +0000 (15:40 -0700)
commit65ab5ac4df012388481d0414fcac1d5ac1721fb3
tree2f677483b768b820295a519019d1b11b3a30c7b6
parent5772c3458bb8d17d763e0f411e1bae1bf4eda88d
bpf: Add bpf_copy_from_user_str kfunc

This adds a kfunc wrapper around strncpy_from_user,
which can be called from sleepable BPF programs.

This matches the non-sleepable 'bpf_probe_read_user_str'
helper except it includes an additional 'flags'
param, which allows consumers to clear the entire
destination buffer on success or failure.

Signed-off-by: Jordan Rome <linux@jordanrome.com>
Link: https://lore.kernel.org/r/20240823195101.3621028-1-linux@jordanrome.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/uapi/linux/bpf.h
kernel/bpf/helpers.c
tools/include/uapi/linux/bpf.h