]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: bpf_probe_read_kernel_str() has to return amount of data read on success
authorAndrii Nakryiko <andriin@fb.com>
Tue, 16 Jun 2020 05:04:30 +0000 (22:04 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 17 Jun 2020 15:50:02 +0000 (17:50 +0200)
commit5eef8c9aa0b903a32c50f65799fc5a9957f16828
tree82b0bdb70f7daa8660d243a98a1e893b4b08767c
parent3c7f61ee16b85053ae8faf64627c513508d1d334
bpf: bpf_probe_read_kernel_str() has to return amount of data read on success

During recent refactorings, bpf_probe_read_kernel_str() started returning 0 on
success, instead of amount of data successfully read. This majorly breaks
applications relying on bpf_probe_read_kernel_str() and bpf_probe_read_str()
and their results. Fix this by returning actual number of bytes read.

Fixes: dd8a7c1c55bb ("bpf: rework the compat kernel probe handling")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200616050432.1902042-1-andriin@fb.com
kernel/trace/bpf_trace.c